> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.clixpesa.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.clixpesa.com/_mcp/server.

# Errors and retries

The API returns JSON errors in a consistent shape:

```json
{
  "error": "Unable to process the request"
}
```

| HTTP status | Meaning                                                                                     |
| ----------- | ------------------------------------------------------------------------------------------- |
| `400`       | The request is structurally valid but cannot be processed by the selected flow or provider. |
| `422`       | The request body, path parameter, query parameter, or header failed schema validation.      |
| `500`       | An unexpected provider, database, blockchain, or service error occurred.                    |

## Idempotency keys

Send an `idempotency-key` header when creating an onramp or offramp. Generate the value once per logical
customer transaction and never reuse it for a different payment.

If the client loses the initial response:

1. Retain the original idempotency key.
2. Check transaction status using that transaction ID before creating another payment.
3. Retry transient network failures with exponential backoff and jitter.
4. Stop retrying automatically when the API returns a validation or business-rule error.

> **Warning**
>
> Never generate a fresh idempotency key merely because a client timeout occurred. The original request
> may already have reached Clixpesa or the payment provider.