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

# Errors

> Error envelope, status codes, and common codes.

Every error body is:

```json theme={null}
{
  "error": {
    "type": "invalid_request",
    "code": "invalid_amount",
    "message": "amount must be a positive integer in cents"
  }
}
```

Do not parse the message. Branch on `type` and `code`.

## Types

| `type` | HTTP | Meaning |
| - | - | - |
| `authentication` | 401 | Missing or invalid key |
| `permission` | 403 | Key lacks the scope, or the account is restricted |
| `invalid_request` | 400 / 404 / 409 | Bad body, unknown id, expired quote, not ready |
| `rate_limit` | 429 | Too many requests. Wait, then retry. `Retry-After` is seconds |
| `api_error` | 5xx | Unexpected failure. Retry with the same `Idempotency-Key` |

## Codes

### Every route

| `code` | HTTP | When |
| - | - | - |
| `invalid_api_key` | 401 | Header missing, not an `easner_sk_*` key, or the key was revoked |
| `key_forbidden` | 403 | The key lacks the scope the route needs. The message names it |
| `rate_limit` | 429 | Over the request budget. `Retry-After: 60` |
| `invalid_request` | 400 | On `POST /v1/checkout/sessions`, `POST /v1/refunds`, `POST /v1/customer_portal/sessions` and `POST /v1/subscriptions/:id/cancel`: the body is missing or is not JSON. On every list: a `limit` outside 1 to 100, a cursor that is not an id in this list, or a bad `created[gte]` or `created[lte]`, or `GET /v1/refunds` with neither `payment` nor `checkout_session`. Other routes treat invalid JSON as an empty body, see [JSON handling](#json-handling). A `400` with `fields` names each bad parameter or body field: `error.fields` is a list of `{ name, message }` |
| `invalid_idempotency_key` | 400 | `Idempotency-Key` is longer than 255 characters |
| `not_found` | 404 | The id is not in this mode for your business. Also a wrong or unknown transfer `client_secret` on review and confirm |
| `ACCOUNT_RESTRICTED` | 403 | Your business is restricted for send or deposit. Matching writes fail |
| `ACCOUNT_LOCKED` | 403 | Your business is locked. Sends fail |

### Connect

| `code` | HTTP | When |
| - | - | - |
| `connect_disabled` | 403 | Connect is not available yet on this deployment |
| `program_not_found` | 403 | Connect is not set up for this business |
| `program_not_live` | 409 | The Connect program is not live (paused or not yet approved) |
| `check_not_found` | 409 | That credit is not waiting in Check these |
| `loosening_needs_step_up` | 403 | Loosening a payout rule needs an authenticator code |
| `reference_required` | 400 | `reference` is missing or longer than 255 characters |
| `invalid_email` | 400 | `email` is not an address |
| `invalid_country` | 400 | `country` is not a two letter code |
| `invalid_income_type` | 400 | `income_type` is not `royalties`, `services` or `other_income` |
| `invalid_source` | 400 | `source` is not `payee_balance` or `platform_balance` |
| `idempotency_key_required` | 400 | `POST /v1/payouts` needs an `Idempotency-Key` |
| `idempotency_key_reused` | 409 | The key was used before with a different payee, amount or source |
| `invalid_json` | 400 | The body is not a JSON object |
| `reference_immutable` | 400 | `POST /v1/payees/:id` tried to change `reference` |
| `nothing_to_update` | 400 | `POST /v1/payees/:id` sent none of `name`, `email`, `country`, `income_type` |
| `invalid_batch` | 400 | `POST /v1/credits/batch`: `credits` is not a list of 1 to 1,000, or `count` and `total` are missing |
| `control_total_mismatch` | 422 | The `count` or `total` does not match the credits sent. Nothing was credited |
| `duplicate_reference_in_batch` | 422 | Two credits in one batch share a `reference`. Nothing was credited |
| `payee_not_found`, `credit_not_found`, `payout_not_found` | 404 | The id is not one of yours in this mode |
| `payee_not_linked` | 409 | The person has not connected an Easner account yet |
| `payee_not_verified` | 409 | The person's Easner account is not verified yet |
| `payee_restricted` | 409 | Payouts to this person are on hold |
| `below_minimum` | 422 | The payout is under the program's minimum |
| `insufficient_balance` | 422 | The payee does not have that much available (`payee_balance` source) |
| `reversal_exceeds_credit` | 422 | A reversal is more than what is left of the credit |
| `test_mode_only` | 403 | A live key called a test control |
| `internal_error` | 500 | Unexpected failure. Nothing about the cause is shown |

A payout that cannot start yet is **not** an error: it comes back `201` with `status: "pending"` and a `pending_reason` (`funds`, `limit` or `tax_form`), or `status: "held"` for review.

### Checkout sessions

| `code` | HTTP | When |
| - | - | - |
| `invalid_currency` | 400 | `currency` is not three letters |
| `currency_not_supported` | 400 | Online payments aren't available in this currency yet |
| `invalid_line_items` | 400 | More than 20 lines, a line without a name, or an adjustable quantity that excludes the starting quantity |
| `invalid_amount` | 400 | A line `amount` (or `amount`) is missing, zero or not a whole number of cents |
| `invalid_quantity` | 400 | `quantity` is not between 1 and 999 |
| `invalid_price` | 400 | `line_items[].price` is not one of your active prices, or it is in another currency |
| `invalid_interval` | 400 | `interval` is not `day`, `week`, `month` or `year`, or `interval_count` is not 1 to 52 |
| `invalid_expires_in` | 400 | `expires_in` is not a whole number from 1800 to 86400 seconds. It is never clamped |
| `invalid_trial_days` | 400 | `trial_days` is not 0 to 730, or the mode is not `subscription` |
| `invalid_payment_method_collection` | 400 | `payment_method_collection` is not `always` or `if_required`, or `if_required` was sent without a subscription trial |
| `invalid_trial_end_behavior` | 400 | `trial_end_behavior` is not `pause` or `cancel`, or was sent without `payment_method_collection: "if_required"` |
| `invalid_url` | 400 | `success_url` or `cancel_url` is not a full `https://` address |
| `origin_not_allowed` | 400 | A return URL, or the browser `Origin`, is not on an allowed website |
| `customer_not_found` | 400 | `customer` is not one of your Checkout customers in this mode. It is a bad value in the body, so 400. The portal route returns 404 for the same code, see below |
| `invalid_collect` | 400 | `collect.address` is not `none`, `billing` or `shipping`, `terms_url` is not https, or more than 3 custom fields |
| `fee_above_minimum_total` | 400 | The lowest total the customer can reach is below the processing fee |
| `idempotency_mismatch` | 409 | The `Idempotency-Key` was used with a different body |
| `idempotency_in_progress` | 409 | The first call with this key is still creating its session |
| `plan_limit` | 409 | The plan does not include the feature you called, such as subscriptions on `POST /v1/checkout/sessions`. Your balance and payouts are unchanged |
| `plan_limit_reached` | 409 | The plan does not include the customer portal (`POST /v1/customer_portal/sessions`), or the business hit its plan's monthly limit |
| `business_not_ready` | 403 | Live only: business verification or online payment setup is not finished. Test sessions never need it |
| `online_payments_off` | 403 | Online payments are off in Settings → Payments |
| `checkout_paused` | 403 | Checkout is paused for your business, or for every business, by Easner. Existing subscriptions keep renewing. Contact support |
| `checkout_unavailable` | 503 | Easner could not confirm checkout is open right now. Retry shortly |
| `online_payments_disabled` | 503 | Online payments are not available on this environment |
| `price_create_failed` | 5xx | The recurring price could not be created |
| `session_create_failed` | 502 | The session could not be created. Retry with the same key |

### Subscriptions and checkout lists

| `code` | HTTP | When |
| - | - | - |
| `invalid_request` | 400 | `POST /v1/subscriptions/:id/cancel` without `at` (`period_end` or `now`), or with `refund_unused: true`. The message says the refund is Console only |
| `invalid_request` | 409 | A subscription action where the change is already made (already paused, not paused, already cancelled) and no `Idempotency-Key` was sent. With the key, a retry answers `200` |
| `not_available` | 503 | Easner could not change the subscription with the payment provider. Nothing changed. Retry with the same `Idempotency-Key` |
| `invalid_request` | 400 | A list filter or cursor on `GET /v1/checkout/sessions`, `GET /v1/customers/checkout`, `GET /v1/payments` or `GET /v1/subscriptions` is not valid. `ending_before` is `400` on the checkout sessions, payments and subscriptions lists. The `fields` array names it |

### Publishable key validate

| `code` | HTTP | When |
| - | - | - |
| `missing_key` | 400 | `key` is empty |
| `invalid_publishable_key` | 401 / 403 | Unknown or revoked key, or the key cannot start checkout |
| `test_payments_unconfigured` | 503 | Test payments are not available on this environment |

### Seats and discounts

| `code` | HTTP | When |
| - | - | - |
| `invalid_request` | 400 | `POST /v1/subscriptions/:id` with neither `quantity` nor `price`, a `quantity` outside 1 to 10,000, or `quantity` below the price's minimum seats. `error.fields` names `quantity` or `price` |
| `invalid_request` | 400 | `price` is not a recurring price of the same product and currency |
| `invalid_request` | 409 | The subscription is canceled or set to end, so its seats can't change. Resume it first |
| `invalid_request` | 400 | `POST /v1/discounts` with a bad email, a percentage outside above 0 to 100, `amount_off` without `currency`, or `duration_in_months` without `duration: repeating`. `error.fields` names it |
| `invalid_request` | 409 | The email already has an active discount in this mode. Switch the other discount off first |
| `not_found` | 404 | The subscription, price or discount is not in this mode for your business |
| `not_available` | 503 | The payment provider could not make the change. Nothing changed. Retry with the same `Idempotency-Key` |

### Refunds

| `code` | HTTP | When |
| - | - | - |
| `payment_not_found` | 404 | No paid payment matches `payment` or `checkout_session` in this mode (on `POST`, and on `GET` when the value matches nothing in this mode) |
| `invalid_amount` | 400 | `amount` is zero, negative or not a number |
| `invalid_reason` | 400 | `reason` is not `duplicate`, `fraudulent` or `requested_by_customer` |
| `amount_too_large` | 400 | More than what is left to refund |
| `already_refunded` | 409 | Nothing is left to refund |
| `already_settled` | 409 | The payment already reached your Easner balance. Contact support |
| `idempotency_mismatch` | 409 | The key was used for a different refund |
| `refund_failed` | 502 | The refund did not go through |
| `partial_unavailable` | 503 | Partial refunds are not available on this environment yet |

### Customer portal

| `code` | HTTP | When |
| - | - | - |
| `invalid_email` | 400 | `customer_email` is not a valid email |
| `invalid_return_url` | 400 | `return_url` is not a full https address |
| `return_url_not_allowed` | 400 | `return_url` is not on an allowed website (test keys allow any https origin and loopback without listing) |
| `customer_not_found` | 404 | No such customer in this mode. Here the customer is the thing you asked for, so 404 (on sessions the same code is 400). Branch on `code`, not on the status |
| `portal_disabled` | 409 | The portal is off in Settings → Payments |

### Banking

| `code` | HTTP | When |
| - | - | - |
| `invalid_currency` | 400 | A currency is not a 3 to 5 letter code. Also on `POST /v1/quotes` for `currency` and `receive_currency`, and on `POST /v1/transfers` and `POST /v1/accounts` |
| `invalid_amount` | 400 | Amount missing, zero, or not a positive integer |
| `invalid_customer` | 400 | `POST /v1/accounts` without `customer` |
| `invalid_source` | 400 | `POST /v1/quotes` without `source` |
| `invalid_type` | 400 | Destination type is not `bank`, `mobile_money`, or `wallet`. Also `POST /v1/customers` with a `type` that is not `individual` or `business` |
| `invalid_return_url` | 400 | `return_url` on verification or onramp is not a full https address |
| `verification_required` | 403 | Live Receive before the customer is `approved` |
| `customer_action_required` | 403 | A merchant key tried to confirm, or a live transfer's customer has no email to authorize with. The customer must authorize |
| `payouts_disabled` | 403 | Live only. Money-out through live API keys is off by default and Easner has not enabled it for your business (create destination, create transfer, confirm). Contact Easner support to request it. See [Send](https://docs.easner.com/send.md) |
| `invalid_client_secret` | 401 | Confirm with **no** `client_secret` at all. A secret that is supplied but wrong or unknown is `404` `not_found`, so a guess cannot tell a real transfer from a missing one |
| `transfer_expired` | 400 | Confirm after `expires_at` |
| `transfer_canceled` | 400 | Confirm after cancel |
| `code_required` | 403 | `POST /v1/transfers/:id/confirm` in live without a valid code: none sent, expired, used, five wrong tries, or not six digits. Ask for a new code with `POST /v1/transfers/:id/code` |
| `invalid_code` | 400 | The code is wrong. The message says how many tries are left |
| `code_rate_limited` | 429 | `POST /v1/transfers/:id/code`: a code was sent less than 30 seconds ago, or three were already sent for this transfer. Start the send again |
| `corridor_unavailable` | 409 | `POST /v1/quotes` or `POST /v1/transfers` into a country that customer cannot send to right now. Nothing is quoted or held. Pick another corridor from `GET /v1/payment_methods?customer=cus_…`, or retry later. A transfer that was quoted earlier can hit this if the corridor closed since |
| `quote_used` | 400 | The quote already backs a transfer. Create a new quote |
| `pricing_unavailable` | 503 | `POST /v1/quotes` or `POST /v1/transfers`: the price cannot be worked out right now. Nothing is quoted or held, and there is never a one-for-one fallback. Retry shortly |
| `price_changed` | 409 | The transfer confirm: the cost of the send moved after the quote by more than Easner can absorb. The hold is released and the customer is not charged. Create a new quote |
| `invalid_destination` | 400 | `POST /v1/quotes`: the destination is missing or cannot be priced |
| `invalid_application_fee` | 400 | `POST /v1/quotes` or `POST /v1/transfers`: `application_fee` is not `{ bps, fixed }` of whole, non-negative numbers (`fixed` in USD cents), or it was sent with a `quote` id on a transfer |
| `application_fee_over_cap` | 400 | `POST /v1/quotes` or `POST /v1/transfers`: `application_fee` is above the fee limits Easner set for your business. Lower it, or ask Easner to raise the limit. Nothing is quoted |
| `application_fee_unavailable` | 403 | `POST /v1/quotes` or `POST /v1/transfers`: `application_fee` needs Developer mode |
| `limit_exceeded` | 400 | `POST /v1/quotes`, `POST /v1/transfers` or the transfer confirm: the amount is more than the customer has left of their daily or monthly limit (live mode). The message says what is left and when more frees up. Nothing is quoted or held. See [Send limits](https://docs.easner.com/customers.md#send-limits) |
| `amount_too_large` | 400 | `POST /v1/quotes` or `POST /v1/transfers`: the amount is above the per-transfer limit of 50,000 (USD or EUR). Split it into smaller transfers. Nothing is quoted or held |
| `idempotency_mismatch` | 409 | `POST /v1/transfers`: the `Idempotency-Key` was used with a different `quote`, `source`, `destination`, `amount` or `currency` |
| `currency_mismatch` | 400 | `currency` is not the source account currency |
| `transfer_failed` | 400 | The transfer could not be created or debited. On `POST /v1/transfers` this is also the answer for inputs that name something that is not there: unknown or expired `quote`, unknown `source`, unknown `destination`, and missing or non-positive `amount`. Also insufficient funds, or a transfer that cannot be confirmed or canceled in its current state |
| `not_available` | 409 / 400 | Live details are not ready yet. `409` on `POST /v1/transfers` (the live authorization email could not be sent) and on `GET .../deposit_instructions`. `400` on `POST .../onramp_sessions` and `GET .../deposit_addresses` |
| `list_failed` | 500 | A list could not be read. Retry the same request. (Account lists answered `400` before cursor pagination) |
| `create_failed` | 400 | Create customer, account, destination, quote, verification or onramp failed. Also what `onramp_sessions` and `deposit_*` return when the customer is not found (not `404`) |

### Keys and webhook endpoints

| `code` | HTTP | When |
| - | - | - |
| `invalid_url` | 400 | A webhook endpoint `url` is not a full `https://` address. Plain `http`, an IP address and `localhost` are refused. `error.fields` names `url` |
| `invalid_request` | 400 | `enabled_events` is missing, empty, or names an event that is not in [Webhook events](https://docs.easner.com/webhook-events.md) (the message lists them; `fields` names `enabled_events`). Or `disabled` is not `true` or `false`, or a `POST /v1/webhook_endpoints/:id` sends none of `url`, `enabled_events` and `disabled` |
| `not_found` | 404 | The key or endpoint is not in this mode for your business, or the id is not one Easner issues. Also what `DELETE` returns for an id you already deleted in another mode |
| `create_failed` | 400 | The endpoint could not be stored. Nothing was created, so retry |
| `update_failed` | 400 | The endpoint change could not be saved. Nothing changed |
| `api_error` | 500 | The change could not be recorded against a person (the calling key has no creator and the business has no owner), so it was not made. Retry |

### Products, prices and promotion codes

| `code` | HTTP | When |
| - | - | - |
| `invalid_request` | 400 | A body value is wrong or missing. `error.fields` names each field. Also an unknown field on a payment link update, `rail` other than `card_bank`, a `products` key, or a `line_items` entry with no `price` |
| `invalid_request` | 409 | A change the object's terms do not allow: an amount, currency or product on a payment link after its first payment; `type` on any link; an amount, currency or interval on a price; a discount, duration, limit or end date on a promotion code; any change to an archived code. A price on an archived product. A duplicate promotion code in the same mode. Reopening a link whose address another open link uses. `error.fields` names the field. Make a new object instead |
| `office_disabled` | 409 | Easner turned this payment link off. Only Easner turns it back on. Contact support |
| `not_found` | 404 | The id is not in this mode for your business, or it is not an id Easner issues. A payment link id starts `plink_` |
| `api_error` | 502 | The recurring price for a subscription link could not be set up with the payment provider. Nothing was created. Retry with the same `Idempotency-Key` |
| `api_error` | 503 | The change could not be made right now: the catalog is not available on this environment yet, or the payment provider refused to change a promotion code. Nothing changed. Retry |
| `api_error` | 500 | The object could not be saved or the change could not be recorded against a person. Nothing changed. Retry with the same `Idempotency-Key` |

## JSON handling

Invalid JSON is handled per route, not once:

| Route | Invalid or missing JSON |
| - | - |
| `POST /v1/checkout/sessions`, `POST /v1/refunds`, `POST /v1/customer_portal/sessions` | `400` `invalid_request` |
| `POST /v1/customers`, `/v1/accounts`, `/v1/destinations`, `/v1/quotes`, `/v1/transfers`, `/v1/customers/:id/verification`, `/v1/accounts/:id/onramp_sessions` | Read as an empty body. You get the validation error for the first missing field (for example `invalid_amount`), or on `POST /v1/customers` an empty customer is created |
| `POST /v1/transfers/:id/confirm` | Read as an empty body, so `401` `invalid_client_secret` unless the secret is in the `Authorization` header |

Always send a valid JSON body and branch on `code`.

## Expected client behavior

* `401` / `403` — stop. Fix the key, finish customer verification (`verification_required`), or have the customer authorize (`customer_action_required`).
* `429` `rate_limit` — wait `Retry-After` seconds (typically 60). Limits: [Authentication](https://docs.easner.com/authentication.md#rate-limits). Do not open a new send.
* `404` — the object is not in this mode. Check test vs live.
* `409` `idempotency_in_progress` — wait a second and send the same request again with the same key.
* `400` `origin_not_allowed` — add the website in Console, Checkout, your site, Settings, then retry.
* `403` `business_not_ready` — finish verification and online payment setup. Live only: test sessions do not need it.
* `403` `checkout_paused` — stop creating live sessions and show the customer a friendly message. Test sessions are not affected. Contact support to resume.
* `502` `session_create_failed` or `refund_failed` — retry with the same `Idempotency-Key`.
* `409` / `400` `not_available` — retry later; live details are still provisioning. On a transfer, `409` means the customer was not emailed: nothing is held, create it again.
* `400` `transfer_failed` with "Quote expired", or `400` `quote_used` — create a new quote. A quote made before pricing shipped also answers expired.
* `503` `pricing_unavailable` — retry shortly. Nothing was quoted or held.
* `409` `price_changed` on confirm — nothing was charged. Create a new quote.
* `403` `payouts_disabled` — sending live money over the API is not enabled yet. Test sends always work. Contact Easner support. Nothing is wrong with your key.
* `400` `transfer_failed` with insufficient funds — [Receive](https://docs.easner.com/receive.md) onto the customer vault, then retry with a **new** idempotency key only if you intend a new send.
* `5xx` — retry the same `Idempotency-Key`.

> [card] [Authentication](https://docs.easner.com/authentication.md)
>
> Keys, scopes, idempotency, and rate limits.


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