Errors

When an error occurs, the xMoney Crypto API will return an error response in JSON format. The response will include a status code and an array of errors.

Error response format

The error response will be in the following format:

{
  "code": 400,
  "errors": [
    {
     "detail": "Explanation of the problem"
    }
  ]
}

The errors array will contain a list of errors that occurred. Each error will have the following fields:

FieldDescription
codeThe error code.
detailA human-readable message describing the error.

Error codes

The following table lists the most common error codes that the xMoney API might return:

CodeMessageDescription
400Bad RequestThe request was invalid or could not be understood by the server.
401UnauthorizedThe request was not authenticated.
404Not FoundThe requested resource was not found.

Example error responses

Here are some example error responses:

401 invalid_api_key

{
  "code": 401,
  "errors": [
    { 
      "detail": "invalid_api_key"
    }
  ]
}

404 Not Found

{
  "code": 404,
  "errors": [
    { 
      "detail": "Resource not found"
    }
  ]
}