Get Balance
The getBalance
interface allows merchants to query their account balance, providing detailed information about available, frozen, and total balance amounts.
This interface is used to query the member account balance.
API URL
- UAT : https://uat.test2pay.com/sgs/api/member/getBalance
- Production : https://api.payby.com/sgs/api/member/getBalance
Request
Http Header
Attributes
Content-Language String
- Language in which the response message will be used.
- Currently, only English is supported.
- Example value:
en
- Maximum length:
10
Content-Type String Required
- Media type of the request body.
- Required for operations with a request body.
- Format:
application/<format>
(e.g.,application/json
) - Example value:
application/json
sign String Required
- Request signature using private-key cryptography.
- Ensures the payment gateway can verify the request origin.
Partner-Id String Required
- Merchant ID of your account.
- Example value:
200001200101
- Maximum length:
12
Http Body
requestTime Timestamp(3) Required
- Example value:
1581493898000
- Example value:
bizContent GetMemberBalanceRequest Required
- currencyCode String Required
- Example value: AED
- currencyCode String Required
Request Sample
Http Header
{
"Content-Language": "en",
"Content-Type": "application/json",
"Partner-Id": "200000018128",
"sign": "RXF8WmC67QSnr62l3oU33fjpUvAo6Yrgvk05c/vYLtmHRGMoAH4qSnap2pto3mY7KgyP5wkNUsyQXJ/ZwbfccSONLb5zA7Z7q74IsOwdJw3BKXxVWr4tfjkA02Pfcp0cZWjE/Y8jTcbtgdc5VI90LNmkgPWbrSlDbNW8p3NlhnKg+Xfl95SgMBPF9afttsU/2a5jLnZXSVcXoSthxpJ6XkZwd45+jhOjBguT+IC8uLVSNRvwDisRGgf9PYv39OH6ITEhbY2sgjkdzBZBOZlt7awy2vkMEsePsuafwrNhuz7xzjj55PzNzk8+zCUu/791OhC/eFUyGimtDw5mX9cyQw=="
}
Http Body
{
"bizContent":{
"currencyCode":"AED"
},
"requestTime":1708485334645
}
Response
Http Header
sign String Required
Note: The body field in the HTTP Body is returned only when:
- `applyStatus` is `SUCCESS`
- `code` is `0`
HTTP Body
Head
applyStatus String
- Example value:
"SUCCESS"
- Example value:
code String
- Example value:
"0"
- Example value:
msg String
- Example value:
"SUCCESS"
- Example value:
success Boolean
- Example value:
true
- Example value:
traceCode String
- Example value:
"375099"
- Example value:
Body
memberId String
- Example value:
"200000030907"
- Example value:
balanceList Array of Balance Objects
availableBalance Object
amount Number
- Example value:
897993.88
- Example value:
currency String
- Example value:
"AED"
- Example value:
Response Sample
// Http Header
{
"sign": "nDdClX1tAyV3qcX/Epay6AXFNRGSsWd8ysWO9SgwPrNTetSePLA9C39mGp6qRbjJeqXLEnYLwSkBu5eKdtyVX3tflGLiV2kvRjVfYpTCjXdVL2Pcnv2w+ghjHe2jL988iklk7q5AjAgdtXNphpHcTes9pk6W3bVCbvijH6at0fExUtZ91L1LrnPGELT1IJm/lFW3w4KLh0Gxs7FzDPI9RDfUemObNlRzV8kCtkWahwPgs/hBnS69GyYDKN7ihQX2UiLuP239wl6IA+VG/ZZKHPhLs8bbuOS+LKWORIp6jRt+JsAx7c/Ot1RNyOnHKxPRKJ8bVTohEp39yUz/HwG8oA=="
}
// Http Body
{
"body":{
"balanceList":[
{
"availableBalance":{
"amount":897993.88,
"currency":"AED"
}
}
],
"memberId":"200000030907"
},
"head":{
"applyStatus":"SUCCESS",
"code":"0",
"msg":"SUCCESS",
"success":true,
"traceCode":"375099"
}
}
Response Codes
Code | Message | Cause | Workaround |
---|---|---|---|
0 | SUCCESS | success | |
400 | INVALID_PARAMETER | Parameter error | Adjusting request parameters |
400 | REQUESTTIME_TOO_EARLY | The request time is greater than the current time Too early | Adjust request time |
400 | REQUESTTIME_TOO_LATER | The request time is greater than the current time Too late | Adjust request time |
402 | RATE_LIMIT_REJECT | Too many requests | Reduce request frequency |
403 | UNAUTHORIZED | API not authorized | Contact PayBy |
404 | SERVICE_NOT_AVAILABLE | API service unavailable | Contact PayBy |
500 | SYSTEM_ERROR | system error | Contact PayBy later Retry |
504 | SERVICE_TIMEOUT | Service timeout | Try again later |
601 | RISK_FAIL | Risk control verification failed | Please adjust your business |
78001 | CURRENCY_CODE_NOT_SUPPORTED | The currency is not supported. | Adjusting request parameters |