# Errors

Failed API calls return an `ErrorResponse`.

```json
{
  "errorKey": "VALIDATION_ERROR",
  "errorMessage": "currency must not be null",
  "errorCode": 400
}
```

| Field | Type | Description |
|  --- | --- | --- |
| `errorKey` | string | Machine-readable error identifier. |
| `errorMessage` | string | Human-readable description. |
| `errorCode` | integer | HTTP status code associated with the error. |


## HTTP status codes

| Code | Meaning |
|  --- | --- |
| `400` | Bad request — validation failed or the body is malformed. |
| `401` | Unauthorized — missing or invalid access token. |
| `403` | Forbidden — the token is valid but not permitted for this action. |
| `404` | Not found — the referenced resource (transaction, PSP, etc.) does not exist. |
| `409` | Conflict — the resource is not in a state that allows the action (for example, confirming/rejecting a payout that is not in `WAITING_FOR_CONFIRMATION`). |
| `500` | Internal server error. |


> **[TBD: whether a duplicate `orderId` returns 409]**


> **[TBD: full list of `errorKey` values]**