Balance Enquiry

Description

Merchant use this API to query user's 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

ElementMandatoryData TypeRemarks
merchantCodeYstringonce a merchant has been on-boarded with Alchemy Pay, the merchant will be provided with the credentials with merchantCode&Key
unionIdCstringuser's unique ID can't be duplicated, can be user's mail or merchant defined ID, either unionId or userid is necessary in request.
useridCstringAlchemy Pay assigned unique user ID, either unionId or userid is necessary in request.
cryptoYstringcrypto type:
1. with NULL, query all crypto's balance
2.c_TRON_USDT
3. c_BSC_USDT
signYstringsignature

Http response

ElementMandatoryData TypeRemarks
codeYstringresponse code
msgYstringresponse message
dataYhash
merchantCodeYstringonce a merchant has been on-boarded with Alchemy Pay, the merchant will be provided with the credentials with merchantCode&Key
unionIdYstringuser's unique ID can't be duplicated, can be user's mail or merchant defined ID
useridYstringAlchemy Pay unique user ID
dataInfoYhash
cryptoYstringcrypto type
amouintYstringcrypto balance
signYstringsignature

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"
        }]
    }
}