Logo Site EngageLab Mark Colored TransparentDocument
Search

Query Balance

Query Account Balance

Request URL

GET /v1/balance

Authentication

Uses HTTP Basic Authentication. Add Authorization to the HTTP Header:

Authorization: Basic ${base64_auth_string}
              
              Authorization: Basic ${base64_auth_string}

            
This code block in the floating window

The base64_auth_string is generated by: base64(dev_key:dev_secret)

Request Example

Request Header

GET /v1/balance HTTP/1.1 Authorization: Basic amlndWFuZ2RldjpkZXZfc2VjcmV0
              
              GET /v1/balance  HTTP/1.1
Authorization: Basic amlndWFuZ2RldjpkZXZfc2VjcmV0

            
This code block in the floating window

Request Body

None

Request Parameters

None

Response Parameters

Successful Response

Field Type Option Description
balance10000 Integer Required Normal balance, integer value multiplied by 10000
gift_balance10000 Integer Required Gift balance, integer value multiplied by 10000
balance Number Required Normal balance, floating-point
gift_balance Number Required Gift balance, floating-point
total_balance10000 Integer Required Total balance, sum of normal balance and gift balance, integer value multiplied by 10000
total_balance Number Required Total balance, sum of normal balance and gift balance, floating-point
{ "balance10000": 123456, "gift_balance10000": 20000, "balance": 12.3456, "gift_balance": 2, "total_balance10000": 143456, "total_balance": 14.3456 }
              
              {
    "balance10000": 123456,
    "gift_balance10000": 20000,
    "balance": 12.3456,
    "gift_balance": 2,
    "total_balance10000": 143456,
    "total_balance": 14.3456
}

            
This code block in the floating window

It is recommended that callers prioritize using the balance10000, gift_balance10000, and total_balance10000 fields to format the balance themselves, avoiding floating-point precision issues.

Failed Response

HTTP status code is 4xx or 5xx, the response body contains the following fields:

Field Type Option Description
code int Required Error code, see Error Codes for details
message String Required Error details
{ "code": 2001, "message": "invalid token" }
              
              {
    "code": 2001,
    "message": "invalid token"
}

            
This code block in the floating window

Error Codes

Error Code HTTP Code Description
1000 500 Internal error, please try again later
2001 401 Authentication failed, correct token not provided, or the merchant corresponding to the token does not exist
2002 401 Authentication failed, token has expired or has been disabled
2002 403 Merchant has been deleted
Icon Solid Transparent White Qiyu
Contact Sales