Error Handling
Proper error handling ensures smooth gameplay and easier debugging.
Standard Error Response
If your Wallet API cannot process a request, return a JSON response with a non-200 status code (or 200 with an error code in the body, depending on your preference, though HTTP status codes are preferred).
Common Error Codes
| Code | Meaning | Action |
|---|---|---|
200 |
Success | Transaction processed successfully. |
400 |
Bad Request | Check generic validation (missing fields, invalid format). |
401 |
Unauthorized | Signature mismatch or invalid token. |
402 |
Insufficient Funds | Player balance is too low for the bet. |
500 |
Internal Error | Unexpected server error. Flex-Soft will retry. |
Error Response Example
If a request fails (e.g., Insufficient Funds), your Wallet API should return a response like this:
Error Response Example
If a request fails (e.g., Insufficient Funds), your Wallet API should return a response like this:
[!TIP] For
500errors or timeouts, Flex-Soft will attempt to retry the transaction. Ensure your endpoints are idempotent to prevent double-spending.