Errors
An error of the client API is { "error": { "code", "message" } }, and the code is a canonical error written in SCREAMING_SNAKE_CASE.
The error body
Every error answer has the same shape: one error object that holds a code and a message. Switch on the code in your program and keep the message for your logs.
Error
{ "error": { "code": "NOT_FOUND", "message": "errors.not_found" } }
Codes of the client API
The requests you sign and send, such as Create a session and List games, answer with these codes and HTTP statuses:
MALFORMED_REQUEST, 400: a body, query or path value fails its schema, for example areturn_urlthat is not an https URL.UNAUTHORIZED, 401: a missing or wrong key, signature, timestamp or nonce. The authentication page describes the rules.NOT_FOUND, 404: an unknown id, an id that belongs to another client, or an unknown path. All three get the same answer, so an id never tells you what another client has.CURRENCY_NOT_SUPPORTED, 422: the provider or the client cannot serve the currency of the launch.DEMO_NOT_SUPPORTED, 422: the game has no demo mode.INTERNAL_ERROR, 502: the provider failed to answer the launch. An unexpected server error isINTERNAL_ERRORwith status 500.
Codes of your wallet
Your wallet refuses a call with the same body, a canonical code and one of these HTTP statuses:
- 400:
MALFORMED_REQUEST. - 401:
UNAUTHORIZED. - 404:
PLAYER_NOT_FOUNDorTRANSACTION_NOT_FOUND. - 409:
DUPLICATE_TRANSACTION. - 422:
PLAYER_BLOCKED,INSUFFICIENT_FUNDS,PLAYER_LIMIT_REACHEDorCURRENCY_MISMATCH. - 500:
INTERNAL_ERROR.
A refusal is a final answer. A timeout, a network error, any 5xx and a 4xx whose body carries no canonical code are an unknown outcome instead, and INTERNAL_ERROR is one too: the aggregator reverses a bet with a rollback and sends a win, a rollback and a round close again with the same transaction_id. The idempotency page explains both. CURRENCY_NOT_SUPPORTED, DEMO_NOT_SUPPORTED and NOT_FOUND are never wallet answers.