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:
Field | Description |
---|---|
code | The error code. |
detail | A human-readable message describing the error. |
Error codes
The following table lists the most common error codes that the xMoney API might return:
Code | Message | Description |
---|---|---|
400 | Bad Request | The request was invalid or could not be understood by the server. |
401 | Unauthorized | The request was not authenticated. |
404 | Not Found | The 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"
}
]
}