Balance Enquiry
Description
Merchant can use this API to query users' balance
Test environment
https://paytest.alchemypay.cc/openApi/userBalance
Prod environment
https://service.alchemypay.cc/openApi/userBalance
Http method
- POST
- Content-Type: application/JSON
Http request
Element | Mandatory | Data Type | Remarks |
---|---|---|---|
merchantCode | Y | string | once a merchant has been on-boarded with Alchemy Pay, the merchant will be provided with the credentials with merchantCode&Key |
unionId | C | string | user's unique ID can't be duplicated, can be user's mail or merchant defined ID, either unionId or userid is necessary in request. |
userid | C | string | Alchemy Pay assigned unique user ID, either unionId or userid is necessary in request. |
crypto | Y | string | crypto type: 1. with NULL, query all crypto's balance 2.c_TRON_USDT 3. c_BSC_USDT |
sign | Y | string | signature |
Http response
Element | Mandatory | Data Type | Remarks |
---|---|---|---|
code | Y | string | response code |
msg | Y | string | response message |
data | Y | hash | |
merchantCode | Y | string | once a merchant has been on-boarded with Alchemy Pay, the merchant will be provided with the credentials with merchantCode&Key |
unionId | Y | string | user's unique ID can't be duplicated, can be user's mail or merchant defined ID |
userid | Y | string | Alchemy Pay unique user ID |
dataInfo | Y | hash | |
crypto | Y | string | crypto type |
amouint | Y | string | crypto balance |
sign | Y | string | signature |
Request sample to query all crypto's balance
{
"unionId":"9746630509196001",
"sign":"FEDC425FE93549B48B4ACAB451979F2B",
"merchantCode":"ME1658812740",
"crypto":""
}
Request sample to query one crypto's balance
{
"unionId":"9746630509196001",
"sign":"FEDC425FE93549B48B4ACAB451979F2B",
"merchantCode":"ME1657712740",
"crypto":"c_TRON_USDT"
}
Response sample of all crypto's balance
{
"code": "000000",
"msg": "success",
"data": {
"sign": "33A22EF73BD0403D7BD0BA3F687FD18C",
"merchantCode": "ME1608812740",
"unionId": "9746630509196001",
"dataInfo": [
{
"amount": "0.180000000000000000",
"crypto": "c_TRON_USDT"
},
{
"amount": "0.950000000000000000",
"crypto": "c_BSC_USDT"
}
],
"userid": "UID154924123894173286"
}
}
Response sample of one crypto's balance
{
"code": "000000",
"msg": "成功",
"data": {
"sign": "7B1D87F47CC8EF4DA8342D330503B1C4",
"merchantCode": "ME1634111841889",
"unionId": "T1111111111111",
"userid": "U11111111",
"dataInfo": [{
"crypto": "c_TRON_USDT",
"amount": "16.89869"
}]
}
}
Updated 3 months ago