Notification message
Set callback URL
Request URL:
http://wallet.unn.com:8080/v2/wallet/config
Request method: POST
Header
parameter | type | required | description |
---|---|---|---|
token | string | true | Access Token |
Request parameters
parameter | type | required | description |
---|---|---|---|
callback | string | true | callback address |
Request Example
curl --location 'http://wallet.unn.com:8080/v2/wallet/config' \
--header 'token: service.eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMHhBNTZhQThiN0YzRmIwNDEzZEE0MTc1MjdDOWIwQzkzOUM4MDI0NEU5IiwiZW50ZXJwcmlzZV9saXN0IjpbeyJjaGFpbiI6IkVSQzIwIiwiY29udHJhY3RfYWRkciI6IjB4YzI3MTkzNTE1ODAwRjhiMTVBYzE5Qjc5MEJiNTFkODA0M2U2QmI5MiIsImVudGVycHJpc2UiOiI2NGYyOTc0YjhkZDg5NGJjNjExNWUyNjAiLCJpc19vd25lciI6ZmFsc2UsInBlcm1pc3Npb24iOlsxXSwiaWQiOiI2NTAxMTE1MmQyNjhhMTZmMGZhMTEwMjkifSx7ImNoYWluIjoiVFJDMjAiLCJjb250cmFjdF9hZGRyIjoiVENtRkhNdzk4aEE3em1HRVBmVWh4WEZjakJLaEphQ01uaCIsImVudGVycHJpc2UiOiI2NGYyOTc0YjhkZDg5NGJjNjExNWUyNjAiLCJpc19vd25lciI6ZmFsc2UsInBlcm1pc3Npb24iOlsxXSwiaWQiOiI2NTAxMTE1MmQyNjhhMTZmMGZhMTEwMjkifV0sImNyZWF0ZVRpbWUiOjE2OTUyNjMzNjYsImV4cCI6MTY5Nzg1NTM2NiwiYWNjb3VudF9uYW1lIjoiIn0.dkGAMfHMR6YQZjSMsxxLb-aCwn55FjyF7RIn_ebo7Yg' \
--header 'Content-Type: application/json' \
--data '{
"body": {
"callback": "http://43.198.64.79:30104/unn_pay/notify"
}
}'
return parameters
parameter name | type | description |
---|---|---|
id | string | ID |
Back to example
{
"code": 200,
"message": "success",
"data": {
"entity": {
"id": "64901a10a859a3412833ba1a"
}
}
}
message format
Test Message
message format
parameter | type | required | description |
---|---|---|---|
type | int | true | Message type: 0-Test message, 1-deposit notification, 2-withdrawal notification |
content_type | string | true | json |
content | dict | true | message content |
--heartbeat | int | true | heartbeat timestamp |
message example
{
"type": 0,
"content_type": "json",
"content": {
"heartbeat": 1695697870
}
}
Deposit Notification
message format
parameter | type | required | description |
---|---|---|---|
type | int | true | Message type: 0-Test message, 1-deposit notification, 2-withdrawal notification |
content_type | string | true | json |
content | dict | true | message content |
--merchant_id | string | true | Merchant ID |
--uid | string | true | User ID |
--txn_id | string | true | Transaction ID |
--chain | string | true | ERC20/TRC20 |
--from_addr | string | true | payment address |
--to_addr | string | true | transfer address |
--value | string | true | amount of local currency to transfer |
--token_addr | string | true | transfer token contract address |
--token_value | string | true | transfer token quantity |
--status | string | true | 1-pending,2-success,3-failed |
--exchange | dict | true | exchange data |
message example
{
"type": 0,
"content_type": "json",
"content": {
"merchant_id": "6510f473dd0e3494c90c72fa",
"uid": "2b063E",
"txn_id": "0x7aff9094356518b3eadadab4cce701f8040d79ba2c79d0c2451982fa3d61e94c",
"chain": "ERC20",
"from_addr": "0x52C540Ed7A198e48B57F60a791aaE83a5A2b063E",
"to_addr": "0x0F42Db9fB309E6E3a1E2E47B69ED4dd5d7aE4b14",
"value": "0",
"token_addr": "0x85E3fC24B618cE2aEad700d51710756dFC88F765",
"token_value": "100000000",
"status": 2,
"exchange": {}
}
}
Withdrawal Notification
message format
parameter | type | required | description |
---|---|---|---|
type | int | true | Message type: 0-Test message, 1-deposit notification, 2-withdrawal notification |
content_type | string | true | json |
content | dict | true | message content |
--id | string | true | Order ID |
--txn_id | string | true | Txn ID |
--chain | string | true | Network ERC20/TRC20 |
--uid | string | true | User ID |
--to_addr | string | true | transfer address |
--value | string | true | amount of local currency to transfer |
--token_addr | string | true | transfer token contract address |
--token_value | string | true | transfer token quantity |
--status | string | true | 3-reject,4-failed,5-success |
--detail | dict | true | detail |
message example
{
"type": 0,
"content_type": "json",
"content": {
"id": "6478417858624eeddde32df3",
"txn_id": "0x7aff9094356518b3eadadab4cce701f8040d79ba2c79d0c2451982fa3d61e94c",
"status": 5,
"chain": "ERC20",
"uid": "2b063E",
"to_addr": "0x0F42Db9fB309E6E3a1E2E47B69ED4dd5d7aE4b14",
"value": "0",
"token_addr": "0x85E3fC24B618cE2aEad700d51710756dFC88F765",
"token_value": "100000000",
"detail": {}
}
}