Endpoint
POST https://{YOUR_SITE}/gold_apiContent-Type: application/json
Method: user_balance
Request
JSON
{
"method": "user_balance",
"agent_code": "your_agent_code",
"agent_secret": "your_agent_secret",
"user_code": "test",
"user_token": "c3041c6d9146a164387fa454eff7b432",
"game_code": "vs20olympgate"
}| Field | Type | Required | Description |
|---|---|---|---|
method | string | Yes | Must be user_balance |
agent_code | string | Yes | Agent code |
agent_secret | string | Yes | Agent secret key |
user_code | string | Yes | User identifier |
user_token | string | Yes | User session token |
game_code | string | No | Game being played. Can be missing or empty (e.g. for sportsbook) |
Response
Success
Return balance even if it is 0:
JSON
{
"status": 1,
"user_balance": 0
}Failure
JSON
{
"status": 0,
"user_balance": 0,
"msg": "INTERNAL_ERROR"
}Any status other than 1 is a failure, and so is no answer within 5 seconds, a network error or an HTTP status other than 2xx: the balance request then fails. The user_balance and msg of a failure answer are not used (msg is only logged).