Error Handling
The APIs use standard HTTP status codes to indicate successful processing of a request, or the type of error encountered. The response body may also contain additional application-specific error information.
| HTTP Status Code | Error Code | Description |
|---|---|---|
200 – OK | - | Succesful request |
401 – UNAUTHORIZED | AUTHENTICATION_FAILED | Basic authentication failed |
403 – FORBIDDEN | INVALID_TOKEN | Auth token sent in authenticate is invalid |
400 – BAD REQUEST | INVALID_PLAYER | Player is either invalid or nor found |
| INVALID_SESSION_TOKEN | Player session is either expired or not found | |
| INVALID_CURRENCY | Currency not supported or not match with player’s currency | |
| INVALID_BET | Bet is either not found or invalid | |
402 – PAYMENT REQUIRED | INSUFFICIENT_FUNDS | Player doesn’t have enough funds to complete the bet |
500 – INTERNAL SERVER ERROR | - | Unexpected Internal Error |
Example of a returned error: 402 PAYMENT_REQUIRED
{
"errorCode": "INSUFFICIENT_FUNDS",
"description": "The player does not have sufficient funds"
}