# Errors (/fr/docs/errors)

Every error has the same shape:

```json
{
  "error": {
    "type": "invalid_request",
    "code": "invalid_parameter",
    "message": "amount must be a positive decimal with at most 2 decimals for PEN.",
    "param": "amount",
    "request_id": "req_6d665507f62a5773882fc053"
  }
}
```

| Field | What it is |
| --- | --- |
| `type` | The error type. Stable. |
| `code` | The specific reason. Stable. **Decide based on `type` and `code`.** |
| `message` | Human-readable text. It can change: don't parse it. |
| `param` | The field or header with the problem, when there is one. |
| `reasons` | Closed list of reasons, on the codes that have them (`risk_blocked`, `payout_not_cancellable`). |
| `request_id` | The same value as the `X-Request-Id` header. Give it to support. |

## Types [#types]

| `type` | HTTP | What happened | Retry? |
| --- | --- | --- | --- |
| `invalid_request` | 400, 405, 413, 415, 422 | The request is malformed (400) or can't be executed (422). | Only after fixing it. |
| `authentication_error` | 401 | The key is missing or invalid. | No. |
| `permission_error` | 403 | The key doesn't have the scope. | No. |
| `not_found` | 404 | It doesn't exist, or it belongs to another account. | No. |
| `conflict` | 409 | It conflicts with something that already exists. | No. |
| `rate_limited` | 429 | Too many requests. | Yes, after `Retry-After`. |
| `unavailable` | 503 | Unavailable for now. | Yes, with the same `Idempotency-Key`. |
| `internal_error` | 500 | An error on our side. | Yes, with the same `Idempotency-Key`. |

## Common codes [#common-codes]

### Malformed request (400) [#malformed-request-400]

| `code` | When |
| --- | --- |
| `invalid_parameter` | A field or parameter isn't valid. `param` tells you which one: `amount`, `currency`, `details.cci`, `payer`, `Idempotency-Key`… |
| `invalid_body` | The body isn't JSON, has an unknown field, or has the wrong type (for example, an amount as a number). |
| `invalid_request` | The request isn't valid in general. |
| `idempotency_key_required` | `Idempotency-Key` is missing where it's required. |
| `body_too_large` (413) | The body exceeds 64 KiB. |
| `unsupported_media_type` (415) | The `Content-Type` isn't `application/json`. |

### Can't be executed (422) [#cant-be-executed-422]

| `code` | When |
| --- | --- |
| `unsupported_method` | That method and currency aren't in [capabilities](/docs/capabilities). |
| `amount_required` | That pay-in is a one-time payment: send `amount`. |
| `one_payment_unavailable` | That pay-in is an account that accepts any deposit: don't send `amount`. |
| `amount_below_minimum` | The amount is below that pay-in's minimum: see `min_amount` in `GET /v1/capabilities`. |
| `amount_above_maximum` | The amount is above that pay-in's maximum: see `max_amount` in `GET /v1/capabilities`. |
| `amount_below_fee` | The amount does not cover the method's fee: see `fee_bps` and `fee_fixed` in `GET /v1/capabilities`. |
| `insufficient_funds` | Your available balance isn't enough. |
| `quote_expired` | The quote expired: request a new one. |
| `quote_mismatch` | The quote isn't for the beneficiary's method or currency. |
| `pricing_unavailable` | There's no price for that operation right now. |
| `amount_too_small` | The amount is below the minimum. |
| `same_currency` | The requested conversion is to the same currency. |
| `limit_exceeded` | It exceeds a limit on your account. |
| `customer_not_active` | The beneficiary's customer isn't active. |
| `risk_blocked` | Risk rules stopped it; see `reasons`. |
| `refund_not_supported` | That pay-in doesn't support refunds. |
| `too_many_endpoints` | You already have 10 webhooks. |

### Not allowed (403) [#not-allowed-403]

| `code` | When |
| --- | --- |
| `insufficient_scope` | The key doesn't have the scope (`read` or `write`) the request needs. |
| `verification_required` | Live, on an account you opened yourself: your company's verification isn't approved yet. Sandbox works meanwhile. See [Go live](/docs/go-live). |
| `insufficient_role` | Only a member signed in to the dashboard can do it (for example, managing API keys, or adding an allowed IP: an owner or admin). |
| `ip_allowlist_required` | A key moving money while your account has no active allowed IP. Add your servers' addresses in Settings → Allowed IPs; see [Authentication](/docs/authentication). |
| `ip_not_allowed` | A key moving money from an address that isn't one of your allowed IPs. The message says which address we saw. |
| `step_up_required` | Adding an allowed IP needs a fresh confirmation of your second factor (or password or passkey). |

### Conflict (409) [#conflict-409]

| `code` | When |
| --- | --- |
| `idempotency_key_reused` | You used the same `Idempotency-Key` with a different request. |
| `quote_already_used` | The quote already funded another operation. |
| `external_id_conflict` | You already have a customer with that `external_id` and different details. |
| `customer_closed`, `customer_blocked` | The customer is closed or blocked. |
| `payout_not_cancellable` | The payout can no longer be canceled; see `reasons`. |
| `too_many_api_keys` | The account already has 20 active API keys: revoke one first. |
| `allowed_ip_exists` | That address is already on your allowed IPs. |
| `too_many_allowed_ips` | At most 3 allowed IPs: remove one to add another. |

### Unavailable (503) [#unavailable-503]

| `code` | When |
| --- | --- |
| `operation_suspended` | The operation is suspended for now (capabilities shows `reason: suspended`). |
| `temporarily_unavailable` | A momentary problem. Retry with the same key. |

The full list for each endpoint is on its page in the [reference](/api#tag/payouts/POST/v1/payouts).

## Rate limits [#rate-limits]

There's a request limit per key. When you exceed it you receive `429 rate_limited` with `Retry-After`, the number of seconds you must wait. Spread out your queries and prefer webhooks over polling in a loop.

## Useful headers [#useful-headers]

| Header | Direction | Purpose |
| --- | --- | --- |
| `X-Request-Id` | Response | Identifies the request (`req_…`). Store it in your logs. |
| `X-Correlation-Id` | Request and response | Your own identifier (8 to 128 characters from `A-Z a-z 0-9 . _ : -`); we echo it back. |
| `Retry-After` | Response | On a `429`, how many seconds to wait. |
| `Idempotent-Replayed` | Response | `true` when the response is a replay of an earlier request. |

<Callout title="New values">
Statuses, reasons, and codes are closed lists, but they can grow. Treat a value you don't recognize as "unknown", not as an error in your integration.
</Callout>
