Error handling
Redeeming codes involves multiple steps, so various errors can happen along the way. This guide covers all the possible error codes you might encounter.
Activation errors
These errors can occur during code redemption.
When an activation error happens, you’ll get a 503 status code and the specific error in the errorCode field.
NO_ACCOUNTS_AVAILABLE
No accounts are available to handle the activation. Try again in a few minutes or contact support.
NO_CODES_AVAILABLE
You requested activation from the database, but no codes are available. Ask your admin to add more codes to the database.
LOGIN_FAILED
Failed to log into the Midasbuy account. This rarely happens since the server automatically retries activations when this occurs.
Wait a few minutes and try again. If the issue persists, contact support.
CHARACTER_NOT_FOUND
The player ID you provided is invalid. This happens when the player ID is wrong, or occasionally when the player lookup request fails.
INVALID_ACTIVATION_RESPONSE
The activation request was sent successfully, but MidasBuy returned an unexpected response. This is rare and usually means Midasbuy is down or they’ve changed their response format. Contact support if you see this often.
CODE_USED
This code has already been redeemed. Try a different code.
INVALID_CODE
The code format is invalid. Check for extra spaces or typos in the code.
RISK_CONTROL
Midasbuy blocked the activation for this player. This typically happens when too many codes are redeemed too quickly for a single player. Wait a few minutes before trying again.
UNKNOWN
An unknown error occurred. Manually check if the code was activated and contact support.
NETWORK_ERROR
A network error on our side occurred during activation. Check if the code was activated and try again later.
Other API errors
Other endpoints use standard HTTP status codes for errors.
For example, GET /character returns 404 when a player isn’t found.
Check the API reference for details on each endpoint’s error responses.
Network errors
Remember that not getting a response doesn’t mean your request didn’t reach the server. Handle network errors the same way as other errors.
Be sure to set a generous timeout for requests to our service. Usually redemptions finish very quickly, but in some edge cases more time is needed.
Don’t retry requests too quickly - this puts unnecessary load on the server and may trigger rate limits.
Invalid requests
When you send an invalid request, the API returns a 415/422 error.
The response might look something like this: