API Technical Specification

Wallet Module
WALLET
Version1.0
SystemHR Management System
ModuleWALLET - Electronic Wallet
Databasewallet_db
Date2026-08-05
AuthorNam Nguyen
StatusDraft

Table of Contents

1. Introduction

1.1 API Overview

AspectValue
Base URL/api/v1
AuthenticationBearer JWT Token
Content-Typeapplication/json

2. Wallet Endpoints

2.1 View Balance FR-002

MethodPathDescription
GET/wallet/balanceView wallet balance

Response 200 OK:

{
  "id": 1,
  "currency": "VND",
  "balance": 5000000,
  "frozen_amount": 1000000,
  "available_balance": 4000000,
  "status": "active"
}

2.2 Set PIN FR-003

MethodPathDescription
POST/wallet/pinSet or change wallet PIN

Request Body:

{
  "pin": "123456",
  "confirm_pin": "123456"
}

2.3 View Transactions FR-004

MethodPathDescription
GET/wallet/transactionsView transaction history

3. Transaction Endpoints

3.1 Deposit Funds FR-006

MethodPathDescription
POST/wallet/depositDeposit funds to wallet

Request Body:

{
  "amount": 1000000,
  "currency": "VND",
  "method": "bank_transfer",
  "payment_method_id": 1
}

3.2 Request Withdrawal FR-007

MethodPathDescription
POST/wallet/withdrawRequest withdrawal

Request Body:

{
  "amount": 500000,
  "payment_method_id": 1,
  "pin": "123456"
}

3.3 Transfer Funds FR-008

MethodPathDescription
POST/wallet/transferTransfer to another wallet

Request Body:

{
  "recipient_email": "[email protected]",
  "amount": 200000,
  "pin": "123456"
}

4. Payment Endpoints

4.1 Pay for Service FR-011, FR-012

MethodPathDescription
POST/wallet/payPay for recruitment service

Request Body:

{
  "order_type": "job_posting",
  "related_id": 123,
  "amount": 2000000,
  "pin": "123456"
}

4.2 View Payment History FR-013

MethodPathDescription
GET/wallet/payment-ordersView payment order history

5. Payment Methods Endpoints

MethodPathDescriptionRequirement
GET/wallet/payment-methodsList payment methodsFR-005
POST/wallet/payment-methodsAdd payment methodFR-005
PATCH/wallet/payment-methods/:idUpdate payment methodFR-005
DELETE/wallet/payment-methods/:idRemove payment methodFR-005

6. Admin Endpoints

MethodPathDescriptionRequirement
GET/admin/wallet/payoutsList payout requestsFR-015
PATCH/admin/wallet/payouts/:idApprove/reject payoutFR-015
PATCH/admin/wallet/wallets/:id/freezeFreeze/unfreeze walletFR-015
GET/admin/wallet/walletsList all walletsFR-015

7. Webhook Endpoints

MethodPathDescription
POST/webhooks/payment/callbackPayment Gateway callback

8. Error Codes

Error CodeHTTP StatusDescription
WALLET_001404Wallet not found
WALLET_002400Insufficient balance
WALLET_003400Invalid PIN
WALLET_004400Amount exceeds daily limit
WALLET_005400Amount exceeds monthly limit
WALLET_006400Amount below minimum
WALLET_007400Wallet is frozen
WALLET_008400Recipient wallet not found