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.
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. |
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. |
Here are some example error responses:
{
"code": 401,
"errors": [
{
"detail": "invalid_api_key"
}
]
}{
"code": 404,
"errors": [
{
"detail": "Resource not found"
}
]
}