Skip to main content

Get Balance

The GetBalance API allows merchants to query their account balance, providing detailed information about available, frozen, and total balance amounts.

This API 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

Http Header

Field NameVariable NameRequiredTypeExample ValueDescription
Content-LanguageOptionalString(10)inen-English
signSignRequiredString
Partner-IdRequiredString(12)

Http Body

Field NameVariable NameRequiredTypeExample ValueDescription
When requestedrequestTimeRequiredTimestamp(3)1581493898000
BusinessbizContentRequiredGetMemberBalanceRequest

GetMemberBalanceRequest

Field NameVariable NameRequiredTypeExample ValueDescription
CurrencycurrencyCodeRequiredStringAED

Request Sample

Http Header

{
"Content-Language": "en",
"Content-Type": "application/json",
"Partner-Id": "200000018128",
"sign": "RXF8WmC67QSnr62l3oU33fjpUvAo6Yr9vk05c/vYLtmHRGMoAH4qSnap2pto3mY7KgyP5wkNUsyQXJ/ZwbfcSONLb5zA77q74lsOwdJw3BKXxVWr4tfjkA02Pfcp0cZWjE/Y8jTcbtgdc5Vl90LNmkgPWbrSlDbNW8p3NIhnKg+Xfl95SgMBPF9afftsU/2a5jLnZXSVcXoSthxpJ6XkZwd45+jhOjBguT+lC8uLVSNRvwDisRGgf9PYv39OH6lTEhbY2sgjkdZBZBOZlt7awy2vkMEsePsuafwrNhuz7xzjj55PzNzk8+zCUu/791OhC/eFUyGimtDw5mX9cyQw=="
}


{
"bizContent": {
"currencyCode": "AED"
},
"requestTime": 1708485334645
}


Response Parameters

Http Header

Field NameVariable NameRequiredTypeExample ValueDescription
signSignRequiredString

The body field in the Http Body is returned only when applyStatus is SUCCESS and code is 0.

Http Body

Field NameVariable NameRequiredTypeExample ValueDescription
Response headerRequiredResponseHeader
Response bodyOptionalMemberBalance

MemberBalance

Field NameVariable NameRequiredTypeExample ValueDescription
Member IDmemberIdRequiredString200000018128
Order informationbalanceListRequiredList

Balance

Field NameVariable NameRequiredTypeExample ValueDescription
Available BalanceavailableBalanceRequiredMoney

Sample Response

Http Header

{
"sign": "nDdCIX1tAyV3qcX/Epay6AXFNRGSsWd8ysWO9SgwPrNTetSePLA9C39mGp6qRbjJeqXLEnYLwSkBu5eKdtvXX3HtiGLi2kvRYjfYpTCjXdVL2Pncv2w+ghjHe2jL988ilk7q5AjAgdtXNphpHTcTes9pk6W3bVCbvjiH6atOfExUZt91L1LmPGELT1IJm/IFW3w4KLh0Gxs7FzDPi9RDFUemObNlRzV8kCtkWahvPgs/hBnS69GyYDKN7ihQX2iUiLP239wI6IA+VG/ZZKHPhLs8bbuOS+LKWORlp6jRt+JsAx7c/O1tRNyOnHKxPRKJ8bVTohEp39yUz/HwG8oA=="
}

{
"body": {
"balanceList": [
{
"availableBalance": {
"amount": 897993.88,
"currency": "AED"
}
}
],
"memberId": "200000030907"
},
"head": {
"applyStatus": "SUCCESS",
"code": "0",
"msg": "SUCCESS",
"success": true,
"traceCode": "375099"
}
}



Return Code

codemsgreasonsolution
0SUCCESSsuccess
400INVALID_PARAMETERParameter errorAdjusting request parameters
400REQUESTTIME_TOO_EARLYThe request time is greater than the current time Too earlyAdjust request time
400REQUESTTIME_TOO_LATERThe request time is greater than the current time Too lateAdjust request time
402RATE_LIMIT_REJECTToo many requestsReduce request frequency
403UNAUTHORIZEDAPI not authorizedContact PayBy
404SERVICE_NOT_AVAILABLEAPI service unavailableContact PayBy
500SYSTEM_ERRORsystem errorContact PayBy later Retry
504SERVICE_TIMEOUTService timeoutTry again later
601RISK_FAILRisk control verification failedPlease adjust your business
78001CURRENCY_CODE_NOT_SUPPORTEDThe currency is not supported.Adjusting request parameters