# Error codes

> Every stable LayerHop error code with its HTTP status, cause and fix.

Source: https://docs.layerhop.com/errors

Every error response has the same shape. `code` is stable and safe to branch on; `message` is for humans and may change.

```json
{
  "error": {
    "code": "QUOTE_EXPIRED",
    "message": "Quote expired, request a new one",
    "requestId": "0d5e1f6a-…",
    "docsUrl": "https://docs.layerhop.com/errors/QUOTE_EXPIRED"
  }
}
```

The same codes appear per provider in the `errors` array of a successful [quote response](/api-reference#quoteresponse). The SDK throws them as `LayerHopApiError` with `code`, `status` and `requestId`.

## All codes

| Code | HTTP | Meaning |
|---|---|---|
| [`INVALID_PARAMS`](/errors/INVALID_PARAMS) | `400` | A required parameter is missing or malformed, or the request is not allowed for this provider. |
| [`UNSUPPORTED_CHAIN`](/errors/UNSUPPORTED_CHAIN) | `400` | The chain id or slug is not in LayerHop's chain registry, no provider serves it any more, or the route into it is restricted. |
| [`UNSUPPORTED_TOKEN`](/errors/UNSUPPORTED_TOKEN) | `400` | A provider does not recognise or will not route the source or destination token. |
| [`AMOUNT_TOO_SMALL`](/errors/AMOUNT_TOO_SMALL) | `400` | The input amount is zero or below the route's minimum. When LayerHop can tell the minimum, `error.details.minAmount` (base units), `minAmountUsd` and `minAmountApprox` say how much the route needs. |
| [`AMOUNT_TOO_LARGE`](/errors/AMOUNT_TOO_LARGE) | `400` | The input amount exceeds what a provider can fill. |
| [`CALLS_REVERTED`](/errors/CALLS_REVERTED) | `400` | The destination calls of a quote failed their mandatory simulation, so no quote was returned. |
| [`LAUNCH_IMAGE_INVALID`](/errors/LAUNCH_IMAGE_INVALID) | `400` | The token image of a launch metadata upload is missing, larger than 1 MB, or not a PNG, JPEG, WebP or GIF file. |
| [`NO_ROUTE`](/errors/NO_ROUTE) | `404` | No provider supports this route, or every provider that does failed to quote. |
| [`ROUTE_EXCLUDED`](/errors/ROUTE_EXCLUDED) | `404` | The quote's avoid-lists (`excludeProviders`, `excludeBridges`, `excludeExchanges`) ruled out every route for this pair. |
| [`QUOTE_NOT_FOUND`](/errors/QUOTE_NOT_FOUND) | `404` | The `quoteId` is unknown to this API instance, or the provider can no longer build it. |
| [`QUOTE_EXPIRED`](/errors/QUOTE_EXPIRED) | `410` | The quote is past its `expiresAt` and can no longer be built. |
| [`ORDER_NOT_FOUND`](/errors/ORDER_NOT_FOUND) | `404` | The provider does not know the order id or transaction hash. |
| [`PROVIDER_ERROR`](/errors/PROVIDER_ERROR) | `502` | An upstream liquidity provider returned an error or an unusable response. |
| [`PROVIDER_TIMEOUT`](/errors/PROVIDER_TIMEOUT) | `504` | An upstream provider did not answer in time. |
| [`RATE_LIMITED`](/errors/RATE_LIMITED) | `429` | An upstream provider rate-limited LayerHop. |
| [`QUOTA_EXCEEDED`](/errors/QUOTA_EXCEEDED) | `429` | Your account used its plan's monthly API request quota (only when paid plans are enabled). |
| [`UNAUTHORIZED`](/errors/UNAUTHORIZED) | `401` | Credentials are missing or were rejected: a provider rejected LayerHop's, or a request that needs a secret didn't send one. |
| [`FORBIDDEN`](/errors/FORBIDDEN) | `403` | You are signed in, but this resource belongs to another account or needs a role you don't have. |
| [`ADDRESS_SANCTIONED`](/errors/ADDRESS_SANCTIONED) | `451` | An address of the request is on the US Treasury OFAC SDN list, and address screening is enforced (HTTP 451). |
| [`NOT_FOUND`](/errors/NOT_FOUND) | `404` | The requested resource does not exist (or is not visible to you). |
| [`CONFLICT`](/errors/CONFLICT) | `409` | The request clashes with the current state, e.g. a partner id that is already taken. |
| [`GASLESS_PENDING`](/errors/GASLESS_PENDING) | `409` | A gasless order for this quote, or for the same wallet and sell token, is still being relayed. |
| [`GASLESS_FAILED`](/errors/GASLESS_FAILED) | `422` | The relayer rejected the signed gasless order (bad signature, wrong signer, invalid approval, or not enough balance or allowance). |
| [`MARKET_UNAVAILABLE`](/errors/MARKET_UNAVAILABLE) | `503` | The market data for this chain can't be read right now: its indexer is unreachable, or this deployment has none for the chain. |
| [`LIMIT_ORDER_REJECTED`](/errors/LIMIT_ORDER_REJECTED) | `422` | A signed EVM limit order (or its cancellation) was refused: the signature is not the wallet's for exactly this order, or CoW Protocol's order book rejected it. |
| [`INTERNAL`](/errors/INTERNAL) | `500` | An unexpected error inside LayerHop. |

Codes come from `packages/shared/src/errors.ts`; this page is generated from it.
