Topup
POST
api/v2/topup
Create Topup
Parameters that need to be pass for the request create Topup.
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 | Topup Amount |
currency_short_code | String | Yes | currency_short_code can get from Currency List |
wallet_network_id | String | No | When crypto top-up must required. wallet_network_id can get from Wallet Network |
description | String | No | Description. |
Create Topup With Normal Type Parameters
- callback_url:
https://www.example.com/
(string, optional) - Callback URL - project_id:
1
(string, required) - Project ID - client_transaction_id:
tp005
(string, required) - Client Transaction ID - token:
A283F11767FD78C482264E2C1AB3BFE9
(string, required) - Token - amount:
100
(number, required) - Topup Amount - currency_short_code:
vnd
(string, required) - Topup Currency Short Code - description:
null
(string, optional) - Description
Response 200 from create normal Topup (application/json)
{
"status": 0,
"ret_msg": "Success",
"data": {
"transaction_id": "TP2203220000001",
"client_transaction_id": "tp005",
"topup_type": "NORMAL",
"from_currency": "VND",
"from_amount": "100",
"to_currency": "VND",
"to_amount": "100.00",
"status": "Initial",
"created_at": "2022/10/05 23:35:20",
"topup_to": {
"currency": "VND",
"amount": "100",
"bank_name": "Techcombank (Example)",
"bank_account_name": "VNPAY (Example)",
"bank_account_number": "1234567890 (Example)"
},
"token": "1E446D24330C2CBB806F2E7D5058231A"
}
}
Create Topup With Crypto Type Parameters
- callback_url:
https://www.example.com/
(string, optional) - Callback URL - project_id:
1
(string, required) - Project ID - client_transaction_id:
tp009
(string, required) - Client Transaction ID - token:
54249EE294D14E633BF6437056D57939
(string, required) - Token - amount:
100
(number, required) - Topup Amount - currency_short_code:
ERC
(string, required) - Topup Currency Short Code - wallet_network_id:
WN62427228725da
(string, optional) - Topup Wallet Network - description:
Testing
(string, optional) - Description
Response 200 from create crypto Topup (application/json)
{
"status": 0,
"ret_msg": "Success",
"data": {
"transaction_id": "TP2203300000002",
"client_transaction_id": "tp009",
"topup_type": "CRYPTO",
"from_currency": "ERC",
"from_amount": "100",
"to_currency": "VND",
"to_amount": "200000.00",
"status": "Initial",
"created_at": "2022/03/30 12:47:49",
"expire_time": "2022/04/07 12:28:45",
"topup_to": {
"currency": "ERC",
"amount": "100",
"exchange_rate": "2000",
"wallet_address": "TYdAxAWC1Vaa2yCbUwEBngifva5zRV5UfW",
"wallet_network_name": "tronscan",
"wallet_network_base_url": "https://tronscan.org/#/"
},
"token": "CD7FAF7CB11A85314FE97B1D960ACFAE"
}
}
Confirm Topup
POST
api/v2/topup/update
The HTTP request headers for this API is:
Accept
The response format, which is required for operations with a response body. The syntax is:
Parameters that need to be pass for the request confirm topup.
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 topup transaction id |
status | String | Yes | Status (OK/CANCEL) |
payment_slip | File | No | When status is equal to OK and topup type is equal to Normal must required. The support image type have jpg, jpeg, png. This field no need add into sign token. |
tx_id | String | No | When status is equal to OK and topup type is equal to Crypto must required |
Confirm Normal Topup Parameters
- project_id:
1
(string, required) - Project ID - client_transaction_id:
tp007
(string, required) - Client Transaction ID - token:
5EDE8F30F9B4737DCBF4418F88EEE582
(string, required) - Token - transaction_id:
TP2203260000001
(string, required) - VNPAY Topup transaction id - status:
OK
(String, required) - Status (OK/CANCEL) - payment_slip:
(binary)
(File, optional) - Payment Slip - tx_id:
null
(String, optional) - tx_id
Response 200 from confirm settlement (application/json)
{
"status": 0,
"ret_msg": "Success",
"data": {}
}
Confirm Crypto Topup Parameters
- project_id:
1
(string, required) - Project ID - client_transaction_id:
tp007
(string, required) - Client Transaction ID - token:
5EDE8F30F9B4737DCBF4418F88EEE582
(string, required) - Token - transaction_id:
TP2203260000001
(string, required) - VNPAY Topup transaction id - status:
OK
(String, required) - Status (OK/CANCEL) - payment_slip:
null
(File, optional) - Payment Slip - tx_id:
56f1aa5367295c3b0fe6cb2547a1a485c219259a7906adc669412310df13c2b5
(String, optional) - tx_id
Response 200 from confirm settlement (application/json)
{
"status": 0,
"ret_msg": "Success",
"data": {}
}
Callback for top-up
{
"return_type" => "status-response",
"type" => "topup",
"transaction_id" => "TP2021104000001",
"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
Transaction is rejected
Transaction is expired:
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.