> ## Documentation Index
> Fetch the complete documentation index at: https://readme.amana-dev.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Error codes

> What each Amana API error means and how to fix it.

When a request fails, the Amana API returns an HTTP status code and a JSON body with an `error` field that describes the problem.

```json theme={null}
{
  "error": "string",
  "message": "string"
}
```

## Common errors

| Error | Possible cause | What to do |
| - | - | - |
| 400 | Invalid or missing field, amount outside limits | Check the request against the schema and the instrument's size limits. |
| 401 | Token missing or expired | Log in again or use the refresh token. |
| 403 | IP not whitelisted, or account restricted | Confirm your IP is whitelisted; otherwise contact Amana. |
| 409 / 422 | Market closed, insufficient balance or margin | Check trading hours and balance, then retry. |
| 429 / 5xx | Rate limit, or temporary issue on our side | Retry with backoff; contact support if it persists. |

<Warning>
  A 403 error often means the request came from an IP address that is not whitelisted. IP whitelisting is mandatory for business access.
</Warning>

## Retry safely

* Retry 429 and 5xx errors with exponential backoff.
* Don't retry 400, 401, 403, 409, or 422 errors without changing the request first.
* Before you retry an order or a withdrawal, check whether the first request went through. This prevents duplicate trades or payments.

Each endpoint page in the API reference lists the errors that endpoint can return.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.