Section 08
Responses and errors
How AIC interprets your responses and which errors its API returns.
Responses and errors#
How AIC interprets your API's responses#
AIC determines the outcome of each wallet call from the HTTP status code and the body of your response:
| Code | Message | Description |
|---|---|---|
| 200 | data + status | Success. data is the player's new balance and status carries code "0"; if status is missing, the response is rejected. |
| 404 | NOT_FOUND | Player not found. Respond with HTTP 404 and message NOT_FOUND. |
| 400 | OVERFLOW | Insufficient balance. Respond with HTTP 400 and message OVERFLOW. |
| — | * | Any other response (another HTTP status, non-numeric data, or a timeout) makes the operation fail towards the supplier. |
Error response examples#
Player not found (HTTP 404):
{
"statusCode": 404,
"message": "NOT_FOUND"
}Insufficient balance (HTTP 400):
{
"statusCode": 400,
"message": "OVERFLOW"
}Important
Every successful response must include a numeric data and the status object (code: "0", message, datetime). Without status, AIC rejects the response.
Note
Depending on the supplier, a player not found or an insufficient balance is shown in the game with its reason or as a generic error. In both cases the operation is not applied.
AIC endpoint errors#
| Situation | Response |
|---|---|
Invalid Project ID or API Key on login | HTTP 403 |
Unknown or inactive project on getGameList | HTTP 400 or 404 |
| Game that could not be opened | See Open a game |
Unknown Merchant Name on round-played | HTTP 400 with CUSTOMER_NOT_FOUND |
Unknown transaction or one from another project on round-played | HTTP 200 with status.code 404 or 409 |
| Unexpected error | HTTP 400 |