# Error Codes

> For the complete documentation index, see [llms.txt](https://docs.banxa.com/llms.txt). Append `.md` to any page URL for its markdown version.


## Quick Reference

| Code | HTTP Status | Message | Description |
|  --- | --- | --- | --- |
| 400100 | 400 | Order not found. | Order not found. |
| 401000 | 401 | Authentication failed. | Missing authentication header. |
| 401001 | 401 | Authentication failed. | Invalid auth header format. |
| 401400 | 401 | Authentication failed. | API key does not exist. |
| 401410 | 401 | Authentication failed. | API key does not exist. |
| 401416 | 401 | Authentication failed. Invalid nonce. | Nonce invalid, out of bounds, or reused. Must be 10, 13 or 16 digits; microseconds (16) recommended. |
| 500400 | 500 | Authentication failed. | Invalid JSON payload. |
| 500599 | 500 | Unexpected server error. | Internal server error. |
| 510000 | 500 | Unexpected server error. | Internal API error. |
| 515000 | 500 | Unexpected server error. | Core API exception. |
| 520000 | 500 | Unexpected server error. | Asset service error (missing params or DB failure). |
| 530000 | 500 | Unexpected server error. | Pricing service error. |
| 179 | 500 | Order cannot be processed at this time. | Orders restricted by operator settings. Buy and sell can be restricted separately. |


## KYC sharing errors

`POST /eapi/v0/identities/share/token` returns these with HTTP `400`. Nothing is saved, so you can fix the problem and send the request again.

| Code | Message | Cause |
|  --- | --- | --- |
| `4005` | `KYC sharing not enabled` | KYC sharing isn't enabled for your account. |
| `4023` | `The customer reference is already in use` | The customer reference is already used by another customer. |
| `4024` | `The KYC sharing token is already in use` | The token was already shared for a different customer. |
| `4025` | `The customer is blocked and cannot be used` | The customer is blocked by Banxa. |
| `4026` | `This customer has already completed KYC sharing and it cannot be repeated` | An earlier token share for this customer already passed. |


What to do for each, and the reasons Banxa gives when a share fails after the `202`, are on [KYC Token Sharing](/products/native-api/docs/how-it-works/kyc-token-sharing#errors-when-sharing-a-token).

## Validation errors

Request validation errors return `422` with an `errors` object keyed by field. Each key holds a list of messages:

```json
{
  "status": 422,
  "message": "Payment instructions are required for this transfer. Please provide all necessary banking details.",
  "errors": {
    "target.fiat.instructions": [
      "Payment instructions are required for this transfer. Please provide all necessary banking details."
    ]
  }
}
```

### Off-ramp validation errors

These come from `POST /eapi/v0/ramps` for an off-ramp. When you create the ramp from a quote, the field is `instructions` or `tosAccepted` at the top level instead of under `target.fiat`.

| Field | Cause | What to do |
|  --- | --- | --- |
| `target.fiat.instructions` | Missing or empty for a payout method that needs bank details. Message: `Payment instructions are required for this transfer. Please provide all necessary banking details.` | Send the customer's bank details as a single object. See [Payout methods](/products/native-api/docs/guides/bank-transfer#payout-methods). |
| `target.fiat.instructions` | A required field is missing or the wrong length, for example an ACH `routingNumber` that isn't 9 characters. The message starts with `Invalid payment instructions:` and names the field. | Correct the field and retry. |
| `target.fiat.tosAccepted` | ACH only. The customer hasn't accepted the ACH provider's terms of service and `tosAccepted` wasn't `true`. | Show the terms, then send `"tosAccepted": true`. See [ACH terms of service](/products/native-api/docs/guides/bank-transfer#ach-terms-of-service). |
| `identityReference` | The customer's country or state is restricted for this asset or direction. Message: `The identityReference field is invalid, the region is not supported for this customer.` | The customer can't make this ramp. This check applies to on-ramps too. |
| `fiatAmount` / `cryptoAmount` | Both or neither were sent. | Send exactly one, as a string. |


If sell is restricted for your account, ramp creation returns code `179` instead of a validation error.