Settlement
POST
api/v2/settlement
Create Settlement
Parameters that need to be pass for the request create settlement.
Parameters | Type | Required | Description |
---|---|---|---|
callback_url | string | no | Callback URL |
project_id | String | Yes | Project ID |
client_transaction_id | String | Yes | Client Transaction ID |
token | String | Yes | Token details view Encryption & Decryption |
amount | Number | Yes | Settlement Amount |
process_at | Date | Yes | Need settlement process at |
currency_short_code | String | Yes | currency_short_code can get from Currency List |
bank_id | String | No | When normal settlement must required. bank_id can get from Settlement Bank List |
wallet_id | String | No | When crypto settlement must required. wallet_id can get from Settlement Wallet List |
Create Settlement With Normal Type Parameters
- callback_url:
https://www.example.com/
(string, optional) - Callback URL - project_id:
1
(string, required) - Project ID - client_transaction_id:
005
(string, required) - Client Transaction ID - token:
9BC97D2BCC7990F84F05202205E53D14
(string, required) - Token - amount:
79469220.00
(number, required) - Settlement Amount - process_at:
2022-2-22
(date, required) - Need settlement at date - currency_short_code:
vnd
(string, required) - Settlement Currency Short Code - bank_id:
STB62146a27ed16s
(string, optional) - Settlement To Bank's ID - wallet_id:
null
(string, optional) - Settlement To wallet address
Create Settlement With Crypto Type Parameters
- callback_url:
https://www.example.com/
(string, optional) - Callback URL - project_id:
1
(string, required) - Project ID - client_transaction_id:
005
(string, required) - Client Transaction ID - token:
9BC97D2BCC7990F84F05202205E53D14
(string, required) - Token - amount:
79469220.00
(number, required) - Settlement Amount - process_at:
2022-2-22
(date, required) - Need settlement at date - currency_short_code:
BTC
(string, required) - Settlement Currency Short Code - bank_id:
null
(string, optional) - Settlement To Bank's ID - wallet_id:
MW64ae65de230ac
(string, optional) - Settlement To wallet address
Response 200 from create settlement (application/json)
{
"status": 0,
"ret_msg": "Success",
"data": {
"transaction_id": "ST2210050000009",
"client_transaction_id": "20221005003",
"settlement_type": "CRYPTO",
"from_currency": "VND",
"from_amount": "100",
"to_currency": "BTC",
"to_amount": "0.000000",
"wallet_network": "TRC20",
"wallet_address": "asdvasyd7787gavv9asd97a",
"bank_name": null,
"bank_account_name": null,
"bank_account_number": null,
"status": "Unconfirmed",
"created_at": "2022/10/05 23:48:58",
"expire_time": null,
"process_at": "2022/10/05",
"token": "46B09B2397618FDB73A5E96CF6BB8869"
}
}
Confirm Settlement
POST
api/v2/settlement/update
Parameters that need to be pass for the request confirm settlement.
Parameters | Type | Required | Description |
---|---|---|---|
project_id | String | Yes | Project ID |
client_transaction_id | String | Yes | Client Transaction ID |
token | String | Yes | Token details view Encryption & Decryption |
transaction_id | String | Yes | VNPAY settlement transaction id |
status | String | Yes | Status (OK/CANCEL) |
Confirm Settlement Parameters
- project_id:
1
(string, required) - Project ID - client_transaction_id:
005
(string, required) - Client Transaction ID - token:
9BC97D2BCC7990F84F05202205E53D14
(string, required) - Token - transaction_id:
ST2202230000002
(string, required) - VNPAY settlement transaction id - status:
ok
(String, required) - Status (OK/CANCEL)
Response 200 from confirm settlement (application/json)
{
"status": 0,
"ret_msg": "Success",
"data": {}
}
Callback for settlement
{
"return_type" => "status-response",
"type" => "settlement",
"transaction_id" => "ST2021104000001",
"amount" => "1000",
"client_transaction" => "testing",
"currency" => 'VND',
"return_status" => "approve",
"remark" => 'test remark',
"created_at" => '2021-05-05 21:21:21',
"token": "259680784193BA14739EBABE0B683AEE",
}
Transaction is approved
return_status : "approve"
Transaction is rejected
return_status : "reject"
Transaction is expired:
return_status : "expire"
Requirement response by merchant
{
"status" : "successful"
}
If didn't get this message, then it will failed, VNPAY only send 3 time for a single callback.