Skip to content

Error Response

Error Response

Overview

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 Response Format

Error responses follow a consistent JSON format:

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

Standard Error Codes

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
4001010”EXAMPLE_ERROR”Custom ErrorError that the operator considers and is not in this list

Custom Error Types

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.

Example Error Response

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

Implementation Guidelines

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

Common Error Scenarios

Invalid Authentication

If the authentication token is invalid or expired:

{
"code": 1004,
"type": "INVALID_WALLET_SESSION",
"message": "Invalid wallet session"
}

Insufficient Funds

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

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

Duplicate Transaction

If a transaction with the same external reference already exists:

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