Retrieve an account balance with its account key. Please don’t call this method more than once every 30 seconds, and use a memory/disk cached value instead.
Address: https://api.ocrdatasolutions.com/getBalance
Method: POST
Content-type: application-json
Request properties
Property | Type | Required | Purpose |
---|---|---|---|
clientKey | String | Yes | Client account key |
Request example
curl -i -H "Accept: application/json" \
-H "Content-Type: application/json" \
-X POST -d '{ "clientKey":"YOUR_API_KEY" }' \
https://api.ocrdatasolutions.com/getBalance
Response structure
Property | Type | Purpose |
---|---|---|
errorId | Integer | Error identifier. 0 – no errors, operation completed successfully. >1 – error identifier. Error code and short description transferred in errorCode and errorDescription properties. |
errorCode | String | An error code, won’t be included in the output if request produced no errors. See errors list for reference. |
errorDescription | String | Short description of the error |
balance | Double | Account balance value in USD |
Response example
JSON with no errors
{
"errorId": 0,
"balance": 12.3456
}
JSON with an error
{
"errorId": 1,
"errorCode": "ERROR_KEY_DOES_NOT_EXIST",
"errorDescription": "Account authorization key not found in the system"
}