Skip to content

Error Response

This section details the standard error responses that may be returned by the OAS API. Proper error handling is essential for a robust integration between GPAS and the Operator Account System.

Error responses follow a consistent JSON format:

{
"code": 1001,
"type": "SYSTEM_ERROR",
"message": "System Error"
}

The following table lists the standard error codes that should be implemented:

HTTP StatusCodeTypeMessageDescription
5001001SYSTEM_ERRORSystem errorError or unexpected exception in the system
4001002INVALID_TX_IDInvalid transaction idThe transaction id specified with the rollback request is not known by the wallet platform.
4001003DUPLICATE_TX_IDAlready transactionThe transaction is already registered in the wallet
4001004INVALID_WALLET_SESSIONInvalid wallet sessionThe provided user wallet session is invalid.
4001005INVALID_WALLET_IDInvalid wallet idThe provided wallet id is invalid.
4001006SIGNATURE_FAILEDSignature failedRequest signature error
4001007INSUFFICIENT_FUNDSInsufficient fundsThe player’s balance in the wallet is smaller than the “amount” parameter specified by the wager request.
4001008USER_BLOCKEDUser BlockedUser who was blocked by the operator
4001009INVALID_GAME_IDInvalid game idThe provided game id is not valid
5001010”EXAMPLE_ERROR”Custom ErrorError that the operator considers and is not in this list

The error code 1010 must be a TYPE created by the operator at their discretion, for example “CURRENCY_ERROR”, “LANG_ERROR”, it is an error that is not in the list but the wallet considers valid.

HTTP STATUS 500
{
"code": 1001,
"type": "SYSTEM_ERROR",
"message": "System Error"
}

When implementing error handling in the OAS API:

  1. Use Appropriate HTTP Status Codes: Return the correct HTTP status code for each error type
  2. Include All Required Fields: Ensure that all error responses include the code, type, and message fields
  3. Be Consistent: Use the standard error codes and messages as defined in this document
  4. Provide Clear Messages: Error messages should be clear and helpful for troubleshooting
  5. Log Errors: Log all errors on the server side for monitoring and debugging purposes

If the authentication token provided in the Authorization header during the /sessions call is invalid or expired, the OAS should return a custom error:

{
"code": 1010,
"type": "INVALID_AUTH_TOKEN",
"message": "Invalid auth token"
}

This error is distinct from code 1004, which should be reserved for invalid walletSessionId during transactional operations (Debit, Credit, etc.).

If the player doesn’t have enough balance for a debit operation:

{
"code": 1007,
"type": "INSUFFICIENT_FUNDS",
"message": "Insufficient funds"
}

If a transaction with the same external reference already exists:

{
"code": 1003,
"type": "DUPLICATE_TX_ID",
"message": "Already transaction"
}