# API reference

> Every LayerHop REST endpoint, parameter and schema — generated from openapi.yaml (API 0.1.0).

Source: https://docs.layerhop.com/api-reference

The LayerHop REST API (version 0.1.0) is served at `https://api.layerhop.com/v1`. It covers chains, tokens, prices and balances, quotes, orders, simulation, wallet sign-in, the developer dashboard and partner administration.

Download the spec as [openapi.yaml](/openapi.yaml) or [openapi.json](/openapi.json) for code generators, or the ready-made [Postman collection](/layerhop.postman_collection.json): in Postman choose **Import → Link** and paste `https://docs.layerhop.com/layerhop.postman_collection.json` (Insomnia and Bruno import the same file, or the OpenAPI spec). Set its `apiKey` variable to an `lh_test_` key while you build. Every public endpoint below has a **Try it** link that opens it in the [API playground](/playground).

> [!NOTE]
> This page is generated at build time from `services/api/openapi.yaml` (OpenAPI 3.1.0, API version 0.1.0).

LayerHop is a meta-aggregator. `GET /v1/quote` asks every liquidity provider that supports the
route (Jupiter, Relay, deBridge, 0x, KyberSwap, LI.FI) in parallel and ranks the answers by time-adjusted
output for the user (near-identical quotes, within 0.1%, go to the one that supports LayerHop). `POST /v1/orders` turns a quote into a transaction the user's own wallet
signs. LayerHop never holds funds.

Conventions:
- Amounts are integer strings in base units (never floats).
- Chains are given as a numeric id or a slug (`base`, `solana`). Solana uses LayerHop's
  internal id `7565164`.
- Tokens are given as an address / mint, a symbol from the curated token list (`USDC`), the
  chain's native symbol (`ETH`, `BERA`), or the symbol of a token marked `popular` on that chain
  in `GET /v1/tokens` (one per symbol per chain, e.g. `USDC` on Avalanche is native Circle USDC).
  Search every token with `GET /v1/tokens`.
- Every response carries an `x-request-id` header; error bodies repeat it as `requestId`.
- Errors use one shape, `{ "error": { code, message, requestId, docsUrl } }`, with a stable
  `code` (see the `ErrorCode` schema).

## Base URLs

| URL | Description |
|---|---|
| `https://api.layerhop.com` | Hosted API (production) |
| `http://localhost:8787` | Local API (`pnpm --filter @layerhop/api dev`) |

## Authentication

- `x-api-key` (header) — Optional. An `lh_live_…` key from the dashboard attributes requests and orders to your account and raises your rate limit (per key, default 120 requests/minute; without a key the limit is per IP). An invalid or revoked key is rejected with `UNAUTHORIZED`. If your account has an active partner profile, the key selects your partner fee and allows `integratorFeeBps`. An `lh_test_…` key switches every request to **test mode**: quotes come from the `sandbox` provider (priced from live USD prices), built transactions are placeholders that move no funds (`tx.sandbox: true`), and reported orders run a simulated lifecycle (pending, then filled in about 10 seconds) with webhooks sent to your test endpoints only. Amounts ending in `4001` refund, `4002` fail and `4004` return `NO_ROUTE`. Test and live data never mix: a quote, order or webhook of one mode is invisible to the other.
- `lh_session` (cookie) — Dashboard session cookie set by `POST /v1/auth/verify` (HttpOnly, Secure, SameSite=Lax, 7 days). Auth and Dashboard routes only.
- `http` () — Operator `ADMIN_TOKEN`. Admin routes only.
- `lh_admin` (cookie) — Owner sign-in cookie set by `POST /v1/admin/login` (12 hours). Admin routes only.

## Conventions

- All paths are under `/v1`. Request and response bodies are JSON.
- Every response has an `x-request-id` header. Error bodies repeat it as `requestId`.
- Non-2xx responses use the [Error](#error) schema; its `docsUrl` points at the [error catalog](/errors).

## Meta

Liveness.

### Health check

`GET /v1/health`

Liveness probe. Lists the providers loaded in this API instance.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The API is up. | [HealthResponse](#healthresponse) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/health"
```

[Try it in the API playground →](/playground?op=getHealth)

**Example response** (`200`)

```json
{
  "ok": true,
  "providers": [
    "jupiter",
    "relay",
    "debridge",
    "zerox",
    "kyberswap",
    "lifi"
  ]
}
```

### Own solver liveness

`GET /v1/solver/heartbeat`

Whether LayerHop's own solver (`layerhop-solver`, D-079) is online. The API offers solver quotes only
while its last signed heartbeat is under 2 minutes old. 404 when no solver is configured.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Solver liveness. | [SolverHeartbeatStatus](#solverheartbeatstatus) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/solver/heartbeat"
```

[Try it in the API playground →](/playground?op=getSolverHeartbeat)

**Example response** (`200`)

```json
{
  "solver": "0x05B03FA1343C53DD18c18A4bB5ab11fB968599f9",
  "live": true,
  "lastSeenAt": "2026-11-08T01:10:30.000Z"
}
```

### Own solver heartbeat

`POST /v1/solver/heartbeat`

Sent every 30 s by LayerHop's own solver service. `signature` is an EIP-191 personal signature by the
solver wallet over `LayerHop solver heartbeat <timestamp>`; `timestamp` (unix seconds) must be within 60 s
of the server clock and newer than the last one accepted. Anything else answers 401. Only the solver's
key can produce a valid heartbeat, so the endpoint needs no other credentials.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Accepted. | [SolverHeartbeatStatus](#solverheartbeatstatus) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/solver/heartbeat" \
  -H "content-type: application/json" \
  -d '{"timestamp":1794100230,"signature":"0x6c1f…1b"}'
```

[Try it in the API playground →](/playground?op=postSolverHeartbeat)

**Example response** (`200`)

```json
{
  "solver": "0x05B03FA1343C53DD18c18A4bB5ab11fB968599f9",
  "live": true,
  "lastSeenAt": "2026-11-08T01:10:30.000Z"
}
```

## Assets

Chains, tokens, USD prices and wallet balances: every chain and token LayerHop's providers can route, for chain and token pickers and balance displays.

### List chains

`GET /v1/chains`

Every chain at least one loaded provider can quote from or to. The registry merges the chain
lists of Relay, LI.FI, deBridge, KyberSwap, Mayan, 0x, Jupiter and Blast's canonical bridge and
is refreshed every hour. A chain that no provider lists any more (or that Relay marks `disabled`)
is omitted, and quotes to or from it fail with `UNSUPPORTED_CHAIN`. When a provider's list can't
be loaded, its previous list (or the static list in `@layerhop/shared`) is kept, so an upstream
outage never hides chains. Popular chains come first, then the rest alphabetically. `providers`
lists the providers that support the chain in either direction; `destinationOnly` and
`onlyRoute` mark chains with restricted routes (Blast: only from ETH on Ethereum).

Tron (`vm: "tvm"`, id `728126428`, D-048) is listed only where the API runs with Tron enabled;
it is routed by Relay, and only quotes, orders and the payer's side of a checkout
(`POST /v1/checkout/sessions/{id}/quote`) accept it (other endpoints answer
`UNSUPPORTED_CHAIN` for Tron).

`routeHealth` (D-036) is the result of LayerHop's own read-only probe quotes, every ~2 hours:
`in` = Base USDC (Arbitrum USDC for Base) → the chain's native coin, canonical stablecoin or WETH,
`out` = the reverse, each about $25. A direction is `failing` after two failed runs in a row
and `ok` again after one success; `status` sums both up (`ok`, `deposit_only`,
`withdraw_only`, `unavailable`, `unknown`). Chains that are `unavailable` stay in this list so
you can see why; LayerHop's own apps hide them from pickers and warn before a swap into a
`deposit_only` chain. Quotes to every listed chain are still attempted. `routeHealth` is absent
until a chain has been probed.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The chain registry. | [ChainsResponse](#chainsresponse) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/chains"
```

[Try it in the API playground →](/playground?op=listChains)

**Example response** (`200`)

```json
{
  "chains": [
    {
      "id": 8453,
      "slug": "base",
      "name": "Base",
      "vm": "evm",
      "nativeSymbol": "ETH",
      "nativeDecimals": 18,
      "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/base.svg",
      "explorerTx": "https://basescan.org/tx/",
      "explorerAddress": "https://basescan.org/address/",
      "providers": [
        "debridge",
        "kyberswap",
        "lifi",
        "mayan",
        "relay",
        "zerox"
      ],
      "popular": true
    },
    {
      "id": 80094,
      "slug": "berachain",
      "name": "Berachain",
      "vm": "evm",
      "nativeSymbol": "BERA",
      "nativeDecimals": 18,
      "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/bera.svg",
      "explorerTx": "https://berascan.com/tx/",
      "explorerAddress": "https://berascan.com/address/",
      "providers": [
        "kyberswap",
        "lifi",
        "relay",
        "zerox"
      ],
      "popular": true,
      "routeHealth": {
        "in": "ok",
        "out": "ok",
        "status": "ok",
        "checkedAt": "2026-10-23T06:00:00.000Z"
      }
    },
    {
      "id": 14,
      "slug": "flare",
      "name": "Flare",
      "vm": "evm",
      "nativeSymbol": "FLR",
      "nativeDecimals": 18,
      "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/flare.svg",
      "explorerTx": "https://flare-explorer.flare.network/tx/",
      "explorerAddress": "https://flare-explorer.flare.network/address/",
      "providers": [
        "lifi",
        "relay"
      ],
      "popular": false,
      "routeHealth": {
        "in": "ok",
        "out": "failing",
        "status": "deposit_only",
        "checkedAt": "2026-10-23T06:00:00.000Z"
      }
    },
    {
      "id": 7565164,
      "slug": "solana",
      "name": "Solana",
      "vm": "svm",
      "nativeSymbol": "SOL",
      "nativeDecimals": 9,
      "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/solana.svg",
      "explorerTx": "https://solscan.io/tx/",
      "explorerAddress": "https://solscan.io/account/",
      "providers": [
        "debridge",
        "jupiter",
        "lifi",
        "mayan",
        "relay"
      ],
      "popular": true
    }
  ]
}
```

### List tokens

`GET /v1/tokens`

Tokens on one chain, from LI.FI's token list (all chains, with prices), Jupiter's verified
list (Solana) and LayerHop's curated list, de-duplicated by `chainId:address` and cached for
1 hour. Without `q`, tokens are ordered popular first (native coin, curated, stables and
majors), then verified, then by liquidity or price presence.

`q` matches the symbol or name (case-insensitive substring) or an exact address / mint.
Ranking: exact symbol, then popular, then verified, then liquidity / price presence.

**Tokens not on the lists yet** (new pools, small chains):
- `q` is an address or mint that isn't listed: it is read on-chain as in
  [`GET /v1/tokens/lookup`](#look-up-a-token) and returned as the only result, with
  `verified: false`. If it isn't a token on that chain, the list is empty (not an error).
- `q` is text (2 characters or more) with fewer than 5 matches on EVM chains or Solana: a live
  market search (DexScreener, or GeckoTerminal within the chain when DexScreener has nothing
  there) adds up to 5 tokens on this chain whose symbol or name contains `q` and whose deepest
  pool holds at least $10,000 of liquidity. Each is read on-chain (symbol, name, decimals), comes
  after the listed matches, has `verified: false` and carries the market's `priceUsd` and logo
  when known. Live results are cached for 60 seconds; when the market sources are slow, down or
  busy, you get the list matches only.

Show a warning before a user trades an unverified token.

**Several chains in one request** (a picker's "All chains" view): pass `chains` instead of
`chain`. Each chain's first page (at most `limit` tokens per chain, default 20, maximum 50) is
returned, concatenated in the order given, with `nextCursor: null`; `cursor` isn't accepted.
With an address or mint as `q`, only the listed token is returned on the chains that have it
(no on-chain read per chain): use [`GET /v1/tokens/lookup`](#look-up-a-token) for unlisted tokens.

Without an API key, token searches have their own per-IP rate limit (120 requests/minute by
default), separate from the limit on other endpoints.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | no | Chain id or slug. Required unless `chains` is set. |
| `chains` | string | no | Comma-separated chain ids or slugs (at most 20) to search at once, instead of `chain`. |
| `q` | string | no | Symbol, name or address to search for. |
| `limit` | integer | no | Page size (with `chains`, per chain, at most 50, default 20). (default `50`) (1–200) |
| `cursor` | string | no | `nextCursor` from the previous page (not with `chains`). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | One page of tokens. | [TokensResponse](#tokensresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | The upstream provider rate-limited LayerHop (`RATE_LIMITED`). | [Error](#error) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/tokens"
```

[Try it in the API playground →](/playground?op=listTokens)

**Example response** (`200`)

```json
{
  "tokens": [
    {
      "chainId": 80094,
      "address": "0xFCBD14DC51f0A4d49d5E53C2E0950e0bC26d0Dce",
      "symbol": "HONEY",
      "name": "HONEY",
      "decimals": 18,
      "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/tokens/honey.svg",
      "priceUsd": 0.9979,
      "verified": true
    }
  ],
  "nextCursor": "1"
}
```

### Look up a token

`GET /v1/tokens/lookup`

One token by address / mint. Listed tokens come from the token list. Anything else is read
on-chain: ERC-20 `symbol`, `name` and `decimals` through Multicall3 on EVM chains; on Solana,
the mint account's decimals plus name and symbol from Jupiter's token search (or the
Token-2022 metadata extension). Tokens read on-chain have `verified: false`; show a warning
before a user trades them.

**Without `chain`** the chain is found from the address: a Solana mint is read on Solana; an
EVM address goes to the supported chain where DexScreener sees the most pool liquidity for it
(or, failing that, a chain whose token list has it). An address with no pools on any
supported chain is `UNSUPPORTED_TOKEN`; pass `chain` to read it on a specific chain.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | no | Chain id or slug. Optional; without it the chain is found from the address. |
| `address` | string | yes | Token address (EVM) or mint (Solana). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The token. | [TokenLookupResponse](#tokenlookupresponse) |
| `400` | `INVALID_PARAMS` (malformed address), `UNSUPPORTED_CHAIN`, or `UNSUPPORTED_TOKEN` (the address is not an ERC-20 contract / SPL mint; without `chain`: no pools for it on any supported chain). | [Error](#error) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/tokens/lookup?address=0x4200000000000000000000000000000000000006"
```

[Try it in the API playground →](/playground?op=lookupToken)

**Example response** (`200`)

```json
{
  "token": {
    "chainId": 8453,
    "address": "0x4200000000000000000000000000000000000006",
    "symbol": "WETH",
    "name": "Wrapped Ether",
    "decimals": 18,
    "priceUsd": 2423.34,
    "verified": true,
    "popular": true
  }
}
```

### Check a token for risks

`GET /v1/tokens/{chain}/{address}/risk`

A short safety report for a token, for showing before a user buys or receives it: honeypots
(buyers can't sell), buy / sell / transfer taxes, owner powers (minting, changing balances,
blacklists, pausing, upgradeable or hidden-owner contracts, freeze authority on Solana),
unpublished source code, very few holders, and **fake majors**: a token that calls itself
USDC, USDT, ETH, WETH, SOL … at an address that isn't the real one on that chain.

Source: GoPlus Security's token API, normalized to `level` ok | caution | danger | unknown
plus `reasons`. The fake-major check is LayerHop's own (curated and canonical tokens and
the token list). Majors LayerHop lists itself (curated, canonical, native) are `ok` with
`verified: true` and are never sent upstream.

`unknown` means there is no report (the source is down, slow, busy, or doesn't cover the
chain). It is answered with 200 and should never block a swap. Reports are cached for 10
minutes (`unknown` for 1 minute). Limited to 60 requests per minute per key or IP.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | yes | Chain id or slug. |
| `address` | string | yes | Token address (EVM, any case) or mint (Solana). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The report (also when no source answered, as `level: unknown`). | [TokenRiskResponse](#tokenriskresponse) |
| `400` | `INVALID_PARAMS` (malformed address for the chain) or `UNSUPPORTED_CHAIN`. | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/tokens/base/0x532f27101965dd16442E59d40670FaF5eBB142E4/risk"
```

[Try it in the API playground →](/playground?op=getTokenRisk)

### Get USD prices

`GET /v1/prices`

USD prices for up to 100 tokens: LI.FI prices for EVM chains, Jupiter Price API v3 for
Solana, with the hourly token-list price as a fallback. A popular stablecoin priced more than
0.3% away from $1 is cross-checked with DefiLlama and the value closer to $1 is returned
(prices are never pinned, so a real depeg still shows). Cached for 60 seconds. Ids without a
known price are left out of the response.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `ids` | string | yes | Comma-separated `chainId:address` (the chain may also be a slug). At most 100. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Prices keyed by the ids exactly as requested. | [PricesResponse](#pricesresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/prices?ids=8453%3A0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913%2C7565164%3ASo11111111111111111111111111111111111111112"
```

[Try it in the API playground →](/playground?op=getPrices)

**Example response** (`200`)

```json
{
  "prices": {
    "8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913": 0.9998,
    "7565164:So11111111111111111111111111111111111111112": 103.88
  }
}
```

### Get wallet balances

`GET /v1/balances`

Non-zero balances of a wallet with token metadata, USD price and value, sorted by value,
plus every token named in `tokens` (returned even at zero, so a UI can tell a real 0 from
"not scanned").

- EVM address: the native coin plus a Multicall3 `balanceOf` over each chain's top ~200
  popular and verified tokens, on every requested chain in parallel. Default chains: the
  popular EVM chains.
- Solana address: SOL plus every Token and Token-2022 account (summed per mint). Default
  chain: Solana. Unlisted mints get metadata from Jupiter and `verified: false`; NFTs are skipped.

- `tokens`: EVM tokens outside the top list get their own `balanceOf`; an unlisted one gets
  its `symbol`, `name` and `decimals` read on-chain (`verified: false`). A Solana mint the
  wallet does not hold comes back at `"0"` with its metadata. The chains of `tokens` are
  scanned too, on top of `chains` (or the default chains).

A chain that fails or times out, or a requested token that cannot be read (not an ERC-20,
not a mint), is reported in `errors` and never fails the request. So is a bad `tokens` entry
(unknown chain, with `chainId: 0`; a chain of the other VM; an invalid address; or a chain
past the 25-chain cap): it is skipped and the rest is returned. Only more than 20 entries, or
a `tokens` value with no `chainId:address` entry at all, is `INVALID_PARAMS`.
Results are cached per address and chain for 20 seconds; `fresh=1` reloads them when the
cached result is older than 4 seconds (use it right after a swap or transfer). `fresh`
requests are capped at 20 per minute per API key (or IP); over that, the cached result is
returned instead of an error.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | EVM address or Solana wallet address. |
| `chains` | string | no | Comma-separated chain ids or slugs (at most 25), all of the address's VM. |
| `tokens` | string | no | Comma-separated `chainId:address` (chain id or slug, at most 20) that are always returned, even at zero, including tokens not in LayerHop's token list. Use the native address (`0x0000000000000000000000000000000000000000`, or `So11111111111111111111111111111111111111112` on Solana) for the native coin. |
| `fresh` | `"1"` \| `"true"` \| `"0"` \| `"false"` | no | `1` (or `true`) reloads balances cached more than 4 seconds ago instead of using the 20-second cache; the result refreshes the cache. At most 20 per minute per key or IP; over that the cached result is served. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The wallet's balances. | [BalancesResponse](#balancesresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/balances?address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
```

[Try it in the API playground →](/playground?op=getBalances)

**Example response** (`200`)

```json
{
  "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "vm": "evm",
  "balances": [
    {
      "chainId": 8453,
      "address": "0x0000000000000000000000000000000000000000",
      "symbol": "ETH",
      "name": "ETH",
      "decimals": 18,
      "priceUsd": 2423.34,
      "verified": true,
      "popular": true,
      "amount": "3128821803472737280",
      "valueUsd": 7582.2
    },
    {
      "chainId": 8453,
      "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "symbol": "USDC",
      "name": "USD Coin",
      "decimals": 6,
      "priceUsd": 0.9998,
      "verified": true,
      "popular": true,
      "amount": "2500000",
      "valueUsd": 2.4995
    }
  ],
  "totalUsd": 7584.7,
  "errors": [
    {
      "chainId": 80094,
      "message": "Berachain: timed out after 8000 ms"
    }
  ]
}
```

## Quotes

Ask every provider for a price.

### Get quotes

`GET /v1/quote`

Fans the request out to every provider that supports the route, in parallel, with a
per-provider timeout (8 s by default). Successful quotes are ranked best-for-the-user
first by time-adjusted output (1 bp penalty per minute of ETA beyond the first minute,
capped at 50 bps), then by speed. Providers that failed are listed in `errors` and do not
fail the request, unless every provider failed: then `NO_ROUTE` with the same list in
`error.details.errors` (or `AMOUNT_TOO_SMALL` / `AMOUNT_TOO_LARGE` when every provider rejected
the amount for that reason, or the amount is worth more than $10 billion). With gas on arrival
requested, quotes that deliver it (`gasOnArrival` set) rank before those that don't. Quotes
within 0.1% of the best time-adjusted output count as a tie: the one that earns LayerHop more,
or a LayerHop-run source paying at least as much, goes first. A quote further below the best is
never moved ahead of it, and only `best` can change; the rest stay in payout order.

Picking a route: every entry of `quotes` is a complete quote with its own `quoteId` and the
same LayerHop fee, so an app can show them all (provider, `estimatedSeconds`, fees,
`dstAmount`) and build the one the user picks with `POST /v1/orders`, not only `best`.
Avoid-lists (`excludeProviders`, `excludeBridges`, `excludeExchanges`) keep providers, bridges
and exchanges the user never wants out of every returned route.

Route minimums (D-036): when every provider failed and the failures look like a below-minimum
amount (some say `AMOUNT_TOO_SMALL`, the rest `NO_ROUTE`), the answer is `AMOUNT_TOO_SMALL` with
`error.details.minAmount` (base units of `srcToken`), `minAmountUsd` and `minAmountApprox`. The
minimum is the one a provider reported (`minAmountApprox: false`), or else the smallest of $10,
$25 and $50 at which the same route does quote (at most two extra probe quotes, cached per route
for 30 minutes; `minAmountApprox: true`, the true minimum is at most this). Without a minimum
the error stays `NO_ROUTE`. Live mode only; never with destination calls. When the chain's
`routeHealth` direction is `failing`, the `NO_ROUTE` message says so.

No-route suggestions (D-053): a live `NO_ROUTE` (no destination calls) also carries
`error.details.suggestions` when an alternative quotes: the same payment into the destination
chain's stablecoin or native coin (`dst_token`), the same destination token paid with the source
chain's stablecoin or native coin worth the same (`src_token`), or two signed steps through a
hub chain, Arbitrum, Base or Ethereum (`via_hub`: source → hub USDC, then hub USDC → destination
token; both legs quoted). At most 6 extra quotes, in parallel, cut off after 5 s; answers are
cached per route pair and size for 30 minutes (a cached answer is scaled to the new amount).
Amounts are base units; `dstAmount` is an estimate, so quote each leg again before building it.
Absent when nothing else quoted. Successful quotes never pay for this.

Validation (`INVALID_PARAMS`): `sender` must be an address of the source chain and `recipient`
one of the destination chain (EVM: `0x` + 40 hex, any case, also for Hyperliquid; Solana: a
base58 32-byte public key). The same token on the same chain (however it is written, e.g. `ETH`
and the zero address) is refused.

`UNSUPPORTED_CHAIN` also answers a chain no provider supports any more, a `destinationOnly`
chain as `srcChain`, and a route into an `onlyRoute` chain other than its one route (Blast:
ETH on Ethereum → ETH on Blast; `error.details.onlyRoute` names it). In live mode that error
also carries `error.details.suggestions` with one `via_hub` suggestion when step 1 quotes: swap
or bridge to ETH on Ethereum, then the canonical deposit (D-053). `blast-native` quotes report
the Ethereum L1 network fee as `fees.gasUsd` (about 650,000 gas at the current gas price).

Exact output ("receive exact amount"): send `dstAmount` (the amount of `dstToken` the recipient
must receive) instead of `amount`. Only providers that quote a fixed output are asked (today:
Relay from EVM chains, LI.FI, and deBridge cross-chain); the others are skipped, and when none
supports the route the answer is `NO_ROUTE`. Every quote then carries `srcAmount` (what `sender`
pays, fees included), `srcAmountMax` (the most the transaction can take from `sender`, slippage
included: check balances and approvals against it) and `dstAmountMin` of at least `dstAmount`
(the guaranteed output; a provider quote below it is dropped). Quotes rank by the lowest
`srcAmount` plus 0.1% per minute of `estimatedSeconds` beyond the first (at most 1.5%), so a
much slower route wins only when it is clearly cheaper. LayerHop's fee and a partner's fee are charged at the same bps as for any quote
(Relay sizes it on the output value, slightly under that bps of the input). Not with `gasless` or
gas on arrival (`INVALID_PARAMS`). Route minimums and no-route suggestions are not computed for
exact-output requests.

Each quote has its own `quoteId`; pass it to `POST /v1/orders` before `expiresAt`.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `srcChain` | string | yes | Source chain id or slug (any chain from `GET /v1/chains`). |
| `srcToken` | string | yes | Source token address / mint (any token, see `GET /v1/tokens`), a curated symbol (`USDC`), the native symbol (`ETH`), or the symbol of a `popular` token on that chain in `GET /v1/tokens`. Unknown symbols return `UNSUPPORTED_TOKEN`. |
| `amount` | string | no | Input amount, integer string in base units of `srcToken`. Must be greater than 0 (`AMOUNT_TOO_SMALL`) and at most 2^256 - 1 (`AMOUNT_TOO_LARGE`). Leading zeros are ignored (`0010` is `10`). Send exactly one of `amount` and `dstAmount` (`INVALID_PARAMS` otherwise). (pattern `^\d+$`) |
| `dstAmount` | string | no | Exact output: the amount of `dstToken` the recipient receives, integer string in base units (same limits as `amount`). Each quote then reports `srcAmount` and `srcAmountMax`. Instead of `amount`; not with `gasless` or gas on arrival. (pattern `^\d+$`) |
| `dstChain` | string | yes | Destination chain id or slug. |
| `dstToken` | string | yes | Destination token address / mint, curated symbol, native symbol or popular-token symbol. |
| `sender` | string | yes | Address that signs and pays on the source chain: an address of the source chain's VM, otherwise `INVALID_PARAMS`. (min length 1) |
| `recipient` | string | yes | Address that receives the output on the destination chain: an address of the destination chain's VM (EVM for Hyperliquid), otherwise `INVALID_PARAMS`. (min length 1) |
| `slippageBps` | integer | no | Maximum slippage in basis points. (default `50`) (1–5000) |
| `channel` | [FeeChannel](#feechannel) | no | Where the trade comes from. Decides the LayerHop fee (see `FeeChannel`). |
| `integrator` | string | no | Partner id (`[a-z0-9-]{1,32}`). When it is a registered partner, that partner's fee is added on top of LayerHop's and reported as `fees.integratorFeeBps`. Unknown or malformed ids are ignored (never an error). An `x-api-key` that belongs to a partner takes precedence. (pattern `^[a-z0-9-]{1,32}$`) |
| `integratorFeeBps` | integer | no | Partner fee override in bps: an integer >= 0, otherwise `INVALID_PARAMS`. Honored only when `x-api-key` belongs to a partner, and must be within that partner's `maxFeeBps` (otherwise `INVALID_PARAMS`). A valid value is ignored for label-only partners and without a partner. LayerHop fee + partner fee is capped at 150 bps by default; the partner part is trimmed to fit. (≥ 0) |
| `referrer` | string | no | Wallet that referred the user (an EVM `0x` address or a Solana address), for example the `r` parameter of a LayerHop referral link. Stored on the order built from this quote (EVM addresses lowercased) and counted by `GET /v1/referrals/{address}`. Attribution only: it never changes the fee or the price. Invalid values (not an address, longer than 100 characters) and a referrer equal to `sender` or `recipient` (self-referral) are ignored, never an error. |
| `copyOf` | string | no | Copy this trade: the trade card (`q_…` quote id of a filled order) or the wallet whose trade the user copies. Its owner gets the referral attribution for this quote, ahead of `referrer`: a card's owner (the order's sender, never returned) only when this quote buys the same token on the same destination chain; a wallet only when it uses LayerHop (a filled swap, or opted in to the trade feed). Attribution only. Invalid, unknown or self values are ignored, never an error. |
| `gasOnArrival` | boolean | no | Gas on arrival: `true` also delivers $2 of the destination chain's native gas token (ETH on Arbitrum, POL on Polygon…) to `recipient`, paid out of the swap, so the recipient can transact right away. Applies only to cross-chain routes to an EVM chain whose output token is not already native; otherwise it is ignored (Solana destinations included: no provider delivers SOL as a top-up today). Providers that can't deliver gas ignore it; quotes that include it carry `gasOnArrival`. Today: Relay (not from Solana). When it is requested but no returned quote delivers it, the response carries a `GAS_ON_ARRIVAL_UNAVAILABLE` entry in `warnings`. See the gas-on-arrival guide. (default `false`) |
| `gasOnArrivalUsd` | number | no | USD value of native gas to deliver (implies `gasOnArrival=true`). Default 2. (0.5–20) |
| `gasless` | boolean | no | Gasless swap: the user signs EIP-712 typed data instead of sending a transaction, and the provider's relayer pays the network fee, taken out of `srcToken` (disclosed as `gasless.gasFee`). For wallets with no native gas. Only an ERC-20 input swapped on the same EVM chain, on a chain with 0x Gasless (not Linea); only providers that relay signatures answer (today: 0x). LayerHop's fee is the same as for any swap. Live mode only. Returns `FORBIDDEN` while the deployment has gasless swaps off. Build with `POST /v1/orders` (which returns `gasless` typed data instead of `tx`), then `POST /v1/orders/gasless`. See the gasless swaps guide. (default `false`) |
| `excludeProviders` | string | no | Never ask these providers: comma-separated ids from `across`, `blast-native`, `debridge`, `jupiter`, `kyberswap`, `lifi`, `mayan`, `relay`, `zerox`. Unknown ids are `INVALID_PARAMS`. When the list rules out every provider that serves the route, the answer is `ROUTE_EXCLUDED`. Excluding providers never changes the fee of the routes still offered. |
| `excludeBridges` | string | no | Never route through these bridges: comma-separated ids from across, allbridge, arbitrum-bridge, blast-bridge, celer-cctp, debridge, eco, garden, gaszip, glacis, layerswap, mayan, near-intents, polymer, relay, squid, stargate, symbiosis. A bridge that is one of our providers (Across, Blast Bridge, deBridge, Mayan, Relay) excludes that provider; the rest are passed to LI.FI as its deny list, and a LI.FI route that still uses one is dropped (`ROUTE_EXCLUDED` in `errors`). When every route found used an avoided venue, the answer is `ROUTE_EXCLUDED`. |
| `excludeExchanges` | string | no | Never swap through these exchanges: comma-separated ids from 0x, 1inch, dodo, enso, jupiter, kyberswap, okx, sushiswap, velora. An exchange that is one of our providers (0x, Jupiter, KyberSwap) excludes that provider; the rest (and KyberSwap) are passed to LI.FI as its deny list, with the same guarantee as `excludeBridges`. |
| `purpose` | `"tip"` \| `"split"` \| `"payout"` \| `"gather"` \| `"rebalance"` \| `"fund"` | no | What the payment is for, recorded on the order built from this quote: `tip` (a tip jar; counted by `GET /v1/tip-jars/{address}`), `split` (one share of a split; implied by `splitId`), `payout` (a routed row of a bulk payout), `gather` (one leg of consolidating a wallet's balances), `rebalance` (one leg of a portfolio rebalance) or `fund` (a fund-an-app or yield deposit route). Attribution only: it never changes the fee, the price or the route. |
| `splitId` | string | no | Pay one share of a split (`POST /v1/splits`), with `splitShare`. The quote must deliver the split's token on its chain to its recipient (`INVALID_PARAMS` otherwise); a closed split answers `CONFLICT`. The share counts as paid once filled orders tagged with it delivered it. |
| `splitShare` | integer | no | The share's `index` in the split (from 0). Required with `splitId`. (≥ 0) |
| `note` | string | no | A message to the recipient on a tip or split payment (`purpose=tip` or `split`), plain text, trimmed to 140 characters and stored on the order. Ignored for other purposes. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Ranked quotes. | [QuoteResponse](#quoteresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `403` | `FORBIDDEN`: `gasless=true` while this deployment has gasless swaps off, or with a test key. | [Error](#error) |
| `404` | No provider supports the route, or every provider failed (`NO_ROUTE`), or the avoid-lists (`excludeProviders` / `excludeBridges` / `excludeExchanges`) ruled out every route (`ROUTE_EXCLUDED`). When providers were asked, `error.details.errors` says why each one failed. | [Error](#error) |
| `409` | `CONFLICT`: `splitId` names a split that is closed. | [Error](#error) |
| `451` | `ADDRESS_SANCTIONED` (HTTP 451): an address of the request is on the OFAC SDN list and screening is enforced (operator `SCREENING_ENFORCE=1`, or the account opted in). `error.details.sanctioned` lists the addresses and their role (D-069). | [Error](#error) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/quote?srcChain=base&srcToken=USDC&dstChain=solana&dstToken=SOL&sender=0x1111111111111111111111111111111111111111&recipient=9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
```

[Try it in the API playground →](/playground?op=getQuote)

**Example response** (`200`)

```json
{
  "best": {
    "quoteId": "q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10",
    "provider": "relay",
    "dstAmount": "612345678",
    "dstAmountMin": "609283949",
    "estimatedSeconds": 8,
    "fees": {
      "ourFeeBps": 10,
      "providerFeeUsd": 0.12,
      "gasUsd": 0.03
    },
    "expiresAt": 1760000030
  },
  "quotes": [
    {
      "quoteId": "q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10",
      "provider": "relay",
      "dstAmount": "612345678",
      "dstAmountMin": "609283949",
      "estimatedSeconds": 8,
      "fees": {
        "ourFeeBps": 10,
        "providerFeeUsd": 0.12,
        "gasUsd": 0.03
      },
      "expiresAt": 1760000030
    },
    {
      "quoteId": "q_0b9a4f7e-1d2c-4e3b-8a6f-5c4d3e2b1a09",
      "provider": "debridge",
      "dstAmount": "611900000",
      "dstAmountMin": "611900000",
      "estimatedSeconds": 6,
      "fees": {
        "ourFeeBps": 10
      },
      "expiresAt": 1760000030
    }
  ],
  "errors": [
    {
      "provider": "lifi",
      "code": "PROVIDER_TIMEOUT",
      "message": "Timed out: li.quest"
    }
  ]
}
```

### Get quotes (JSON body, destination calls)

`POST /v1/quote`

The same as `GET /v1/quote` with the parameters as a JSON body, plus **destination calls**:
contract calls run on the destination chain with the output, in the same user action (for
example bridge USDC and supply it to Aave for `recipient`). See the destination-calls guide.

With `calls` or `action`, send `dstAmount` (the exact amount of `dstToken` the calls receive)
instead of `amount`; each quote then reports `srcAmount` (what `sender` pays, fees included).
Only providers that run destination calls are asked (today: Relay); the others are skipped.
Destination calls are cross-chain only, to EVM chains (not Solana or Hyperliquid), and
can't be combined with gas on arrival.

**Trust model.** The calls are made by the provider's executor contract (`calls.executor`),
not by the user: `msg.sender` is the executor. Targets must credit `recipient` from a
parameter (e.g. Aave `supply(..., onBehalfOf)`), never `msg.sender`. For an ERC-20 output,
approve the target first (`approve(target, dstAmount)` on `dstToken`). Calls that move or
authorize third-party assets (`transferFrom`, `safeTransferFrom`, `permit`, Permit2) are
rejected.

**Mandatory simulation.** Before a quote is returned, its calls run in a read-only
`eth_simulateV1` on the destination chain, from the executor, after giving it exactly
`dstAmount` of the output. A call that would revert fails the request with `CALLS_REVERTED`
(naming the call and the revert reason); if the simulation can't run, `PROVIDER_ERROR`.
If a call still reverts at fill time (state changed), the provider refunds `sender`.

**Request body** — [QuoteRequestBody](#quoterequestbody) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Ranked quotes. With destination calls every quote carries `srcAmount` and `calls`. | [QuoteResponse](#quoteresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `403` | `FORBIDDEN`: destination calls are not enabled in live mode on this deployment yet (test keys always work), or `gasless` while gasless swaps are off / with a test key. | [Error](#error) |
| `404` | No provider supports the route, or every provider failed (`NO_ROUTE`), or the avoid-lists (`excludeProviders` / `excludeBridges` / `excludeExchanges`) ruled out every route (`ROUTE_EXCLUDED`). When providers were asked, `error.details.errors` says why each one failed. | [Error](#error) |
| `451` | `ADDRESS_SANCTIONED` (HTTP 451): an address of the request is on the OFAC SDN list and screening is enforced (operator `SCREENING_ENFORCE=1`, or the account opted in). `error.details.sanctioned` lists the addresses and their role (D-069). | [Error](#error) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |
| `502` | `PROVIDER_ERROR`: a provider failed, or the destination calls could not be simulated. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/quote" \
  -H "content-type: application/json" \
  -d '{"srcChain":"base","srcToken":"USDC","dstChain":"arbitrum","dstToken":"USDC","dstAmount":"10000000","sender":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","recipient":"0x1111111111111111111111111111111111111111","action":{"type":"aave-v3-supply"}}'
```

[Try it in the API playground →](/playground?op=postQuote)

**Example response** (`200`)

```json
{
  "best": {
    "quoteId": "q_713598a2-7493-4cf5-8412-7e44015c9c88",
    "provider": "relay",
    "dstAmount": "10000000",
    "dstAmountMin": "10000000",
    "srcAmount": "10083608",
    "estimatedSeconds": 1,
    "fees": {
      "ourFeeBps": 25,
      "providerFeeUsd": 0.0586,
      "gasUsd": 0.001194
    },
    "expiresAt": 1792430763,
    "calls": {
      "items": [
        {
          "to": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
          "data": "0x095ea7b3000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad0000000000000000000000000000000000000000000000000000000000989680",
          "value": "0"
        },
        {
          "to": "0x794a61358d6845594f94dc1db02a252b5b4814ad",
          "data": "0x617ba037000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000000000000000000000000000000000000098968000000000000000000000000011111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000",
          "value": "0"
        }
      ],
      "executor": "0xb92fe925dc43a0ecde6c8b1a2709c170ec4fff4f",
      "executed": true,
      "simulation": {
        "ok": true,
        "gasUsed": "288491",
        "leftover": "0"
      }
    }
  },
  "quotes": [
    {
      "quoteId": "q_713598a2-7493-4cf5-8412-7e44015c9c88",
      "provider": "relay",
      "dstAmount": "10000000",
      "dstAmountMin": "10000000",
      "srcAmount": "10083608",
      "estimatedSeconds": 1,
      "fees": {
        "ourFeeBps": 25,
        "providerFeeUsd": 0.0586,
        "gasUsd": 0.001194
      },
      "expiresAt": 1792430763
    }
  ],
  "errors": []
}
```

### Stream live quotes

`GET /v1/quote/stream`

Server-Sent Events (D-068): the same parameters as `GET /v1/quote`, plus `intervalMs`. The API
quotes once (errors answer as plain JSON, exactly like `GET /v1/quote`), opens the stream and
re-quotes every `intervalMs`:

- `event: ready`, `data: {"intervalMs":10000,"expiresAt":"…","retryMs":3000}`
- `event: quote`, `data: <QuoteStreamEvent>`: a full `GET /v1/quote` response plus `seq`. Sent
  first at once, then only when the ranking (providers in order) or any amount changes, or when the
  last sent `best` would expire before the next refresh (so the `quoteId` on screen stays buildable).
- `event: error`, `data: <Error>` plus `status` (the HTTP status of the same error) when a refresh fails (`NO_ROUTE`, `RATE_LIMITED`,
  `QUOTA_EXCEEDED`, `ADDRESS_SANCTIONED`, …); the stream then closes. Reconnect after fixing the cause.
- `event: end`, `data: {"reason":"expired","quotesSent":N}` after the stream's lifetime (5 minutes).
- `: ping` comment lines every 15 s.

Every refresh costs one request of your API key's rate limit (or the IP's without a key) and, on
paid plans, one live request of the monthly quota, exactly as if you polled `GET /v1/quote`. At most
3 open quote streams per API key (or IP); more answer `RATE_LIMITED`. Destination calls are not
streamed (use `POST /v1/quote`). Every `quoteId` is a normal quote: build it with `POST /v1/orders`.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `srcChain` | string | yes | As `GET /v1/quote`. |
| `srcToken` | string | yes | As `GET /v1/quote`. |
| `amount` | string | no | As `GET /v1/quote` (or `dstAmount`). (pattern `^\d+$`) |
| `dstAmount` | string | no | As `GET /v1/quote`: exact output instead of `amount`. (pattern `^\d+$`) |
| `dstChain` | string | yes | As `GET /v1/quote`. |
| `dstToken` | string | yes | As `GET /v1/quote`. |
| `sender` | string | yes | As `GET /v1/quote`. (min length 1) |
| `recipient` | string | yes | As `GET /v1/quote`. (min length 1) |
| `slippageBps` | integer | no | As `GET /v1/quote`. (default `50`) (1–5000) |
| `channel` | [FeeChannel](#feechannel) | no | As `GET /v1/quote`. |
| `intervalMs` | integer | no | Refresh interval in milliseconds. Default 10000; at least 5000 (`INVALID_PARAMS` below); values above 60000 count as 60000. (default `10000`) (≥ 5000) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | An event stream (`event: quote`, `data: <QuoteStreamEvent JSON>`). | — |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | No provider supports the route, or every provider failed (`NO_ROUTE`), or the avoid-lists (`excludeProviders` / `excludeBridges` / `excludeExchanges`) ruled out every route (`ROUTE_EXCLUDED`). When providers were asked, `error.details.errors` says why each one failed. | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `451` | `ADDRESS_SANCTIONED` (HTTP 451): an address of the request is on the OFAC SDN list and screening is enforced (operator `SCREENING_ENFORCE=1`, or the account opted in). `error.details.sanctioned` lists the addresses and their role (D-069). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/quote/stream?srcChain=base&srcToken=USDC&dstChain=solana&dstToken=SOL&sender=0x1111111111111111111111111111111111111111&recipient=9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
```

## Orders

Build, submit and track the transaction for a quote.

### List orders by address

`GET /v1/orders`

Orders built through LayerHop that were sent from or to `address`, newest first. EVM addresses
match case-insensitively. Only public fields are returned. Orders with no reported transaction
yet (`built`, or `expired` without one) are listed only to an `x-api-key` of the account that
built them. Requires the operator to run the API with a database; otherwise this route returns 404.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | Sender or recipient address. |
| `status` | [OrderLifecycleStatus](#orderlifecyclestatus) | no | Only orders with this status. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | Page size. (default `50`) (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | One page of orders. | [OrderList](#orderlist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/orders?address=0x1111111111111111111111111111111111111111"
```

[Try it in the API playground →](/playground?op=listOrders)

**Example response** (`200`)

```json
{
  "orders": [
    {
      "quoteId": "q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10",
      "status": "filled",
      "provider": "relay",
      "channel": "api",
      "srcChainId": 8453,
      "srcToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "dstChainId": 7565164,
      "dstToken": "So11111111111111111111111111111111111111112",
      "sender": "0x1111111111111111111111111111111111111111",
      "recipient": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
      "amount": "100000000",
      "dstAmount": "612345678",
      "ourFeeBps": 10,
      "partnerFeeBps": 0,
      "srcTxHash": "0x3f1e6a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f",
      "dstTxHash": "3nKqYdW1hS8vZ4cT2pXeR7mB9uJfL6aG5oN1wQ8kE3sD7yH2xV4tC6bM9rP1zA5uF8jL2gK7eW3qS6dN4hT9vB1",
      "createdAt": "2026-10-17T10:00:00.000Z",
      "updatedAt": "2026-10-17T10:00:42.000Z"
    }
  ],
  "nextCursor": "MjAyNi0xMC0xN1QxMDowMDowMC4wMDBafHFfNmYxYzJkMGU"
}
```

### Build the transaction

`POST /v1/orders`

Returns the transaction for a quote, for the user's wallet to sign. EVM transactions may
carry an `approval` (an ERC-20 `approve` to send first). Solana transactions are a base64
serialized `VersionedTransaction`; when `submitViaApi` is true, sign it and send it to
`POST /v1/orders/submit` instead of an RPC node.

Gasless quotes (`gasless=true`) return `gasless` instead of `tx`: EIP-712 typed data to sign
with `eth_signTypedData_v4` (an optional `approval` first, then `trade`), sent to
`POST /v1/orders/gasless`. No transaction is sent from the wallet.

The quote must not be expired. Some providers ask you to submit within ~30 s of building.

**Request body** — [BuildOrderRequest](#buildorderrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The transaction to sign. | [BuildOrderResponse](#buildorderresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | Unknown `quoteId`, or the provider can no longer build it (`QUOTE_NOT_FOUND`). | [Error](#error) |
| `410` | The quote is past `expiresAt` (`QUOTE_EXPIRED`). | [Error](#error) |
| `451` | `ADDRESS_SANCTIONED` (HTTP 451): an address of the request is on the OFAC SDN list and screening is enforced (operator `SCREENING_ENFORCE=1`, or the account opted in). `error.details.sanctioned` lists the addresses and their role (D-069). | [Error](#error) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |
| `504` | The upstream provider did not answer in time (`PROVIDER_TIMEOUT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/orders" \
  -H "content-type: application/json" \
  -d '{"quoteId":"q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10"}'
```

[Try it in the API playground →](/playground?op=buildOrder)

**Example response** (`200`)

```json
{
  "quoteId": "q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10",
  "provider": "relay",
  "tx": {
    "vm": "evm",
    "chainId": 8453,
    "to": "0xa5F565650890fBA1824Ee0F21EbBbF660a179934",
    "data": "0x58109c...",
    "value": "0",
    "approval": {
      "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "spender": "0xa5F565650890fBA1824Ee0F21EbBbF660a179934",
      "amount": "100000000"
    }
  }
}
```

### Submit a signed transaction

`POST /v1/orders/submit`

Only for Solana transactions built with `submitViaApi: true` (today: Jupiter, whose RFQ and
gasless transactions are co-signed and never land through a plain RPC node). Send the
wallet-signed transaction as base64; LayerHop forwards it to the provider and returns the
transaction signature. For every other provider this returns `INVALID_PARAMS` — broadcast
from the wallet instead.

**Request body** — [SubmitOrderRequest](#submitorderrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The provider accepted and executed the transaction. | [SubmitOrderResponse](#submitorderresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | Unknown `quoteId`, or the provider can no longer build it (`QUOTE_NOT_FOUND`). | [Error](#error) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |
| `504` | The upstream provider did not answer in time (`PROVIDER_TIMEOUT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/orders/submit" \
  -H "content-type: application/json" \
  -d '{"quoteId":"q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10","signedTransaction":"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA..."}'
```

[Try it in the API playground →](/playground?op=submitOrder)

**Example response** (`200`)

```json
{
  "provider": "jupiter",
  "txHash": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW"
}
```

### Submit gasless signatures

`POST /v1/orders/gasless`

For gasless quotes only. Send the wallet's `eth_signTypedData_v4` signatures of the typed data
`POST /v1/orders` returned in `gasless`; LayerHop forwards them to the provider, whose relayer
sends the transaction and pays the gas out of the input token. Returns the provider's order id;
follow it with `GET /v1/orders/gasless/{quoteId}`. A quote can be submitted once (`CONFLICT`
after that; `GASLESS_PENDING` while the first submission is still being relayed). Build the
order first: the order is recorded by `POST /v1/orders`.

Gasless quotes stay valid until shortly before the signed trade's deadline (at most 2
minutes). If the quote expired before the signatures arrived, the answer is `QUOTE_EXPIRED`:
get a new quote and sign again. A relayer rejection of the signatures (bad signature, wrong
signer, balance or allowance too low) is `GASLESS_FAILED`; nothing was sent on chain.

**Request body** — [SubmitGaslessRequest](#submitgaslessrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The provider accepted the signatures. | [GaslessOrderStatus](#gaslessorderstatus) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | Unknown `quoteId`, or the provider can no longer build it (`QUOTE_NOT_FOUND`). | [Error](#error) |
| `409` | `CONFLICT` (this quote was already submitted) or `GASLESS_PENDING` (its first submission is still being relayed, or the relayer has a pending trade of the same token from this wallet). | [Error](#error) |
| `410` | The quote is past `expiresAt` (`QUOTE_EXPIRED`). | [Error](#error) |
| `422` | The relayer rejected the signed order (`GASLESS_FAILED`); get a new quote and sign again. | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |
| `504` | The upstream provider did not answer in time (`PROVIDER_TIMEOUT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/orders/gasless" \
  -H "content-type: application/json" \
  -d '{"quoteId":"q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10","signatures":{"approval":"0x1b8c7e1f0a3d2c4b5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c51b8c7e1f0a3d2c4b5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c51b","trade":"0x2c9d8f201b4e3d5c6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d62c9d8f201b4e3d5c6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d61c"}}'
```

[Try it in the API playground →](/playground?op=submitGaslessOrder)

**Example response** (`200`)

```json
{
  "quoteId": "q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10",
  "provider": "zerox",
  "orderId": "0x9f1c2b3a4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8",
  "state": "pending"
}
```

### Get gasless order status

`GET /v1/orders/gasless/{quoteId}`

The provider's state of a submitted gasless order. Once the relayer's transaction is mined,
`srcTxHash` is set and the order is tracked like any other (status, webhooks). Poll every few
seconds until `filled` or `failed`. Available for about an hour after the quote expired.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | — |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Current state. | [GaslessOrderStatus](#gaslessorderstatus) |
| `404` | The provider does not know this order (`ORDER_NOT_FOUND`). | [Error](#error) |
| `409` | `GASLESS_PENDING`: the signatures are still being relayed; ask again in a moment. | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |
| `504` | The upstream provider did not answer in time (`PROVIDER_TIMEOUT`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/orders/gasless/%7BquoteId%7D"
```

[Try it in the API playground →](/playground?op=getGaslessOrder)

**Example response** (`200`)

```json
{
  "quoteId": "q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10",
  "provider": "zerox",
  "orderId": "0x9f1c2b3a4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8",
  "state": "filled",
  "srcTxHash": "0x5e1d8a0e8f2c4b6a7d9e0f1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e"
}
```

### Get order status

`GET /v1/orders/{provider}/{id}`

Asks the provider for the current state of an order. What `id` means depends on the
provider:

- `relay`: Relay request id or the source deposit tx hash. Tron-source orders: the request id only
  (LayerHop tracks them by it; Relay doesn't find Tron deposits by hash).
- `debridge`: source tx hash (EVM hash, Solana signature or Tron hash) or a DLN order id.
- `lifi`: source tx hash.
- `across`: source deposit tx hash. An `expired` deposit (no fill before the deadline) reports
  `pending` until Across refunds it on the source chain (`refunded`).
- `near-intents` (not loaded by default): the 1Click deposit address the order paid (LayerHop stores it with the order).
- `thorchain` (not loaded by default): the inbound (source) tx hash.
- `chainflip` (not loaded by default): the deposit channel id (`issuedBlock-Chain-channelId`), stored with the order.
- `blast-native`: the Ethereum deposit tx hash. `filled` carries the Blast deposit tx hash
  (derived per the OP-Stack deposit spec and confirmed on Blast); a reverted Ethereum tx is `failed`.
- `baltex` (not loaded by default): cross-chain orders are tracked by the Baltex exchange id, which LayerHop
  records on the order; a source tx hash alone answers `unknown`.
- `jupiter`, `zerox`, `kyberswap`, `layerhop-router` (and `routefun`, `bebop`, same-chain Baltex): same-chain swaps have nothing to track off-chain; the state is always
  `unknown`. Confirm the transaction on chain instead.

`id` must be an EVM tx hash / order id (`0x` + 64 hex), a Solana signature (base58) or a Tron
tx hash (64 hex, no 0x), otherwise `INVALID_PARAMS`. A well-formed id the provider doesn't know (yet) answers `200` with
`state: unknown`: providers can't tell a transaction they haven't indexed yet from one that
never existed, so keep polling for a while after broadcasting. `ORDER_NOT_FOUND` is returned
only when the provider states the order doesn't exist (deBridge, for an order id). When the
provider answers `unknown` for the source tx hash of a LayerHop order that the worker marked
`dropped` (the transaction never reached the network), the state is `dropped`.

Answers are cached per order for about 12 seconds (10 minutes once final), so polling more
often than that returns the same answer. When the provider can't answer (it rate-limits us, errors
or times out), you get the last answer LayerHop had for that order, or, for a LayerHop order,
the status LayerHop last recorded for it. A provider's rate limit is never returned as `429`:
with nothing to fall back on, the answer is `502` `PROVIDER_ERROR`; keep polling. `429` means
you went over your own rate limit.

Poll until `state` is `filled`, `refunded`, `failed` or `dropped`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `provider` | [ProviderId](#providerid) | yes | The `provider` from the quote. Must be a provider loaded in this API instance. |
| `id` | string | yes | Provider order id or source tx hash (see above): `0x` + 64 hex, or a Solana signature. URL-encode it. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Current order state. | [OrderStatus](#orderstatus) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The provider does not know this order (`ORDER_NOT_FOUND`). | [Error](#error) |
| `429` | The upstream provider rate-limited LayerHop (`RATE_LIMITED`). | [Error](#error) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |
| `504` | The upstream provider did not answer in time (`PROVIDER_TIMEOUT`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/orders/relay/0x3f1e6a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f"
```

[Try it in the API playground →](/playground?op=getOrderStatus)

**Example response** (`200`)

```json
{
  "provider": "relay",
  "id": "0x3f1e6a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f",
  "state": "filled",
  "srcTxHash": "0x3f1e6a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f",
  "dstTxHash": "3nKqYdW1hS8vZ4cT2pXeR7mB9uJfL6aG5oN1wQ8kE3sD7yH2xV4tC6bM9rP1zA5uF8jL2gK7eW3qS6dN4hT9vB1"
}
```

### Stream an order's status

`GET /v1/orders/{quoteId}/events`

Server-Sent Events: a `ready` event, then an `order` event (`OrderSummary`) with the current
state and one more on every change, until the order is final (`filled`, `refunded`, `failed`,
`expired`, `dropped`), when the stream closes. Comment lines (`: ping`) keep the connection alive every
15 s; streams last at most 30 minutes (reconnect to continue). Anyone with the `quoteId` can
watch; at most 20 open streams per API key or IP.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | The order's quote id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | An event stream (`event: order`, `data: <OrderSummary JSON>`). | — |
| `404` | The provider does not know this order (`ORDER_NOT_FOUND`). | [Error](#error) |
| `429` | The upstream provider rate-limited LayerHop (`RATE_LIMITED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/orders/q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10/events"
```

### Report the broadcast transaction

`POST /v1/orders/{quoteId}/submitted`

Call this after the user's wallet broadcast the transaction from `POST /v1/orders`, so LayerHop
can track the order to completion (status, webhooks, partner earnings). The SDK's
`reportSubmitted(quoteId, txHash)` does it for you; `POST /v1/orders/submit` does it automatically.

Sets the order's `status` to `submitted`. Idempotent for the same hash. Orders already past
`submitted` keep their status.

**On-chain check.** Live orders check the hash on the source chain first. EVM: the transaction
(pending is fine) must be sent by the order's `sender` to the contract the order was built for
(a smart-wallet call that contains the built calldata also passes). Solana: `sender` must have
signed it. Tron: as EVM (the deposit call, not the approval); the hash is 64 hex, with or without
`0x`, and is stored without it. A transaction that exists but fails this check returns `INVALID_PARAMS` and changes
nothing (a checkout session is not touched). A hash that isn't visible yet is recorded as
provisional (`verified: false`); report it again later to confirm it.

A verified hash is final: a different hash returns `CONFLICT`. A provisional hash is replaced
by a different hash that verifies (the API waits a few seconds for it to appear); if the new one
isn't visible either, `CONFLICT` (retry once it is). The worker also checks provisional hashes
and releases one that isn't the sender's (the order goes back to `expired` with the reason in
`statusDetail`, so the real transaction can still be reported). A hash the source chain never
sees (the wallet dropped, cancelled or replaced it) turns the order `dropped` after a grace
period; its hash counts as provisional again, so the replacement transaction can be reported
and the order goes back to `submitted`. Test-mode orders accept any well-formed hash.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | The quote the transaction was built from. |

**Request body** — [ReportSubmittedRequest](#reportsubmittedrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Recorded (or already recorded). | [ReportSubmittedResponse](#reportsubmittedresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The provider does not know this order (`ORDER_NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/orders/q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10/submitted" \
  -H "content-type: application/json" \
  -d '{"txHash":"0x3f1e6a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f"}'
```

[Try it in the API playground →](/playground?op=reportSubmitted)

**Example response** (`200`)

```json
{
  "quoteId": "q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10",
  "status": "submitted",
  "verified": true
}
```

### Simulate the transaction

`POST /v1/simulate`

Builds the transaction for a quote (like `POST /v1/orders`, but without recording an order) and
dry-runs it from the sender on a public RPC. Nothing is signed or sent.

- **EVM:** `eth_call` + `eth_estimateGas`. When the transaction needs an ERC-20 `approval` and the
  sender's allowance is too low, the swap is simulated with an allowance state override and
  `needsApproval` is true. If the RPC cannot override state, only the approval is simulated
  (`simulated: "approval"`).
- **Solana:** `simulateTransaction` with `sigVerify: false` and `replaceRecentBlockhash: true`;
  `computeUnits` is reported, and failure logs are returned in `error.logs`.
- **Tron** (where enabled, D-048): `triggerconstantcontract` on TronGrid; `energyUsed` is reported.
  Tron has no state overrides, so while the sender's TRC-20 allowance is too low only the approval
  is simulated (`needsApproval: true`, `simulated: "approval"`).

A failing simulation is still a `200` with `ok: false`.

**Request body** — [BuildOrderRequest](#buildorderrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Simulation result and the transaction that was simulated. | [SimulationResponse](#simulationresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | Unknown `quoteId`, or the provider can no longer build it (`QUOTE_NOT_FOUND`). | [Error](#error) |
| `410` | The quote is past `expiresAt` (`QUOTE_EXPIRED`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/simulate" \
  -H "content-type: application/json" \
  -d '{"quoteId":"q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10"}'
```

[Try it in the API playground →](/playground?op=simulateOrder)

**Example response** (`200`)

```json
{
  "quoteId": "q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10",
  "provider": "relay",
  "ok": true,
  "vm": "evm",
  "gasEstimate": "184233",
  "needsApproval": true,
  "simulated": "tx",
  "tx": {
    "vm": "evm",
    "chainId": 8453,
    "to": "0xa5F565650890fBA1824Ee0F21EbBbF660a179934",
    "data": "0x58109c...",
    "value": "0",
    "approval": {
      "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "spender": "0xa5F565650890fBA1824Ee0F21EbBbF660a179934",
      "amount": "100000000"
    }
  }
}
```

### List a wallet's filled trades

`GET /v1/portfolio/{address}/trades`

Public and read-only (no key needed, the usual per-IP rate limit applies): the newest 200
filled live orders routed through LayerHop where `address` is the sender or the recipient
(EVM matched case-insensitively, Solana exactly), newest first. Test-mode orders are excluded.
Only orders made through LayerHop appear, not the wallet's other activity.

`srcAmountUsd` / `dstAmountUsd` are the USD values of the order recorded when it filled (the
API prices each side within about a minute of the fill, listed tokens only); `null` when not
recorded (filled before this existed, no price was available, or the token is unlisted).
`filledAt` is when LayerHop saw the fill. `srcVerified` / `dstVerified` say whether each token
is listed (on LayerHop's curated list, or verified / popular on a provider list); an unlisted
token's `symbol` is `null` (show its address: anyone can deploy a token called "USDC").
`decimals` is `null` when unknown.

Privacy: anyone can look up any address, so a trade only shows the side the address took
part in. With `role: sender` the destination transaction (`dstTxHash`) is `null`; with
`role: recipient` the source transaction (`srcTxHash`) is `null` and `srcTxVerified` is false.
Both hashes only appear with `role: both`. The other party's address is never returned.

Cached for 30 seconds per address (a full 200-trade history is not cached). Without a
database the list is empty.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | An EVM `0x` address (any case) or a Solana address. Anything else is `INVALID_PARAMS`. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Filled trades. | [PortfolioTrades](#portfoliotrades) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/portfolio/0x2222222222222222222222222222222222222222/trades"
```

[Try it in the API playground →](/playground?op=getPortfolioTrades)

**Example response** (`200`)

```json
{
  "address": "0x2222222222222222222222222222222222222222",
  "trades": [
    {
      "quoteId": "q_0b5c6a4e-2f1d-4b8a-9c3e-7d6f5a4b3c2d",
      "provider": "relay",
      "role": "both",
      "srcChainId": 8453,
      "srcToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
      "srcSymbol": "USDC",
      "srcDecimals": 6,
      "srcVerified": true,
      "srcAmount": "25000000",
      "srcAmountUsd": 25,
      "dstChainId": 7565164,
      "dstToken": "So11111111111111111111111111111111111111112",
      "dstSymbol": "SOL",
      "dstDecimals": 9,
      "dstVerified": true,
      "dstAmount": "131250000",
      "dstAmountUsd": 24.9,
      "srcTxHash": "0x5f2c8a0d3b7e41c6a9f0e2d4b6c8a0e2f4d6b8c0a2e4f6d8b0c2e4a6f8d0b2c4",
      "srcTxVerified": true,
      "dstTxHash": "3xQm7Rk2v9Fh8Lp4Nw6Ty1Zs5Bc3Dd8Ee2Ff7Gg4Hh9Jj6Kk1Ll5Mm3Nn8Pp2Qq7Rr4Ss9Tt6Uu1Vv5Ww3Xx",
      "filledAt": "2026-10-25T09:14:03.000Z",
      "execution": {
        "quoted": "131250000",
        "minimum": "130593750",
        "received": "131301000",
        "receivedUsd": 24.909675,
        "diffBps": 3.88,
        "diffUsd": 0.009675,
        "metMinimum": true,
        "fees": {
          "feeBps": 30,
          "fee": "75000",
          "feeUsd": 0.075,
          "providerFeeUsd": 0.02,
          "gasUsd": 0.01
        }
      }
    }
  ]
}
```

### Get a verified trade card

`GET /v1/orders/{quoteId}/card`

Public and read-only (no key needed, the usual per-IP rate limit applies): the data of a
**filled live** order for a shareable trade card (app.layerhop.com/card/<quoteId>): tokens,
chains, amounts, USD values at fill (or `null`), when it filled, the source and destination
transaction hashes (to verify on an explorer) and the provider. Never includes a wallet
address. Unknown, unfilled and test-mode orders are `ORDER_NOT_FOUND`. Cached for 5 minutes.

Trust checks for whoever renders the card: `srcVerified` / `dstVerified` are true only for
listed tokens (LayerHop's curated list, or verified / popular on a provider list). An unlisted
token has `symbol: null` and no USD value; show it as an unlisted token with its address, not
by a name. `srcTxVerified` is true only when the source transaction was checked on chain when
it was reported (sent by the order's sender to the transaction LayerHop built); only then
should a card say "verified on-chain".

`execution` compares what the quote promised with what arrived: the quoted output, the
quote's guaranteed minimum, the amount the destination transaction actually delivered (read
on chain by LayerHop's worker shortly after the fill; `null` until read, or when it can't be
read), the difference in bps and USD, and every fee (LayerHop's, the partner's, and the
provider fee and gas the provider reported at quote time).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | — |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Trade card. | [TradeCard](#tradecard) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/orders/q_0b5c6a4e-2f1d-4b8a-9c3e-7d6f5a4b3c2d/card"
```

[Try it in the API playground →](/playground?op=getTradeCard)

**Example response** (`200`)

```json
{
  "quoteId": "q_0b5c6a4e-2f1d-4b8a-9c3e-7d6f5a4b3c2d",
  "provider": "relay",
  "srcChainId": 8453,
  "srcToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "srcSymbol": "USDC",
  "srcDecimals": 6,
  "srcVerified": true,
  "srcAmount": "25000000",
  "srcAmountUsd": 25,
  "dstChainId": 7565164,
  "dstToken": "So11111111111111111111111111111111111111112",
  "dstSymbol": "SOL",
  "dstDecimals": 9,
  "dstVerified": true,
  "dstAmount": "131250000",
  "dstAmountUsd": 24.9,
  "srcTxHash": "0x5f2c8a0d3b7e41c6a9f0e2d4b6c8a0e2f4d6b8c0a2e4f6d8b0c2e4a6f8d0b2c4",
  "srcTxVerified": true,
  "dstTxHash": "3xQm7Rk2v9Fh8Lp4Nw6Ty1Zs5Bc3Dd8Ee2Ff7Gg4Hh9Jj6Kk1Ll5Mm3Nn8Pp2Qq7Rr4Ss9Tt6Uu1Vv5Ww3Xx",
  "filledAt": "2026-10-25T09:14:03.000Z",
  "execution": {
    "quoted": "131250000",
    "minimum": "130593750",
    "received": "131301000",
    "receivedUsd": 24.909675,
    "diffBps": 3.88,
    "diffUsd": 0.009675,
    "metMinimum": true,
    "fees": {
      "feeBps": 30,
      "fee": "75000",
      "feeUsd": 0.075,
      "providerFeeUsd": 0.02,
      "gasUsd": 0.01
    }
  }
}
```

### Export a wallet's swaps as CSV (tax)

`GET /v1/portfolio/trades.csv`

Public and read-only, like `GET /v1/portfolio/{address}/trades`: the wallets' filled live
LayerHop swaps (the newest 200, like the trade history; oldest first) as a CSV download with
both legs matched. Limited to 6 exports per minute per IP and cached for a minute; a
dashboard account exports up to 10 000 of its own orders with `GET /v1/dashboard/orders.csv`. Repeat
`address` (or comma-separate it, up to 10) to merge wallets, e.g. an EVM and a Solana wallet:
a swap shows both legs only when both its sender and its recipient are among the addresses;
otherwise only the leg the wallets took part in (same privacy rule as the trade history).

`format`:
- `raw` (default): every column (base and human amounts, quoted and received output, the fee
  as one combined `fee_bps` and in token and USD, provider fee and gas estimates, both tx
  hashes). The dashboard export splits the fee into `layerhop_fee_bps` and `partner_fee_bps`.
- `koinly`: Koinly's universal template (`Date` in `YYYY-MM-DD HH:mm:ss` UTC).
- `cointracker`: CoinTracker's generic template (`Date` in `MM/DD/YYYY HH:mm:ss` UTC).

In the presets, `Sent` is the input net of LayerHop's and the partner's fee and the fee columns
carry those fees in the input token. The received amount is what the destination transaction
delivered when LayerHop read it, else the quoted output. USD values are at fill (empty when not
recorded). Unlisted tokens use their address as the currency. When a token's decimals are
unknown its amount cells are left empty (the description says so); `raw` keeps base units in
its `*_base` columns.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | EVM `0x` or Solana wallet address. Repeat or comma-separate for up to 10 wallets. |
| `format` | `"raw"` \| `"koinly"` \| `"cointracker"` | no | (default `"raw"`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The CSV, as an attachment download. | — |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/portfolio/trades.csv?address=0x2222222222222222222222222222222222222222"
```

## Referrals

Referral attribution (D-038): a quote can name the wallet that referred the user (`referrer`), and the order built from it records that wallet. Referrals never change the fee or the price. Referral rewards (a share of LayerHop's fee on referred swaps) are off unless the operator sets a rate; while on, rewards are paid by hand and recorded, never automatically.

### Get the referral leaderboard

`GET /v1/referrals/leaderboard`

Public and read-only (no key needed, the usual per-IP rate limit applies): the top 50 referring
wallets by referred filled volume in USD over `window` (by order creation time). Live orders
only. Each order counts at its USD value at fill when recorded (`srcAmountUsd`, see
`GET /v1/portfolio/{address}/trades`), otherwise at the source token's **current** price as in
`GET /v1/referrals/{address}`; tokens without a price count as $0. Only volume in **listed**
tokens counts (on LayerHop's curated list, or verified / popular on a provider list): an order
in an unlisted token counts as a filled order with $0 volume. Orders whose sender or recipient
is the referrer are left out. Ties rank by filled orders.

Addresses are truncated server-side (`0x12…abcd`, first and last 4 characters). Pass `address`
to also get that wallet's own rank (`you`, null when it has no filled referred orders in the
window). A leaderboard only: rewards are off and nothing is paid. Cached for 5 minutes
(`updatedAt`). Without a database the list is empty.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `window` | `"7d"` \| `"30d"` \| `"all"` | no | (default `"all"`) |
| `address` | string | no | A wallet to rank (EVM any case, or Solana). Anything else is `INVALID_PARAMS`. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Leaderboard. | [ReferralLeaderboard](#referralleaderboard) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/referrals/leaderboard"
```

**Example response** (`200`)

```json
{
  "window": "7d",
  "updatedAt": "2026-10-25T12:00:00.000Z",
  "entries": [
    {
      "rank": 1,
      "referrer": "0x12…abcd",
      "filledOrders": 14,
      "referredVolumeUsd": 5230.4
    },
    {
      "rank": 2,
      "referrer": "9WzD…AWWM",
      "filledOrders": 3,
      "referredVolumeUsd": 812.07
    }
  ],
  "you": {
    "rank": 2,
    "filledOrders": 3,
    "referredVolumeUsd": 812.07
  }
}
```

### Get referral stats for a wallet

`GET /v1/referrals/{address}`

Public and read-only (no key needed, the usual per-IP rate limit applies): what `address`
referred through `referrer` on quotes. Counts live orders only (test-mode orders are
excluded), and never orders whose sender or recipient is the referrer (self-referral).
`referredOrders` counts every order built with this referrer, `filledOrders` the filled ones.

`referredVolumeUsd` is the filled volume in USD: each order's USD value at fill where recorded
(`srcAmountUsd`), else the summed input amount per token × the token's **current** price from
`GET /v1/prices`; tokens without a price count as $0. Only listed tokens count (on LayerHop's
curated list, or verified / popular on a provider list); unlisted tokens add $0. Rounded to cents.

Rewards are off by default: `rewardBps` is 0, `estimatedRewardsUsd` is 0 and there is no
`rewards` field. When the operator sets a rate, `rewardBps` is the referrer's share of
LayerHop's own fee (in bps of that fee; 2000 = 20%) on referred filled orders that count
towards volume (listed tokens, not self-referred, optionally only orders since a start date),
and `rewards` reports the accrued, paid and unpaid amounts in USD. Rewards are paid out by
hand by the operator; nothing is paid automatically. Results may be cached for up to 30
seconds. Without a database the API answers zeros.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | Referring wallet: an EVM `0x` address (any case) or a Solana address. Anything else is `INVALID_PARAMS`. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Referral stats. | [ReferralStats](#referralstats) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/referrals/0x2222222222222222222222222222222222222222"
```

**Example response** (`200`)

```json
{
  "address": "0x2222222222222222222222222222222222222222",
  "referredOrders": 12,
  "filledOrders": 9,
  "referredVolumeUsd": 4210.55,
  "rewardBps": 0,
  "estimatedRewardsUsd": 0
}
```

## Transparency

Public, aggregate-only data about how LayerHop's routes perform: per provider, how fills compared with their quotes and how our quotes compared with each provider's own price. No addresses, no order ids. Every figure carries its sample size.

### Provider scoreboard

`GET /v1/transparency/providers`

Public and read-only. Per provider over the last 7 or 30 days: live orders that reached an
outcome (filled, refunded, failed), quote accuracy (received vs quoted, on fills whose
delivered amount LayerHop read on chain), how many delivered at least the quoted minimum, the
median time from the transaction being built to the fill (this includes the time the user
took to sign), refund and failure rates, and the daily price check: LayerHop's web quote (fee
included) against that provider's own quote without LayerHop's fee (`medianGapBps` > 0 means a
user got less through LayerHop). Aggregates only, never an address or an order id. Every
figure has its sample size `n`; small samples say little. Cached for 10 minutes.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `days` | `7` \| `30` | no | (default `7`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The scoreboard. | [ProviderScoreboard](#providerscoreboard) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/transparency/providers"
```

**Example response** (`200`)

```json
{
  "days": 7,
  "generatedAt": "2026-10-26T12:00:00.000Z",
  "webFeeBps": 30,
  "priceCheckRuns": 7,
  "providers": [
    {
      "provider": "relay",
      "name": "Relay",
      "caveat": "Relay API without appFees.",
      "settled": 120,
      "filled": 117,
      "refunded": 2,
      "failed": 1,
      "refundRate": 0.0167,
      "failureRate": 0.0083,
      "accuracy": {
        "n": 109,
        "medianBps": 0.4,
        "p10Bps": -3.1
      },
      "minimum": {
        "n": 104,
        "met": 104,
        "rate": 1
      },
      "fillTime": {
        "n": 117,
        "medianSeconds": 21
      },
      "priceCheck": {
        "n": 56,
        "medianGapBps": 31.2,
        "oursMatchedOrBeat": 3
      }
    }
  ]
}
```

## Discovery

Public, read-only discovery data: the cross-chain price gap radar, the new chain radar and the unclaimed airdrop checker.

### New chain radar

`GET /v1/chains/new`

Public and read-only, cached for 5 minutes. Chains that recently joined LayerHop's live chain
registry, and chains a route provider recently started routing (`newChain: false` with a `new`
provider), within the last 30 or 90 days. First-seen times come from LayerHop's own record of
each provider's live chain list, kept since `trackingSince`; chains already listed then never
count as new. Each entry has its gas token, route health (`null` until its first check), the
first time routes in and out worked and the route health changes in the window. Our own data
only, no external APIs.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `days` | `30` \| `90` | no | (default `30`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The radar, newest first. | [NewChainsReport](#newchainsreport) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/chains/new"
```

**Example response** (`200`)

```json
{
  "days": 30,
  "generatedAt": "2026-10-26T12:00:00.000Z",
  "trackingSince": "2026-10-26T09:00:00.000Z",
  "chains": [
    {
      "chainId": 4663,
      "slug": "robinhood",
      "name": "Robinhood Chain",
      "vm": "evm",
      "logoURI": "https://example.com/robinhood.svg",
      "nativeSymbol": "ETH",
      "destinationOnly": false,
      "firstSeenAt": "2026-10-20T10:00:00.000Z",
      "newChain": true,
      "providers": [
        {
          "provider": "relay",
          "name": "Relay",
          "firstSeenAt": "2026-10-20T10:00:00.000Z",
          "new": true
        }
      ],
      "routeHealth": {
        "in": "ok",
        "out": "ok",
        "status": "ok",
        "checkedAt": "2026-10-26T11:10:00.000Z"
      },
      "firstRoutes": {
        "in": "2026-10-20T12:00:00.000Z",
        "out": "2026-10-20T12:00:00.000Z"
      },
      "timeline": [
        {
          "at": "2026-10-20T12:00:00.000Z",
          "direction": "in",
          "from": "unknown",
          "to": "ok"
        }
      ]
    }
  ]
}
```

### Cross-chain price gap radar

`GET /v1/price-gaps`

Public and read-only. The same token on several chains (LayerHop's canonical multi-chain groups:
ETH/WETH, USDC, USDT, DAI, WBTC, cbBTC, plus a top set of multi-chain tokens found on the
provider token lists), its price on each chain (the most liquid DexScreener pool; pools under
`minLiquidityUsd` are left out), and the gap between the cheapest and the dearest chain, biggest
first. For the top `quotedGaps` gaps, `net` holds a real read-only LayerHop quote from the cheap
chain to the dear one per size in `sizesUsd`: `netGapPct` is what the quote delivers, valued at
the destination price, minus the size (our fee and the route's costs included; selling on the
destination chain is not). Gaps above 25% are `suspect` (usually different tokens sharing a
symbol) and never quoted. Refreshed at most every 5 minutes, only when requested, within an
hourly quote budget (`quoteErrors` code `BUDGET` when it runs out). Not financial advice.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The radar. | [PriceGapReport](#pricegapreport) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/price-gaps"
```

**Example response** (`200`)

```json
{
  "generatedAt": "2026-10-26T12:00:00.000Z",
  "refreshSeconds": 300,
  "sizesUsd": [
    100,
    1000
  ],
  "minLiquidityUsd": 100000,
  "quotedGaps": 3,
  "chains": [
    "arbitrum",
    "base",
    "ethereum",
    "optimism",
    "solana"
  ],
  "rows": [
    {
      "group": "USDC",
      "gapPct": 0.18,
      "suspect": false,
      "cheap": {
        "chainId": 7565164,
        "slug": "solana",
        "chain": "Solana",
        "address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "symbol": "USDC",
        "decimals": 6,
        "priceUsd": 0.9997,
        "liquidityUsd": 25000000,
        "pool": "8sLb…"
      },
      "dear": {
        "chainId": 10,
        "slug": "optimism",
        "chain": "OP Mainnet",
        "address": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
        "symbol": "USDC",
        "decimals": 6,
        "priceUsd": 1.0015,
        "liquidityUsd": 4000000,
        "pool": "0x…"
      },
      "prices": [],
      "net": [
        {
          "sizeUsd": 100,
          "provider": "relay",
          "dstAmount": "99620000",
          "netGapPct": -0.23,
          "estimatedSeconds": 20
        },
        {
          "sizeUsd": 1000,
          "provider": "relay",
          "dstAmount": "998100000",
          "netGapPct": -0.04,
          "estimatedSeconds": 20
        }
      ]
    }
  ]
}
```

### Airdrops the claims checker covers

`GET /v1/claims/airdrops`

The curated airdrops `GET /v1/claims` checks, with the claim contract read, the official claim
site (the only place to claim: look-alike sites are phishing), whether the window is still open
and what the check can and can't tell.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Covered airdrops. | object |

**Example request**

```bash
curl "https://api.layerhop.com/v1/claims/airdrops"
```

### Check an address for unclaimed airdrops

`GET /v1/claims`

Public and read-only: per covered airdrop (`GET /v1/claims/airdrops`), whether the address has
something to claim, already claimed or missed a closed window, read from the official claim
contract (`eth_call`) and the official public data where the contract alone can't say. LayerHop
never builds claim transactions for third-party airdrops: claim on the official site. One
airdrop failing comes back as `state: unknown` with `error: true`; the others still answer.
Limited per IP and process-wide; results cached for 10 minutes.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | EVM address. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Results per airdrop. | [ClaimsScan](#claimsscan) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/claims"
```

**Example response** (`200`)

```json
{
  "address": "0x98ae0e5d4977fa1231d4b7afa97881bf7abbfcc4",
  "checkedAt": 1793047478,
  "results": [
    {
      "airdrop": "uniswap",
      "state": "claimable",
      "unclaimed": [
        {
          "amount": "400000000000000000000",
          "symbol": "UNI",
          "decimals": 18,
          "chainId": 1,
          "token": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"
        }
      ],
      "claimed": []
    },
    {
      "airdrop": "linea",
      "state": "not_eligible",
      "unclaimed": [],
      "claimed": []
    }
  ]
}
```

## Pay links

Personal pay links (`https://layerhop.com/to/<name>`): anyone pays a person from any chain and token; the person receives their preferred token on their preferred chain. `<name>` is an ENS name, a `.sol` name or a plain EVM / Solana address. Public, read-only.

### Resolve a pay link

`GET /v1/pay-links/{name}`

Who a pay link (`https://layerhop.com/to/<name>`) pays and in which token. `name` is an ENS
name (resolved read-only on Ethereum: its address, its Solana address record and the
`com.layerhop.receive` text record), a `.sol` name (the SNS owner wallet; names held by a
program, e.g. tokenized ones, are refused) or a plain EVM / Solana address.

For an EVM chain other than Ethereum an ENS name pays its ENSIP-11 address record for that
chain; without one, its Ethereum address only when that has no contract code on Ethereum (a
plain wallet), or when the same contract also exists on the destination (with a warning).
Otherwise the entry is skipped. Offchain (CCIP-Read) resolvers are followed only to public
https gateways.

The token is the first deliverable one of: the link's `chain` / `token`, the entries of the
`com.layerhop.receive` record (`<chain>:<token>`, comma-separated in order of preference, e.g.
`base:USDC` or `arbitrum:ETH, base:USDC`), then the default (USDC on Base for an EVM address,
USDC on Solana for a Solana address). Only listed tokens are used. Skipped entries are listed in
`warnings`. Paying uses a normal web swap (`POST /v1/quote` with `recipient` = `address`); the
usual web fee applies and pay links add none. Cached for 5 minutes.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | — |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | no | Chain slug or id the link asks for (wins over the ENS record). |
| `token` | string | no | Token symbol or address on that chain. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The recipient and the token they receive. | [PayLink](#paylink) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/pay-links/alice.eth"
```

**Example response** (`200`)

```json
{
  "input": "alice.eth",
  "kind": "ens",
  "name": "alice.eth",
  "address": "0x1111111111111111111111111111111111111111",
  "vm": "evm",
  "receive": {
    "chainId": 8453,
    "chain": "base",
    "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "symbol": "USDC",
    "decimals": 6,
    "source": "ens"
  },
  "textRecord": "base:USDC",
  "warnings": []
}
```

## Splits

Split the bill (`https://layerhop.com/split/<id>`): one person is owed a total in one token on one chain; each participant pays their share from any chain and token with a normal swap whose quote carries `splitId` + `splitShare`. Paid status comes from filled orders. No sign-in: the creator edits with the secret returned once at creation.

### Create a split

`POST /v1/splits`

Creates a split: `recipient` (an address, ENS name or `.sol` name, resolved like a pay link) is
owed `total` base units of `token` on `chain`, divided into `participants` equal shares or into
`shares` (labels, and amounts that add up to `total` exactly; equal shares when no share has an
amount). Equal shares differ by at most one base unit (the first shares get the remainder).
Only listed tokens. Returns the split with `editToken`, the secret that edits it, shown only
here (LayerHop stores its SHA-256), and `editUrl`, the split's page with the secret in the URL
fragment. Public, no key; 10 per minute per client.

**Request body** — [SplitCreateRequest](#splitcreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | The split, with its one-time edit secret. | [SplitCreated](#splitcreated) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/splits" \
  -H "content-type: application/json" \
  -d '{"recipient":"alice.eth","chain":"base","token":"USDC","total":"120000000","participants":4,"note":"Dinner at Luigi's"}'
```

**Example response** (`201`)

```json
{
  "id": "spl_01k8x2m3n4p5q6r7s8t9v0w1x2",
  "url": "https://layerhop.com/split/spl_01k8x2m3n4p5q6r7s8t9v0w1x2",
  "status": "open",
  "note": "Dinner at Luigi's",
  "recipient": "0x1111111111111111111111111111111111111111",
  "recipientName": "alice.eth",
  "chainId": 8453,
  "chain": "base",
  "token": {
    "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "symbol": "USDC",
    "decimals": 6
  },
  "total": "120000000",
  "collected": "0",
  "paidCount": 0,
  "shares": [
    {
      "index": 0,
      "label": "",
      "amount": "30000000",
      "received": "0",
      "status": "unpaid",
      "payments": 0,
      "pending": 0
    },
    {
      "index": 1,
      "label": "",
      "amount": "30000000",
      "received": "0",
      "status": "unpaid",
      "payments": 0,
      "pending": 0
    },
    {
      "index": 2,
      "label": "",
      "amount": "30000000",
      "received": "0",
      "status": "unpaid",
      "payments": 0,
      "pending": 0
    },
    {
      "index": 3,
      "label": "",
      "amount": "30000000",
      "received": "0",
      "status": "unpaid",
      "payments": 0,
      "pending": 0
    }
  ],
  "createdAt": "2026-10-28T12:00:00.000Z",
  "updatedAt": "2026-10-28T12:00:00.000Z",
  "editToken": "3qQ0x9Rk2vT8nB4mL7cY1wZ5pF6hJ0aD",
  "editUrl": "https://layerhop.com/split/spl_01k8x2m3n4p5q6r7s8t9v0w1x2#k=3qQ0x9Rk2vT8nB4mL7cY1wZ5pF6hJ0aD"
}
```

### Get a split and who has paid

`GET /v1/splits/{id}`

The split and each share's status: `received` adds up what filled orders tagged with the share
delivered to the recipient (the amount read on chain, else the quote's guaranteed minimum);
a share is `paid` within 0.5% of its amount, `partial` below that. `pending` counts payments
sent but not filled yet. Public; never cached.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The split. | [Split](#split) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/splits/spl_01k8x2m3n4p5q6r7s8t9v0w1x2"
```

### Edit or close a split

`PATCH /v1/splits/{id}`

Rename the shares (`labels`, one per share), change the `note` (`null` clears it), or set
`status` to `closed` (no more payments: quotes for it answer `CONFLICT`) or back to `open`.
Amounts can't change. Send the edit secret in `x-edit-token` (or `Authorization: Bearer`):
`UNAUTHORIZED` without it, `FORBIDDEN` when it is wrong.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |

**Request body** — [SplitUpdateRequest](#splitupdaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The updated split. | [Split](#split) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | `FORBIDDEN`: wrong edit secret for this split. | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X PATCH "https://api.layerhop.com/v1/splits/spl_01k8x2m3n4p5q6r7s8t9v0w1x2" \
  -H "content-type: application/json" \
  -d '{"labels":["Ana","Bo","Cy","Di"],"status":"closed"}'
```

## Tip jars

Tip jar counters for the embeddable "Tip me in crypto" card (`https://layerhop.com/tip/<name>`): how many wallets tipped an address through a tip jar. Public, read-only.

### Tip jar counter

`GET /v1/tip-jars/{address}`

How many distinct wallets tipped `address` through a LayerHop tip jar (filled live orders with
`purpose=tip` to it), the number of tips, and the latest 10 messages tippers left (plain text).
Resolve names first with `GET /v1/pay-links/{name}`. Public; cached for a minute. Zeros when the
deployment runs without a database.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | EVM or Solana address. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The counters. | [TipJar](#tipjar) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/tip-jars/0x1111111111111111111111111111111111111111"
```

**Example response** (`200`)

```json
{
  "address": "0x1111111111111111111111111111111111111111",
  "tippers": 42,
  "tips": 57,
  "messages": [
    {
      "text": "Love the stream!",
      "at": "2026-10-28T12:00:00.000Z"
    }
  ]
}
```

## Payouts

Bulk payouts: pay up to 100 people from one wallet and one token. The API checks and groups the rows and builds same-chain transfer batches; every transaction is signed by the payer's wallet.

### Check and group payout rows

`POST /v1/payouts/plan`

Checks up to 100 payout rows, sent as `csv` text (`recipient,amount,token,chain[,label]`, with
or without a header row; commas, semicolons or tabs) or as JSON `rows`. For each row: the chain,
a listed token, the amount in human units of that token (converted to base units, never
rounded), and the recipient (an address of the chain's VM, or an ENS / `.sol` name resolved
read-only like pay links). Every row comes back with `ok` and either the resolved details or an
`error`; a bad row never fails the request.

Names: on an EVM chain other than Ethereum an ENS row pays the name's address record for that
chain, else its Ethereum address only when that is a plain wallet or the same contract exists
on the chain (otherwise `NOT_FOUND`). At most 25 different names per plan (rows past that ask
for an address); names resolve within 20 seconds (`PROVIDER_ERROR`) and a budget shared by all
clients (`RATE_LIMITED`), and are reused for a minute.

Valid rows are grouped against the payer's `srcChain` / `srcToken`: rows that receive that
token on that chain are plain transfers (`transfers`, batches of at most 20 on EVM and 8 on
Solana; build each with `POST /v1/payouts/transfers`; no LayerHop fee); every other row is a
route (`routes`, grouped by destination chain): quote it with `POST /v1/quote` using the row's
recipient and `purpose=payout`; the normal swap fee applies. Token `usd` prices help size a
route so it delivers the full amount. Public; 20 per minute per client.

**Request body** — [PayoutPlanRequest](#payoutplanrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Every row checked, and the valid ones grouped. | [PayoutPlan](#payoutplan) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/payouts/plan" \
  -H "content-type: application/json" \
  -d '{"srcChain":"base","srcToken":"USDC","sender":"0xAbC0000000000000000000000000000000000001","csv":"recipient,amount,token,chain,label\nalice.eth,250,USDC,base,March design\n7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU,40,USDC,solana"}'
```

### Build a transfer batch

`POST /v1/payouts/transfers`

Builds one batch of plain transfers of `token` on `chain` from `sender` (amounts in base units)
for the payer's wallet to sign. EVM: one call per transfer (ERC-20 `transfer`, or a value
transfer for the native coin), at most 20; send them as one EIP-5792 `wallet_sendCalls` where
the wallet supports atomic batching (`@layerhop/wagmi` `sendWalletCalls`), else one transaction
each. Solana: one unsigned transaction with up to 8 transfers (SPL `TransferChecked` after an
idempotent creation of each recipient's token account, or System `Transfer` for SOL) and a
fresh blockhash: sign and send it soon. Only listed tokens of the classic SPL token program
(a Token-2022 mint is `UNSUPPORTED_TOKEN`), and Solana amounts up to the u64 maximum
(`INVALID_PARAMS`). Check each returned call against its row before the wallet signs. No
LayerHop fee. Public; 60 per minute per client.

**Request body** — [PayoutTransfersRequest](#payouttransfersrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The calls (EVM) or the unsigned transaction (Solana). | [PayoutTransfers](#payouttransfers) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/payouts/transfers" \
  -H "content-type: application/json" \
  -d '{"chain":"base","token":"USDC","sender":"0xAbC0000000000000000000000000000000000001","transfers":[{"recipient":"0x3333333333333333333333333333333333333333","amount":"250000000"}]}'
```

**Example response** (`200`)

```json
{
  "vm": "evm",
  "chainId": 8453,
  "token": {
    "chainId": 8453,
    "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "symbol": "USDC",
    "decimals": 6
  },
  "calls": [
    {
      "to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "data": "0xa9059cbb00000000000000000000000033333333333333333333333333333333333333330000000000000000000000000000000000000000000000000000000000ee6b280",
      "value": "0"
    }
  ]
}
```

## Earn

Fund any app and the stablecoin yield router: where popular apps' deposits land (`GET /v1/fund/targets`), a user's Polymarket bridge address, current USDC / USDT supply rates across Aave v3, Compound v3, Morpho vaults and Spark (`GET /v1/yields`), and the deposit calls for the user's own wallet, simulated before they are returned. Read-only: LayerHop never holds the funds and never moves them later. These are third-party apps LayerHop doesn't control.

### List fund-an-app targets

`GET /v1/fund/targets`

Where a deposit into each supported app lands, and who receives it:
`polymarket` (`kind: bridge-address`): native USDC on Polygon sent to the user's own Polymarket
bridge address (`POST /v1/fund/polymarket/address`), which credits their Polymarket balance
(minimum $2); `hyperliquid` (`own-account`): USDC to the user's own address on HyperCore (chain
1337, perps USDC); `aave-v3-base` / `aave-v3-arbitrum` (`vault`): USDC on that chain to the
user's wallet, then the supply from the wallet (`POST /v1/yields/{id}/deposit`), or in one step
with the destination-calls `aave-v3-supply` action when `oneStep` is true (destination calls
live); `deposit-address` (`custom-address`): any app's deposit address the user pastes, on the
chain and token that app asks for. Every target has the `risk` text to show before signing.
Public, cached 5 minutes.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The targets. | [FundTargetsResponse](#fundtargetsresponse) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/fund/targets"
```

**Example response** (`200`)

```json
{
  "destinationCallsLive": false,
  "targets": [
    {
      "id": "polymarket",
      "name": "Polymarket",
      "kind": "bridge-address",
      "description": "USDC to your Polymarket balance (Polymarket converts it to pUSD on Polygon).",
      "dst": {
        "chainId": 137,
        "token": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
        "symbol": "USDC",
        "decimals": 6
      },
      "minUsd": 2,
      "risk": "Polymarket's bridge credits your Polymarket wallet. …",
      "source": "https://docs.polymarket.com/trading/bridge/deposit",
      "url": "https://polymarket.com"
    },
    {
      "id": "aave-v3-base",
      "name": "Aave v3 on Base",
      "kind": "vault",
      "description": "Supply USDC to Aave v3 on Base and earn its variable supply rate.",
      "dst": {
        "chainId": 8453,
        "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
        "symbol": "USDC",
        "decimals": 6
      },
      "vaultId": "aave-v3:8453:usdc",
      "risk": "Aave is a lending protocol LayerHop doesn't control: …",
      "source": "https://aave.com/docs/developers/smart-contracts/pool",
      "url": "https://app.aave.com",
      "oneStep": false
    }
  ]
}
```

### Get a Polymarket bridge address

`POST /v1/fund/polymarket/address`

Asks Polymarket's Bridge API (`POST https://bridge.polymarket.com/deposit`) for the bridge
addresses of a Polymarket wallet and returns them validated: `evm` receives USDC on Polygon (and
Polymarket's other supported EVM assets) and credits that Polymarket account. Send the user's own
Polymarket wallet address (shown in their Polymarket profile), not an exchange address. Replies
are cached for a day per wallet; at most 10 lookups per IP per minute (`RATE_LIMITED`).
`PROVIDER_ERROR` when Polymarket is unreachable or answers without a usable address.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The bridge addresses. | [PolymarketAddresses](#polymarketaddresses) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/fund/polymarket/address" \
  -H "content-type: application/json" \
  -d '{"address":"0x56687bf447db6ffa42ffe2204a05edaa20f55839"}'
```

**Example response** (`200`)

```json
{
  "wallet": "0x56687bf447db6ffa42ffe2204a05edaa20f55839",
  "evm": "0xa84ec1f8f461c25ffa5a6f60249c6d531cb2b608",
  "svm": "Gje4vt9gwSzbq1U9vbwgRWuyVfGqYoPrX8f9VZWo6cuQ"
}
```

### List stablecoin supply rates

`GET /v1/yields`

Current supply APYs of a fixed registry of major USDC / USDT vaults, best first: Aave v3
(Ethereum, Base, Arbitrum, Optimism, Polygon; USDT on Ethereum), Compound v3 (Ethereum, Base,
Arbitrum), Morpho vaults (Spark USDC, Gauntlet USDC Prime and Steakhouse USDC on Base; Steakhouse
USDC / USDT on Ethereum) and Spark Savings USDC (Ethereum). Aave, Compound and Spark rates are read
on-chain (`currentLiquidityRate`, `getSupplyRate(getUtilization())`, the Sky Savings Rate); Morpho
APYs come from Morpho's API (`netApy`: after the curator fee, incl. rewards). Every vault's
address and deposit were verified against mainnet state. A vault whose rate can't be read is
listed in `unavailable`. Rates are variable, not a promise. Cached 5 minutes.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `asset` | `"USDC"` \| `"USDT"` | no | `USDC` (default) or `USDT`. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The pools. | [YieldsResponse](#yieldsresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/yields"
```

**Example response** (`200`)

```json
{
  "asset": "USDC",
  "updatedAt": 1761502800,
  "source": "onchain+morpho-api",
  "unavailable": [],
  "pools": [
    {
      "id": "morpho:8453:gtusdcp",
      "protocol": "morpho",
      "name": "Gauntlet USDC Prime (Morpho)",
      "chainId": 8453,
      "chain": "base",
      "token": {
        "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
        "symbol": "USDC",
        "decimals": 6
      },
      "apy": 5.28,
      "apyBase": 5.28,
      "apyReward": 0,
      "tvlUsd": 410867632,
      "depositable": true,
      "deposit": {
        "kind": "erc4626-deposit",
        "target": "0xee8f4ec5672f09119b96ab6fb59c27e1b7e44b61"
      },
      "url": "https://app.morpho.org/base/vault/0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61"
    },
    {
      "id": "aave-v3:8453:usdc",
      "protocol": "aave-v3",
      "name": "Aave v3 USDC",
      "chainId": 8453,
      "chain": "base",
      "token": {
        "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
        "symbol": "USDC",
        "decimals": 6
      },
      "apy": 5.15,
      "apyBase": 5.15,
      "apyReward": 0,
      "tvlUsd": 192552928,
      "depositable": true,
      "deposit": {
        "kind": "aave-v3-supply",
        "target": "0xa238dd80c259a72e81d7e4664a9801593f98d1c5"
      },
      "url": "https://app.aave.com/reserve-overview/?underlyingAsset=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&marketName=proto_base_v3"
    }
  ]
}
```

### Build a vault deposit

`POST /v1/yields/{id}/deposit`

The calls that deposit `amount` (base units of the vault's stablecoin) from `owner`'s own wallet
into the vault, for `owner`: an exact-amount `approve` (Ethereum USDT resets its allowance to 0
first), then `supply(asset, amount, owner, 0)` (Aave v3), `supply(asset, amount)` (Compound v3,
credits the sender) or `deposit(amount, owner)` (ERC-4626 vaults). Before they are returned the
calls are simulated read-only with `eth_simulateV1` from `owner`, holding exactly `amount` (state
override): a revert is `CALLS_REVERTED` (400, with the failing call), a simulation that can't run `PROVIDER_ERROR`. Send them
from `owner` with EIP-5792 `wallet_sendCalls` (one confirmation) where the wallet supports it, or
one by one. Nothing is signed or sent by LayerHop.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Pool id from `GET /v1/yields`. |

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The simulated calls. | [YieldDepositPlan](#yielddepositplan) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/yields/aave-v3%3A8453%3Ausdc/deposit" \
  -H "content-type: application/json" \
  -d '{"owner":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","amount":"100000000"}'
```

**Example response** (`200`)

```json
{
  "vault": "aave-v3:8453:usdc",
  "chainId": 8453,
  "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "amount": "100000000",
  "owner": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
  "calls": [
    {
      "to": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
      "data": "0x095ea7b3…",
      "value": "0"
    },
    {
      "to": "0xa238dd80c259a72e81d7e4664a9801593f98d1c5",
      "data": "0x617ba037…",
      "value": "0"
    }
  ],
  "simulation": {
    "ok": true,
    "gasUsed": "263500",
    "leftover": "0"
  }
}
```

## Alerts

Telegram alerts from the web app (D-040): the app parks a price or followed-wallet alert as a short-lived draft and opens the LayerHop Telegram bot with `?start=d_<id>`; the bot reads the draft, asks the user to confirm, and keeps the alert itself. Public, no key.

### Create a Telegram alert draft

`POST /v1/alerts/drafts`

Parks an alert rule for 15 minutes so it fits in a Telegram deep link: open
`https://t.me/layerhop_bot?start=d_<id>` and the bot asks the user to confirm it. `kind: price`
alerts when the token's USD price goes `above` or `below` `priceUsd`; `kind: wallet` alerts when
the wallet swaps (the bot watches Solana wallets only for now). Chains: `solana`, `robinhood` and
`berachain` (the app's market chains).
`kind: dev_sell` takes `token` and `creator` instead of `address` and alerts when the creator
wallet sells (or moves) that token; it also works on `base` and `arbitrum` (the draft stores
`address` = `token`). The API resolves the token's creator itself (LayerHop launch records via
the app, else RugCheck on Solana or GoPlus on EVM chains, 3 s each) and stores `verified: true`
only when it matches `creator`; otherwise the draft is kept with `verified: false` and the bot
calls the wallet a "watched wallet", never "the dev".
`purpose: stop_loss` (price drafts with `op: below` only) marks an exit plan's stop-loss: when
it fires, the bot offers to **sell** the token for a stablecoin instead of buying it.

Alert-core kinds (alerts that stay on, with cooldowns and a one-click mute; all five chains):
`rug` alerts when the token's main pool loses `pct` % (default 50, 20–95) of its liquidity
within an hour or its risk report (`GET /v1/tokens/{chain}/{address}/risk`) turns `danger`; an
optional `creator` also starts a dev-sell watch (verified like `dev_sell`). `unlock` alerts
ahead of vesting unlocks (DefiLlama's emissions data) of at least `minPct` % of circulating
supply (default 1) or `minUsd` dollars (default 1,000,000), `leadDays` days ahead (default 3,
1–30). `move` (`solana`, `robinhood`, `berachain`) alerts when the price moves `pct` % (default 10, 1–1000)
within `window` (`1h` default, or `24h`). `gap` alerts when a token we list on several chains
(USDC, USDT, ETH / WETH, DAI, WBTC, cbBTC) is `pct` % (default 1, 0.1–50) cheaper on another
chain, with a "Swap now" link; other tokens are `INVALID_PARAMS`. They take `address` (the token).
Kinds without a token (no `chain` / `address`; Telegram only): `yield` alerts when the best other
depositable pool in `GET /v1/yields` pays at least `pct` APY points (default 1, 0.1–20) more than
`vault`, at most once a day, linking to app.layerhop.com/earn; `drift` reads the `wallets`'
balances every 6 hours and reminds when a target asset's share of the targets' total value is
`pct` points (default 5, 1–50) off its `weightBps` (summing to 10000), linking to `link`
(default the rebalancer); `reminder` sends `title` with a button to `link` on a UTC `schedule`
(after downtime only the latest missed one). `link` must be https on layerhop.com or
app.layerhop.com. Reminders only: nothing ever trades.
Public, no key needed; on top of the usual per-IP rate limit, at most 10 drafts per IP per
minute and 20 open (unexpired) drafts per IP (`RATE_LIMITED`). Drafts are kept in memory only
(20,000 at most; when full the oldest is dropped) and never hold market data. For price drafts
the token-list symbol replaces the `symbol` sent when the token is known.

**Request body** — [AlertDraftInput](#alertdraftinput) | [AlertDraftYield](#alertdraftyield) | [AlertDraftDrift](#alertdraftdrift) | [AlertDraftReminder](#alertdraftreminder) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Draft stored. | [AlertDraftCreated](#alertdraftcreated) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/alerts/drafts" \
  -H "content-type: application/json" \
  -d '{}'
```

**Example response** (`201`)

```json
{
  "id": "Xk3_9aQz-1",
  "expiresAt": 1760000900
}
```

### Get a Telegram alert draft

`GET /v1/alerts/drafts/{id}`

Reads a draft back (the Telegram bot does this on `/start d_<id>`). `NOT_FOUND` once it expired (15 minutes) or after an API restart.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | The draft id from `POST /v1/alerts/drafts` (10 characters). (pattern `^[A-Za-z0-9_-]{10}$`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The draft. | [AlertDraft](#alertdraft) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/alerts/drafts/Xk3_9aQz-1"
```

**Example response** (`200`)

```json
{
  "id": "Xk3_9aQz-1",
  "kind": "price",
  "chain": "solana",
  "chainId": 7565164,
  "address": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
  "op": "above",
  "priceUsd": "0.00003",
  "symbol": "BONK",
  "expiresAt": 1760000900
}
```

## Recover

Stuck native-bridge withdrawals: Arbitrum One / Nova and OP Stack withdrawals to Ethereum whose second step (Arbitrum: claim; OP Stack: prove, then finalize) was never sent. Scan an address or look up one withdrawal, then build the next transaction for the user's own wallet to sign. Every step is eth_call-simulated before it is returned. Public, no key; read-only.

### List chains Recover covers

`GET /v1/recover/chains`

The L2s whose native-bridge withdrawals Recover finds and finishes, with the steps each needs and
how far back an address scan reaches (`history: full`, or `recent` where public explorers can't
serve the whole history: Base and Zora scan about the last two days; look older withdrawals up
by transaction hash).

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Supported chains. | object |

**Example request**

```bash
curl "https://api.layerhop.com/v1/recover/chains"
```

**Example response** (`200`)

```json
{
  "chains": [
    {
      "chainId": 42161,
      "slug": "arbitrum",
      "name": "Arbitrum One",
      "bridge": "arbitrum",
      "bridgeName": "Arbitrum Bridge",
      "bridgeUrl": "https://portal.arbitrum.io/bridge?sourceChain=arbitrum-one&destinationChain=ethereum",
      "challengeSeconds": 552960,
      "history": "full",
      "steps": [
        "claim"
      ]
    },
    {
      "chainId": 8453,
      "slug": "base",
      "name": "Base",
      "bridge": "op-stack",
      "bridgeName": "Superbridge",
      "bridgeUrl": "https://superbridge.app/base",
      "challengeSeconds": 86400,
      "history": "recent",
      "steps": [
        "prove",
        "finalize"
      ]
    }
  ]
}
```

### Scan an address for stuck withdrawals

`GET /v1/recover/withdrawals`

Finds the address's native-bridge withdrawals on every supported chain (or one, with `chain`) and
reads each one's state on Ethereum. Arbitrum: ETH withdrawals and token withdrawals through the
standard, custom, WETH and DAI gateways paying out to the address (Nitro, since Aug 2022). OP Stack:
standard-bridge withdrawals sent from the address, ETH bridged to it, and direct portal
withdrawals. Up to 40 withdrawal transactions per chain, newest first. `coverage` says per chain
whether the whole history was scanned; a chain that couldn't be scanned has `error: true` instead
of failing the request. Actionable withdrawals sort first. Cached for 5 minutes; at most 2 scans
per IP per minute (cached answers are free), within a per-minute budget shared by all clients.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | EVM address to scan. (pattern `^0x[0-9a-fA-F]{40}$`) |
| `chain` | string | no | Scan only this chain (id or slug). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Withdrawals found and how complete the scan was. | [RecoverScan](#recoverscan) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/recover/withdrawals?address=0xa5BA6e62e9a2CBDeac73F675C26257C75A3FE401"
```

**Example response** (`200`)

```json
{
  "address": "0xa5ba6e62e9a2cbdeac73f675c26257c75a3fe401",
  "withdrawals": [
    {
      "id": "42161:0x397ea01fc089ed8b89bbdf6eb588755996dc6b90ce1eb641369cc05f3659c1c6:0",
      "bridge": "arbitrum",
      "chainId": 42161,
      "l2TxHash": "0x397ea01fc089ed8b89bbdf6eb588755996dc6b90ce1eb641369cc05f3659c1c6",
      "initiatedAt": 1676124519,
      "from": "0xa5ba6e62e9a2cbdeac73f675c26257c75a3fe401",
      "to": "0xa5ba6e62e9a2cbdeac73f675c26257c75a3fe401",
      "token": {
        "address": "0x0000000000000000000000000000000000000000",
        "symbol": "ETH",
        "decimals": 18
      },
      "amount": "500000000000000",
      "state": "ready",
      "step": "execute",
      "bridgeName": "Arbitrum Bridge",
      "bridgeUrl": "https://portal.arbitrum.io/bridge?sourceChain=arbitrum-one&destinationChain=ethereum"
    }
  ],
  "coverage": [
    {
      "chainId": 42161,
      "name": "Arbitrum One",
      "complete": true,
      "fromBlock": 22207817,
      "source": "rpc"
    }
  ],
  "scannedAt": 1793035889
}
```

### Look up the withdrawals in one transaction

`GET /v1/recover/withdrawals/{chain}/{txHash}`

The native-bridge withdrawals started by one L2 transaction, with their state. Works for any age, including withdrawals an address scan can't reach. Cached for a minute.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | yes | The L2 (id or slug) the withdrawal started on. |
| `txHash` | string | yes | The withdrawal's L2 transaction hash. (pattern `^0x[0-9a-fA-F]{64}$`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The withdrawals in the transaction. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/recover/withdrawals/arbitrum/0x397ea01fc089ed8b89bbdf6eb588755996dc6b90ce1eb641369cc05f3659c1c6"
```

### Build the next step of a withdrawal

`GET /v1/recover/claim`

The withdrawal's current state and, when it is actionable, the transaction for its next step on
Ethereum: `execute` (Arbitrum `Outbox.executeTransaction` with a proof against the latest
confirmed send root), `prove` (OP Stack `proveWithdrawalTransaction` against the latest dispute
game, offered only when the game proves output roots and our proof matches its root claim) or
`finalize` (`finalizeWithdrawalTransactionExternalProof`). The transaction is simulated with
`eth_call` from `sender`; a `prove` that doesn't simulate is never returned (the withdrawal comes
back as `prove_elsewhere`), and an `execute` or `finalize` that doesn't simulate comes back
without `tx` (`simulation.ok: false` with the error). Anyone may send a claim: the funds always
go to the withdrawal's recipient. Without an actionable step `tx`, `step` and `simulation` are
absent. At most 30 lookups per IP per minute, within a budget shared by all clients.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | yes | The L2 (id or slug). |
| `txHash` | string | yes | The withdrawal's L2 transaction hash. (pattern `^0x[0-9a-fA-F]{64}$`) |
| `index` | integer | no | Which withdrawal in the transaction (the last part of `StuckWithdrawal.id`). (default `0`) (0–255) |
| `sender` | string | yes | The wallet that will send the transaction (for the simulation). (pattern `^0x[0-9a-fA-F]{40}$`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The withdrawal and, when actionable, its next transaction. | [RecoverClaim](#recoverclaim) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/recover/claim?chain=arbitrum&txHash=0x397ea01fc089ed8b89bbdf6eb588755996dc6b90ce1eb641369cc05f3659c1c6&sender=0xa5BA6e62e9a2CBDeac73F675C26257C75A3FE401"
```

## Track

"Where's my money?": look up any bridge or aggregator transfer by its source transaction (EVM hash or Solana signature), not only LayerHop orders. Detects the protocol from the transaction's receipt and asks the protocols' public status APIs. Public, no key; read-only.

### Track any bridge transfer

`GET /v1/track/{txHash}`

Where a cross-chain transfer stands, from its source transaction on any bridge or aggregator:
Relay, LI.FI, Across, deBridge, Mayan, LayerZero apps (Stargate, OFTs), Circle CCTP v2, Wormhole,
Gas.zip, and the Arbitrum and OP Stack native bridges. Finds the transaction on `chain` (or on
the 8 most used chains, then about 20 more while a shared budget lasts), detects the protocol from the contract called and the events emitted,
asks the protocols' public status APIs, and returns the status, the destination transaction when
known, the usual duration and `next`, the concrete next step (`wait`, `late` → contact support,
`claim` → Recover, `refunded`, `support`, `source_failed`, `not_found`, `unrecognized`). LayerHop's
own orders go through `GET /v1/orders/{provider}/{id}` and come back with `protocol.id: layerhop`.
Answers are cached (20 seconds while in progress, 10 minutes once final, 5 minutes for a hash
nothing knows); at most 20 uncached lookups per IP per minute, within a per-minute budget shared
by all clients.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `txHash` | string | yes | Source transaction hash (EVM) or Solana signature. |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | no | The source chain (id or slug); faster and avoids probing. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The transfer's status and next step. | [TrackResult](#trackresult) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/track/0xd9a702a19c7ce879cf38ea79ea4a2ddae514ea3736f725221fe7d6a2269c3c60"
```

**Example response** (`200`)

```json
{
  "txHash": "0xd9a702a19c7ce879cf38ea79ea4a2ddae514ea3736f725221fe7d6a2269c3c60",
  "chainId": 1868,
  "source": "success",
  "protocol": {
    "id": "lifi",
    "name": "LI.FI",
    "via": "across",
    "explorerUrl": "https://scan.li.fi/tx/0xd9a702a19c7ce879cf38ea79ea4a2ddae514ea3736f725221fe7d6a2269c3c60",
    "supportUrl": "https://help.li.fi"
  },
  "status": "filled",
  "dstChainId": 8453,
  "dstTxHash": "0x066e173cec4e7bbc0109529c056c83d203170771aeaf1912d2500564b8095406",
  "startedAt": 1793036525,
  "typicalSeconds": 180,
  "next": {
    "kind": "done",
    "message": "Delivered. The funds arrived on the destination chain.",
    "url": "https://basescan.org/tx/0x066e173cec4e7bbc0109529c056c83d203170771aeaf1912d2500564b8095406",
    "label": "Destination transaction"
  },
  "sources": [
    "lifi",
    "across"
  ],
  "checkedAt": 1793036600
}
```

## Gas station

Refuel up to 10 chains with native gas from one transaction (source: Gas.zip). Off unless the deployment sets `GAS_STATION_ENABLED=1`; every route answers `FORBIDDEN` while off. LayerHop takes no fee on refuels.

### List gas station chains

`GET /v1/gas/chains`

Chains you can pay from (`inbound`, native token) and refuel (`outbound`), with the per-chain USD range (our $0.50 – $50 caps within the source's own limits). Cached for 5 minutes.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Chains. | object |
| `403` | `FORBIDDEN`: the gas station isn't enabled on this deployment. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/gas/chains"
```

### Quote a multi-chain refuel

`POST /v1/gas/quote`

One transaction on `srcChain` (paid in its native token) that delivers native gas to every
destination. The source splits one deposit evenly, so every destination takes the same `usd`
(1 to 10 destinations, distinct, not the source chain). The returned `tx` (a call to Gas.zip's
deposit contract) is checked against the request (contract, destinations from LayerHop's own
Gas.zip chain-id table, recipient, value; Gas.zip's native price within 3% of ours)
before it is returned, then simulated with `eth_call` from `sender` (`simulation.ok: false`
usually means not enough balance). `NO_ROUTE` names destinations the source can't serve right
now. Good for about 60 seconds. At most 30 quotes per IP per minute.

**Request body** — [GasStationQuoteInput](#gasstationquoteinput) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The refuel quote and its transaction. | [GasStationQuote](#gasstationquote) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `403` | `FORBIDDEN`: the gas station isn't enabled on this deployment, or the source refuses the address. | [Error](#error) |
| `404` | No provider supports the route, or every provider failed (`NO_ROUTE`), or the avoid-lists (`excludeProviders` / `excludeBridges` / `excludeExchanges`) ruled out every route (`ROUTE_EXCLUDED`). When providers were asked, `error.details.errors` says why each one failed. | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/gas/quote" \
  -H "content-type: application/json" \
  -d '{"srcChain":"base","sender":"0x2a5b2A8d0E4e8Ff1e83C7cA4d0A4e3B7c0F1a234","destinations":[{"chain":"arbitrum","usd":2},{"chain":"optimism","usd":2},{"chain":"bsc","usd":2}]}'
```

### Track a refuel

`GET /v1/gas/status/{txHash}`

The deposit's outbound transfers, per destination chain. `status` is `pending`, `filled` (every destination confirmed), `refunded`, `failed` or `unknown` (not seen yet).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `txHash` | string | yes | The deposit transaction. (pattern `^0x[0-9a-fA-F]{64}$`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Refuel status. | [GasRefuelStatus](#gasrefuelstatus) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `403` | `FORBIDDEN`: the gas station isn't enabled on this deployment. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/gas/status/%7BtxHash%7D"
```

### Native balances on several chains

`GET /v1/gas/balances`

The address's native balance on each chain (up to 11), for watching a refuel land. A chain whose RPC didn't answer has `error: true`.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | EVM address. (pattern `^0x[0-9a-fA-F]{40}$`) |
| `chains` | string | yes | Comma-separated chain ids or slugs. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Balances. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `403` | `FORBIDDEN`: the gas station isn't enabled on this deployment. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/gas/balances?chains=arbitrum%2Coptimism"
```

## Safety

Community safety tools: explain a transaction or signature request before signing it (`POST /v1/preview`, read-only simulation) and community scam reports (wallet-signed, one per wallet and target, notes moderated). Reports are a signal shown as "community reports: N", never a verdict, and never block a swap.

### Screen addresses against sanctions lists

`POST /v1/screen`

Checks up to 100 addresses against the digital currency addresses of the US Treasury OFAC SDN list
(D-069). LayerHop downloads the public list once a day; `list` says which version is loaded (null
until the first download, and then every result is `sanctioned: false`). Matching is exact: EVM
addresses and bech32 ignore case, base58 (Solana, Tron, Bitcoin legacy) is case-sensitive. A list
lookup only: no clustering, no exposure or risk scoring, and not legal advice. Public; counts
against the normal rate limit.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | One result per address, in order. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/screen" \
  -H "content-type: application/json" \
  -d '{"addresses":["0x098B716B8Aaf21512996dC57EB0615e2383E2f96","0x1111111111111111111111111111111111111111"]}'
```

**Example response** (`200`)

```json
{
  "results": [
    {
      "address": "0x098B716B8Aaf21512996dC57EB0615e2383E2f96",
      "sanctioned": true,
      "lists": [
        "OFAC SDN"
      ],
      "source": "ofac_sdn",
      "listUpdatedAt": "2026-10-28T00:00:00.000Z"
    },
    {
      "address": "0x1111111111111111111111111111111111111111",
      "sanctioned": false,
      "lists": [],
      "source": "ofac_sdn",
      "listUpdatedAt": "2026-10-28T00:00:00.000Z"
    }
  ],
  "list": {
    "source": "ofac_sdn",
    "name": "OFAC SDN",
    "publishedAt": "2026-10-28T00:00:00.000Z",
    "fetchedAt": "2026-11-04T06:00:00.000Z",
    "addressCount": 1081
  },
  "enforced": false
}
```

### Explain a transaction or signature request

`POST /v1/preview`

"What will this transaction do?" Send what a dapp asked a wallet to sign and get, in plain
language, the balance changes, the permissions it grants, who gets what and red flags. Nothing
is ever signed or sent.

- `evm_tx` (`to`, `data`, `value`, `from`, `chain`): simulated against the latest block with
  `eth_simulateV1` (transfers of ERC-20, ERC-721, ERC-1155 and the native coin), else
  `debug_traceCall` (call tracer with logs), else a plain `eth_call` (succeeds or reverts);
  calldata is decoded either way: `approve`, `increaseAllowance`, `setApprovalForAll`,
  `transfer`, `transferFrom`, `safeTransferFrom`, EIP-2612 `permit`, Permit2 `approve` /
  `permit` / `transferFrom`, `multicall` and Multicall `aggregate`.
- `typed_data`: EIP-712 JSON (as an object or a string). Decoded, not simulated: EIP-2612 and
  DAI `Permit`, Permit2 `PermitSingle` / `PermitBatch` / `PermitTransferFrom` (witness and
  batch variants) and Seaport `OrderComponents` and `BulkOrder`. The chain comes from
  `domain.chainId` unless `chain` is given.
- `solana_tx`: a base64 serialized transaction (legacy or v0; lookup tables resolved).
  `simulateTransaction` with the accounts' state before and after: SOL (including the network
  fee) and token balance changes of `from` (default: the fee payer); for every signer, its
  changes (in `actions`), new token delegates, token accounts that would change owner and
  signer accounts assigned to another program.

`gives_away_assets` (danger): assets leave the wallet with nothing back to an address the call
doesn't name and LayerHop doesn't recognize; a Seaport order that pays the signer nothing, only
dust, mostly pays third parties or returns less of a token than it takes; on Solana, a signer
other than the fee payer that loses assets (without `from`), a token account handed over or a
signer account assigned to another program. `community_reports` counts only reports an admin
approved, on the preview's chain (caution; danger from 3).

Red flags (`flags[].code`): `approval_to_eoa`, `approval_to_unknown`, `unlimited_approval`,
`approve_all_nfts`, `permit_to_eoa`, `permit_to_unknown`, `long_permit`, `value_to_eoa`,
`unverified_contract` and `new_contract` (when the deployment has an Etherscan key),
`gives_away_assets`, `community_reports`, `simulation_failed`, `unknown_function`,
`wrong_chain`. Named spenders are the approval targets LayerHop's routes use and major DEX
routers. Results are cached for 30 seconds by a hash of the request; 20 previews per minute per
key or IP, within a budget shared by all clients; a preview answers within 25 seconds or fails
with `PROVIDER_ERROR`.

**Request body** — [PreviewRequest](#previewrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | What the transaction or signature does. | object |
| `400` | `INVALID_PARAMS` (malformed request, typed data that isn't EIP-712, a transaction that isn't a Solana transaction) or `UNSUPPORTED_CHAIN`. | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `500` | Unexpected server error (`INTERNAL`). | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/preview" \
  -H "content-type: application/json" \
  -d '{}'
```

**Example response** (`200`)

```json
{
  "preview": {
    "kind": "evm_tx",
    "chainId": 8453,
    "from": "0x1111111111111111111111111111111111111111",
    "summary": "Danger: lets 0x2222…2222 spend unlimited USDC from your wallet",
    "risk": "danger",
    "actions": [
      {
        "text": "Lets 0x2222…2222 spend unlimited USDC from your wallet",
        "method": "approve(address,uint256)"
      }
    ],
    "balanceChanges": [],
    "transfers": [],
    "approvals": [
      {
        "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
        "symbol": "USDC",
        "decimals": 6,
        "spender": "0x2222222222222222222222222222222222222222",
        "amount": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
        "unlimited": true,
        "via": "approve",
        "spenderIsContract": false
      }
    ],
    "flags": [
      {
        "code": "approval_to_eoa",
        "level": "danger",
        "message": "0x2222…2222 is a wallet, not an app's contract. Giving a wallet permission to move your USDC is how most drainers work."
      }
    ],
    "simulation": {
      "method": "eth_simulateV1",
      "ok": true,
      "gasUsed": "55906"
    },
    "community": [],
    "addresses": [
      {
        "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
        "role": "to",
        "label": "USDC",
        "isContract": true
      },
      {
        "address": "0x2222222222222222222222222222222222222222",
        "role": "spender",
        "isContract": false
      }
    ]
  }
}
```

### Community reports for several addresses

`GET /v1/reports`

Community scam reports for up to 25 addresses or tokens at once (any chain; EVM addresses are
matched case-insensitively). Each entry has the report `count`, the `categories`, the chains
reported on and the newest notes an admin approved. A target with no reports answers
`count: 0`. Show it as "Community reports: N", never as a verdict, and never block a swap on
it. Cached 30 seconds; 120 lookups per minute per key or IP.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `targets` | string | yes | Comma-separated EVM addresses or Solana base58 addresses (at most 25). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | One summary per distinct target, in request order. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/reports?targets=0x5ca1ab1e00000000000000000000000000000bad%2CDrain11111111111111111111111111111111111111"
```

### Report an address or token as a scam

`POST /v1/reports`

Files a community report, signed by the reporting wallet. The wallet signs the plain text
`buildReportMessage(fields)` from `@layerhop/shared` (EIP-191 `personal_sign` on EVM,
`signMessage` on Solana; free, moves no funds); the API rebuilds the message from the fields
sent here, so every field, the note included, is covered by the signature:

```text
LayerHop community report

I report this as a scam. Signing is free and does not move funds.

Reporter: <reporter>
Chain ID: <chain id>
Address: <target>            (Token: <target> for kind=token)
Category: <category>
Transaction: <txHash or ->
Note: <note with whitespace collapsed, or ->
Issued At: <issuedAt>
```

Rules: `issuedAt` within the last 10 minutes; one report per wallet and target (`CONFLICT`);
5 reports per wallet per hour and 20 per day, 20 per IP per hour (`RATE_LIMITED`); the wallet
needs some history: a LayerHop swap, or at least 3 transactions on the report's chain or
Ethereum (`FORBIDDEN`, also when no RPC can answer); Permit2, the routers and approval targets
LayerHop's routes use and listed tokens can't be reported (`INVALID_PARAMS`). Only approved
reports raise a transaction preview's risk. Counts update immediately;
the note is public only after an admin approves it. Needs the platform database (`NOT_FOUND`
without one).

**Request body** — [ReportRequest](#reportrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Filed; `reports` is the target's new summary. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | `UNAUTHORIZED`: the signature doesn't match the fields and the reporting wallet. | [Error](#error) |
| `403` | `FORBIDDEN`: the reporting wallet has no history (no LayerHop swap and fewer than 3 transactions). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/reports" \
  -H "content-type: application/json" \
  -d '{"vm":"evm","reporter":"0x1111111111111111111111111111111111111111","chain":8453,"target":"0x5ca1ab1e00000000000000000000000000000bad","kind":"address","category":"poisoning","txHash":"0x9f0c4b3e1d2a5c6b7a8f9e0d1c2b3a4f5e6d7c8b9a0f1e2d3c4b5a6f7e8d9c0b","note":"Sent me a zero-value transfer from a look-alike of my exchange deposit address","issuedAt":"2026-10-28T09:00:00.000Z","signature":"0x…"}'
```

### Community reports for one address

`GET /v1/reports/{target}`

The summary for one address or token (same shape as `GET /v1/reports`).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `target` | string | yes | EVM address (any case) or Solana base58 address. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The summary (`count: 0` when nobody reported it). | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/reports/0x5ca1ab1e00000000000000000000000000000bad"
```

**Example response** (`200`)

```json
{
  "reports": {
    "target": "0x5ca1ab1e00000000000000000000000000000bad",
    "count": 3,
    "categories": {
      "poisoning": 2,
      "phishing": 1
    },
    "chainIds": [
      1,
      8453
    ],
    "notes": [
      {
        "category": "poisoning",
        "note": "Zero-value transfer from a look-alike of my exchange address",
        "chainId": 8453,
        "createdAt": "2026-10-28T09:00:00.000Z"
      }
    ],
    "lastReportedAt": "2026-10-28T09:00:00.000Z"
  }
}
```

## Social

Copy trading and swap by reply (D-046): a public feed of swaps by wallets that opted in with a signed message, and the Farcaster bot's webhook. Every swap is still signed by the user in their own wallet; the bots only reply with links.

### Recent shared trades

`GET /v1/trade-feed`

Recent notable LayerHop swaps (worth at least `minUsd` at fill, both tokens listed, not tips,
split shares or payouts) by wallets that opted in with `POST /v1/trade-feed/opt-in`, newest
first, each with the `trader` address. Only swaps filled after the wallet's latest opt-in are
shown, and an opt-out removes them at once. No wallet that didn't opt in ever appears. Cached
30 seconds.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | (default `20`) (1–50) |
| `before` | string (date-time) | no | ISO 8601 time; only trades filled before it (paging). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Shared trades. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/trade-feed"
```

### Opt in to (or out of) the trade feed

`POST /v1/trade-feed/opt-in`

A wallet chooses whether its LayerHop swaps appear, with its address, in the public trade
feed. It signs the plain text `buildShareTradesMessage(fields)` from `@layerhop/shared`
(EIP-191 `personal_sign` on EVM, `signMessage` on Solana; free, moves no funds); the API
rebuilds the message from the fields sent here:

```text
LayerHop trade feed

Show my LayerHop swaps from now on, with my wallet address, in the public trade feed. Signing is free and does not move funds.
  (or: Stop showing my LayerHop swaps in the public trade feed. Signing is free and does not move funds.)

Wallet: <wallet>
Share trades: yes | no
Issued At: <issuedAt>
```

`issuedAt` must be within the last 10 minutes, and newer than the wallet's last recorded
choice (`CONFLICT` otherwise), so an old signature can't be replayed to undo a newer one.
20 requests per IP per hour. Needs the platform database (`NOT_FOUND` without one).

**Request body** — [ShareTradesRequest](#sharetradesrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The recorded choice. | [TradeSharing](#tradesharing) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | `UNAUTHORIZED`: the signature doesn't match the fields and the wallet. | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/trade-feed/opt-in" \
  -H "content-type: application/json" \
  -d '{"vm":"evm","wallet":"0x1111111111111111111111111111111111111111","enabled":true,"issuedAt":"2026-10-29T09:00:00.000Z","signature":"0x…"}'
```

### Whether a wallet shares its trades

`GET /v1/trade-feed/opt-in/{wallet}`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `wallet` | string | yes | EVM address (any case) or Solana base58 address. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The wallet's choice (`enabled: false` when it never opted in). | [TradeSharing](#tradesharing) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/trade-feed/opt-in/0x1111111111111111111111111111111111111111"
```

### Farcaster bot webhook (Neynar)

`POST /v1/social/farcaster/webhook`

Called by Neynar for casts that mention the LayerHop bot (`cast.created`). Not for direct
use. The body must be signed: `X-Neynar-Signature` is the HMAC-SHA512 (hex) of the raw body
with the webhook's secret (`UNAUTHORIZED` otherwise). A swap request such as
"@layerhop swap 10 USDC to SOL" gets a reply cast with a link to a prefilled swap page (a
Farcaster Mini App); an ambiguous one gets a question; anything else is ignored. Each cast is
answered once. `NOT_FOUND` unless the deployment configured the bot.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Acknowledged; `action` says what the bot did. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/social/farcaster/webhook" \
  -H "content-type: application/json" \
  -d '{}'
```

## Ecosystem

"Built on LayerHop" (layerhop.com/ecosystem): projects submit themselves; an admin reviews each submission before it is listed. Public, no key.

### Approved Built on LayerHop projects

`GET /v1/ecosystem`

Community submissions an admin approved, newest approval first. Cached 5 minutes.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Approved entries (the private contact is never included). | object |

**Example request**

```bash
curl "https://api.layerhop.com/v1/ecosystem"
```

### Submit a project

`POST /v1/ecosystem`

Creates a `pending` entry for review. `logoUrl` (optional) is downloaded once, here: https on
port 443, a public host (every address the name resolves to is checked when connecting), no
redirects, at most 512 KB, and it must be a PNG, JPEG, WebP or GIF by its bytes (SVG is
refused); the API serves its own copy. 5 submissions per IP per hour (counted after
validation). `contact` is private and only shown to the reviewer. Needs the platform database
(`NOT_FOUND` without one).

**Request body** — [EcosystemSubmission](#ecosystemsubmission) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Submitted for review. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/ecosystem" \
  -H "content-type: application/json" \
  -d '{"name":"Hop Wallet","tagline":"A wallet that swaps across chains with LayerHop","category":"wallet","uses":["sdk","widget"],"url":"https://hopwallet.example","logoUrl":"https://hopwallet.example/logo.png","twitter":"hopwallet","contact":"dev@hopwallet.example"}'
```

### An approved project's logo

`GET /v1/ecosystem/{id}/logo`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The stored image (served with `x-content-type-options: nosniff`). | — |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/ecosystem/eco_01jd8m3q0x9f2v7w5k3n1h4b6c/logo"
```

## Partner program

Apply to the LayerHop partner program (layerhop.com/partners): wallets, apps, bots and communities that want to send swaps through LayerHop. Public, no key. Self-serve partner profiles and fees live in the dashboard; this is the "talk to us" form.

### Apply to the partner program

`POST /v1/partner-program/applications`

Creates a `new` application for LayerHop to review. Text fields are one line of plain text
(`message` may span lines, no `<` or `>`), `url` must be https. 3 applications per IP per hour
(counted after validation). The same `url` and `contact` within 24 hours answers with the
existing application instead of creating another. `contact` is private and only shown to the
reviewer. Needs the platform database (`NOT_FOUND` without one).

**Request body** — [PartnerApplicationInput](#partnerapplicationinput) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Received. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/partner-program/applications" \
  -H "content-type: application/json" \
  -d '{"name":"Ada Lovelace","project":"Hop Wallet","url":"https://hopwallet.example","contact":"ada@hopwallet.example","kind":"wallet","integrations":["widget","sdk"],"expectedVolume":"100k_1m","message":"We have 20k monthly users on Base and Solana."}'
```

## Launch

LayerHop Launch (D-039): metadata and images LayerHop hosts for Solana tokens created on app.layerhop.com. The Create page uploads the token's name, symbol, links and image, then puts the returned `uri` in the token's on-chain metadata. Public, no key. Content LayerHop hosts, never market data; the operator can hide a token (takedown), which removes it from every route here. Without a database the read routes answer 404 / an empty list and uploads 404.

### List launch metadata

`GET /v1/launch/metadata`

The stored metadata of up to 100 mints, in the order asked, for listings. Unknown and hidden
mints are left out. Carries the image URL, not the bytes. Public, no key needed. Without a
database the list is empty.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mints` | string | yes | Comma-separated token addresses, 1 to 100: Solana mints (base58) or EVM token addresses (`0x…`, any case). Anything else is `INVALID_PARAMS`. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The known, visible mints. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/launch/metadata?mints=5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG"
```

**Example response** (`200`)

```json
{
  "data": [
    {
      "mint": "5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG",
      "chain": "solana",
      "creator": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
      "name": "Doge Hop",
      "symbol": "DHOP",
      "description": "The dog that hops chains.",
      "image": "https://api.layerhop.com/v1/launch/metadata/5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG/image",
      "website": "https://dogehop.example",
      "twitter": "https://x.com/dogehop",
      "telegram": "https://t.me/dogehop",
      "createdAt": "2026-10-25T12:00:00.000Z"
    }
  ]
}
```

### Upload launch metadata

`POST /v1/launch/metadata`

Stores a new token's metadata and image and returns the metadata `uri` to put on chain (the
Metaplex `uri` on Solana, the token's `tokenURI` on Robinhood Chain, Base and Arbitrum).
`chain` says where the token is created (default `solana`): `mint` and `creator` are base58
public keys on Solana and EVM addresses (`0x…`, stored lowercase) on the EVM chains. Public, no key needed; on top of the usual per-IP rate limit, at most 10 uploads per
IP (or key) per hour (`RATE_LIMITED`). Re-sending an upload identical to the stored one (same
`creator`, fields and image) returns 200 and does not count. A `creator` can have at most 5
pending uploads (mint not created on chain yet; `INVALID_PARAMS` after that); uploads whose
mint never appears on chain are deleted after 24 hours.

`multipart/form-data` with the text fields below and the image as a file part named `image`
(at most 1 MB; PNG, JPEG, WebP or GIF, detected from the file's bytes, otherwise
`LAUNCH_IMAGE_INVALID`). Empty optional fields count as absent.

Upload before the token is created: every upload, the first one included, needs the mint not to
exist on chain yet (Solana: the account exists; EVM: `eth_getCode` on that chain returns code).
A mint that already exists on chain is `INVALID_PARAMS` ("already exists on chain"), and so is
an upload when that check can't be answered (RPC error or timeout; try again).

One upload per mint: uploading again for the same `mint` replaces the metadata only when
`creator` and `chain` match and the mint is still not on chain; a different `creator` or
`chain` is `INVALID_PARAMS`. A token the operator hid stays hidden after a replace.

**Request body** — [LaunchMetadataUpload](#launchmetadataupload) (required, `multipart/form-data`)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Stored. | [LaunchMetadataUploaded](#launchmetadatauploaded) |
| `400` | Invalid upload: a field fails validation or the mint belongs to another creator (`INVALID_PARAMS`), or the image is missing, over 1 MB or not PNG/JPEG/WebP/GIF (`LAUNCH_IMAGE_INVALID`; a body far over the cap gets status 413). | [Error](#error) |
| `404` | The operator runs the API without a database, so platform routes are off (`NOT_FOUND`). | [Error](#error) |
| `413` | Invalid upload: a field fails validation or the mint belongs to another creator (`INVALID_PARAMS`), or the image is missing, over 1 MB or not PNG/JPEG/WebP/GIF (`LAUNCH_IMAGE_INVALID`; a body far over the cap gets status 413). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/launch/metadata" \
  -F "mint=5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG" \
  -F "chain=solana" \
  -F "creator=9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM" \
  -F "name=Doge Hop" \
  -F "symbol=DHOP" \
  -F "description=The dog that hops chains." \
  -F "website=https://dogehop.example" \
  -F "image=@logo.png"
```

**Example response** (`200`)

```json
{
  "mint": "5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG",
  "chain": "solana",
  "uri": "https://api.layerhop.com/v1/launch/metadata/5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG.json",
  "image": "https://api.layerhop.com/v1/launch/metadata/5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG/image"
}
```

### Featured and trending launches

`GET /v1/launch/spotlight`

Tokens launched on LayerHop that the app promotes: `featured` (pinned by a launch admin,
newest pin first) and `trending` (the most distinct wallets swapping the token through
LayerHop in the last 24 hours, at least 2, the creator's own swaps not counted). At most 6
each; hidden launches never appear. Promotion only: neither list is a safety check.
`Cache-Control: public, max-age=30`; the lists are cached for up to a minute. Public, no key
needed. Without a database both lists are empty.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The spotlight. | [LaunchSpotlight](#launchspotlight) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/launch/spotlight"
```

**Example response** (`200`)

```json
{
  "featured": [
    {
      "token": "5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG",
      "chain": "solana",
      "name": "Doge Hop",
      "symbol": "DHOP",
      "image": "https://api.layerhop.com/v1/launch/metadata/5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG/image",
      "createdAt": "2026-10-25T12:00:00.000Z",
      "featured": true
    }
  ],
  "trending": [
    {
      "token": "0x6b175474e89094c44da98b954eedeac495271d0f",
      "chain": "base",
      "name": "Hop Dog",
      "symbol": "HOP",
      "image": "https://api.layerhop.com/v1/launch/metadata/0x6b175474e89094c44da98b954eedeac495271d0f/image",
      "createdAt": "2026-11-02T08:30:00.000Z",
      "featured": false,
      "trades24h": 14,
      "traders24h": 9
    }
  ]
}
```

### Feature or hide a launch (launch admins)

`POST /v1/launch/curate`

A launch admin wallet features (pins), unfeatures, hides or unhides a token launched on
LayerHop. Launch admins are the API's `LAUNCH_ADMIN_WALLETS` (by default the Solana and EVM
launch partner wallets). The wallet signs the plain text `buildLaunchCurationMessage(fields)`
from `@layerhop/shared` (EIP-191 `personal_sign` on EVM, `signMessage` on Solana; free, moves
no funds); the API rebuilds it from the fields sent here:

```text
LayerHop launch admin

Change how a LayerHop launch is shown in the app. Signing is free and does not move funds.

Wallet: <wallet>
Token: <token>
Action: feature | unfeature | hide | unhide
Issued At: <issuedAt>
```

`wallet` is lowercase on EVM; `token` is the stored key (EVM lowercase). `issuedAt` must be
within the last 10 minutes and newer than the token's last signed change (`CONFLICT`
otherwise), so an old signature can't be replayed. A hidden token disappears from every
launch read route, the spotlight and Discord posts. Featuring says nothing about safety.
60 requests per IP per hour. Needs the platform database (`NOT_FOUND` without one).

**Request body** — [LaunchCurationRequest](#launchcurationrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The token's new state. | [LaunchCurationState](#launchcurationstate) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | `UNAUTHORIZED`: the signature doesn't match the fields and the wallet. | [Error](#error) |
| `403` | `FORBIDDEN`: the wallet isn't a launch admin. | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/launch/curate" \
  -H "content-type: application/json" \
  -d '{"vm":"svm","wallet":"DywbHGrZxEVDP2v6ztEMHDhXMoYsfFbNbeAoy7i9gG85","token":"5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG","action":"feature","issuedAt":"2026-11-03T09:00:00.000Z","signature":"base64 or base58 signature"}'
```

**Example response** (`200`)

```json
{
  "mint": "5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG",
  "hidden": false,
  "featured": true
}
```

### Get a token's metadata JSON

`GET /v1/launch/metadata/{mint}.json`

The token's metadata JSON (Metaplex shape, also used as an EVM `tokenURI`): the `uri` an upload
returned and the token carries on chain. EVM addresses are matched in any case.
`Cache-Control: public, max-age=300`. Unknown or hidden mints are `NOT_FOUND`. Public; outside
the usual rate limit (wallets, explorers and indexers fetch it), with a ceiling of 600 requests
per minute per IP (shared with the image route) before `RATE_LIMITED`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mint` | string | yes | The token's mint (Solana) or token address (EVM, any case). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Metaplex JSON. | [LaunchTokenJson](#launchtokenjson) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/launch/metadata/5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG.json"
```

**Example response** (`200`)

```json
{
  "name": "Doge Hop",
  "symbol": "DHOP",
  "description": "The dog that hops chains.",
  "image": "https://api.layerhop.com/v1/launch/metadata/5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG/image",
  "external_url": "https://dogehop.example",
  "extensions": {
    "website": "https://dogehop.example"
  },
  "createdOn": "https://app.layerhop.com"
}
```

### Get a token's image

`GET /v1/launch/metadata/{mint}/image`

The image bytes with their stored content type (`image/png`, `image/jpeg`, `image/webp` or
`image/gif`), `Cache-Control: public, max-age=86400` and `X-Content-Type-Options: nosniff`.
Unknown or hidden mints are `NOT_FOUND`. Public; outside the usual rate limit, with a ceiling
of 600 requests per minute per IP (shared with the JSON route) before `RATE_LIMITED`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mint` | string | yes | The token's mint (Solana) or token address (EVM, any case). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The image. | — |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/launch/metadata/5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG/image"
```

## Checkout

Pay with any token: a merchant creates a checkout session (an amount in USDC or USDT on one chain, paid to their address) and shares its hosted link. The payer pays with any token on any chain; LayerHop routes it so the merchant receives at least the amount due, verifies the delivery on the settlement chain, then marks the session `paid` and sends `checkout.session.completed`. Creating and managing sessions needs an API key; the payer-facing routes (`GET` a session, `POST …/quote`) do not. Paid sessions can be refunded (in full or in part) from the merchant's own wallet with `POST /v1/checkout/sessions/{id}/refunds`.

### List checkout sessions

`GET /v1/checkout/sessions`

Your account's sessions of the key's mode (live or test), newest first.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | [CheckoutStatus](#checkoutstatus) | no | Only sessions with this status. |
| `productId` | string | no | Only sessions started from this product. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–100, default 50. (1–100) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of sessions. | [CheckoutSessionList](#checkoutsessionlist) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/checkout/sessions"
```

[Try it in the API playground →](/playground?op=listCheckoutSessions)

### Create a checkout session

`POST /v1/checkout/sessions`

Creates a payment request for `amount` (base units) of a settlement stablecoin (USDC or USDT on
a supported chain), paid to `recipient`. Returns the session with its hosted `url`; send your
customer there. Needs an API key: an `lh_test_` key creates a test-mode session (`cs_test_…`)
that is paid through the sandbox.

**Request body** — [CheckoutSessionCreateRequest](#checkoutsessioncreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Session created. | [CheckoutSession](#checkoutsession) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/checkout/sessions" \
  -H "content-type: application/json" \
  -d '{"amount":"49000000","settleChain":"base","settleToken":"USDC","recipient":"0x2222222222222222222222222222222222222222","description":"Pro plan, 1 month","reference":"order_1042","successUrl":"https://shop.example.com/thanks"}'
```

[Try it in the API playground →](/playground?op=createCheckoutSession)

**Example response** (`201`)

```json
{
  "id": "cs_01k7t9m2c4x8q6r0v3b5n7p9d",
  "object": "checkout.session",
  "livemode": true,
  "status": "open",
  "amount": "49000000",
  "settlement": {
    "chainId": 8453,
    "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "symbol": "USDC",
    "decimals": 6
  },
  "recipient": "0x2222222222222222222222222222222222222222",
  "description": "Pro plan, 1 month",
  "url": "https://layerhop.com/pay/cs_01k7t9m2c4x8q6r0v3b5n7p9d",
  "successUrl": "https://shop.example.com/thanks",
  "expiresAt": "2026-10-18T11:00:00.000Z",
  "reference": "order_1042",
  "refundedAmount": "0",
  "createdAt": "2026-10-18T10:00:00.000Z",
  "updatedAt": "2026-10-18T10:00:00.000Z"
}
```

### Get a checkout session

`GET /v1/checkout/sessions/{id}`

Public: the hosted page and your own code can poll it. Without your API key the response omits
`reference` and `metadata`. An `open` session past `expiresAt` reads as `expired`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The session. | [CheckoutSession](#checkoutsession) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/checkout/sessions/cs_01k7t9m2c4x8q6r0v3b5n7p9d"
```

[Try it in the API playground →](/playground?op=getCheckoutSession)

### List products

`GET /v1/checkout/products`

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `active` | `"true"` \| `"false"` | no | `true` or `false` to filter. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–100, default 50. (1–100) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of products. | object |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/checkout/products"
```

[Try it in the API playground →](/playground?op=listCheckoutProducts)

### Create a product

`POST /v1/checkout/products`

A fixed price for payment buttons, `layerhop.com/buy/{id}` links and store plugins. The amount,
settlement token, payout address and redirect URLs live on the product, so anyone may start a
session from it (see `POST /v1/checkout/products/{id}/sessions`) without being able to change
the price. `allowedOrigins` (https origins, empty = any) limits which websites may start sessions
from a browser. The key's mode decides the product's mode.

**Request body** — [CheckoutProductCreateRequest](#checkoutproductcreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Product created. | [CheckoutProduct](#checkoutproduct) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/checkout/products" \
  -H "content-type: application/json" \
  -d '{"name":"Pro plan","description":"1 month","amount":"49000000","settleChain":"base","settleToken":"USDC","recipient":"0x2222222222222222222222222222222222222222","successUrl":"https://shop.example.com/thanks","allowedOrigins":["https://shop.example.com"]}'
```

[Try it in the API playground →](/playground?op=createCheckoutProduct)

### Get a product

`GET /v1/checkout/products/{id}`

Public (CORS open to any origin): name, price and settlement for a payment button. With the owner's key: every field.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Product id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The product. | [CheckoutProduct](#checkoutproduct) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/checkout/products/prod_01m57hq2c4x8q6r0v3b5n7p9d"
```

[Try it in the API playground →](/playground?op=getCheckoutProduct)

### Update a product

`PATCH /v1/checkout/products/{id}`

Change any field (the payout is re-validated). `active: false` stops new sessions. Existing sessions keep their terms.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Product id. |

**Request body** — [CheckoutProductCreateRequest](#checkoutproductcreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The updated product. | [CheckoutProduct](#checkoutproduct) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X PATCH "https://api.layerhop.com/v1/checkout/products/prod_01m57hq2c4x8q6r0v3b5n7p9d" \
  -H "content-type: application/json" \
  -d '{"active":false}'
```

[Try it in the API playground →](/playground?op=updateCheckoutProduct)

### Start a checkout for a product

`POST /v1/checkout/products/{id}/sessions`

Public, no key, CORS open to any origin (unless the product sets `allowedOrigins`; then other
browser origins get `FORBIDDEN`). Creates a checkout session with the product's amount, token,
payout address and URLs; the caller may only add `reference` and `metadata`. Inactive products
return `CONFLICT`. Send the payer to the returned `url`, or open it with the embedded checkout.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Product id. |

**Request body** — object

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | The new session. | [CheckoutSession](#checkoutsession) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/checkout/products/prod_01m57hq2c4x8q6r0v3b5n7p9d/sessions" \
  -H "content-type: application/json" \
  -d '{"reference":"order_1042"}'
```

[Try it in the API playground →](/playground?op=startProductCheckout)

### Stream a checkout session

`GET /v1/checkout/sessions/{id}/events`

Server-Sent Events: `ready`, then a `session` event (`CheckoutSession`, payer view) now and on
every change until the session is `paid`, `expired` or `needs_review`. Same limits as the order
stream.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | An event stream (`event: session`). | — |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/checkout/sessions/cs_01k7t9m2c4x8q6r0v3b5n7p9d/events"
```

### Expire a checkout session

`POST /v1/checkout/sessions/{id}/expire`

Cancels an `open` session so it can no longer be paid (`CONFLICT` for any other status).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The expired session. | [CheckoutSession](#checkoutsession) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/checkout/sessions/cs_01k7t9m2c4x8q6r0v3b5n7p9d/expire"
```

[Try it in the API playground →](/playground?op=expireCheckoutSession)

### Quote a payment for a session

`POST /v1/checkout/sessions/{id}/quote`

Public (the payer's side). Prices paying the session with `srcToken` on `srcChain` from
`sender`. Every quote delivers at least the amount due to the session's recipient (set by the
session, never by the payer) and overpays by at most about 3%. Paying in the settlement token
on the settlement chain is a direct transfer (`provider: direct`): the recipient gets exactly
the amount due, and LayerHop's same-token fee (0.25% of the amount due by default, `fees.ourFeeBps: 25`) is
a second transfer on top, so `srcAmount` is the amount due plus the fee. On Solana both
transfers are in one transaction; on EVM chains the fee transfer is in the built transaction's
`extraTxs`. Then build
the transaction with `POST /v1/orders` and report it with `POST /v1/orders/{quoteId}/submitted`;
the session moves to `processing`.

Tron (D-048, where the API runs with Tron enabled): the payer may pay from Tron (`srcChain: tron`,
e.g. `srcToken: USDT`, `sender` a T-address). `POST /v1/orders` then returns a `TronTx`; report
the hash of its main call (the deposit, not the approval). The settlement chain can't be Tron.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Request body** — [CheckoutQuoteRequest](#checkoutquoterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Quotes, best first. | [CheckoutQuoteResponse](#checkoutquoteresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `422` | No provider supports the route, or every provider failed (`NO_ROUTE`), or the avoid-lists (`excludeProviders` / `excludeBridges` / `excludeExchanges`) ruled out every route (`ROUTE_EXCLUDED`). When providers were asked, `error.details.errors` says why each one failed. | [Error](#error) |
| `451` | `ADDRESS_SANCTIONED` (HTTP 451): an address of the request is on the OFAC SDN list and screening is enforced (operator `SCREENING_ENFORCE=1`, or the account opted in). `error.details.sanctioned` lists the addresses and their role (D-069). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/checkout/sessions/cs_01k7t9m2c4x8q6r0v3b5n7p9d/quote" \
  -H "content-type: application/json" \
  -d '{"srcChain":"arbitrum","srcToken":"ETH","sender":"0x1111111111111111111111111111111111111111"}'
```

[Try it in the API playground →](/playground?op=quoteCheckoutSession)

### Show a "Send to address" payment QR

`POST /v1/checkout/sessions/{id}/transfer`

Public (the payer's side, D-064). Puts an `open` live session in scan-to-pay mode and returns
the session with its `transfer` object; calling it again returns the same one. The payer then
pays without connecting a wallet to the page; the worker finds the payment on chain and the
session becomes `paid` (with the usual `checkout.session.completed` webhook). Funds go straight
to the session's recipient; LayerHop never holds them.

- **Solana** (`kind: solana_pay`): `uri` is a Solana Pay transaction request
  (`solana:https://api.layerhop.com/v1/checkout/sessions/{id}/solana-pay`). The wallet gets one
  transaction with the merchant transfer, LayerHop's same-token fee on top (as for a connected
  wallet) and the session's `reference` key, which the worker looks up.
- **EVM deposit address** (`kind: evm_splitter`, D-065, on chains where the operator deployed
  the fee-splitting deposit contract): send exactly `amount` of `token` to `address`, the
  session's own deposit address (`uri` is the EIP-681 request). `amount` is the amount due plus
  LayerHop's same-token fee (`fee.bps` of `amount`), sized so the merchant nets at least the
  amount due; the contract (`CheckoutSplitterFactory`) pays the merchant and the fee and can
  send funds nowhere else. A short payment leaves the session `open` and `amount` becomes the
  rest; `sweepTxHash` is the transaction that paid the deposit out to the merchant.
- **EVM** (`kind: evm_transfer`, only where the operator enabled it with `CHECKOUT_TRANSFER_LIVE`
  and no deposit contract is configured):
  send exactly `amount` of `token` to `address` on `chainId` (`uri` is the EIP-681 request). The
  amount is the amount due plus at most 0.0099 token: its sub-cent digits are a tag that
  identifies the session. A short payment (for example an exchange withdrawal fee taken from
  it) leaves the session `open` with `statusDetail` "received X of Y; send the remaining Z" and
  `amount` becomes the tagged rest; an overpayment is `paid` with an "overpaid by" note.

`FORBIDDEN` when the session can't be paid this way (test mode, or EVM while disabled);
check `transferAvailable` on the session first.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The session with its `transfer` object. | [CheckoutSession](#checkoutsession) |
| `403` | Not allowed (`FORBIDDEN`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/checkout/sessions/cs_01k7t9m2c4x8q6r0v3b5n7p9d/transfer"
```

[Try it in the API playground →](/playground?op=startCheckoutTransfer)

### Solana Pay transaction request (label)

`GET /v1/checkout/sessions/{id}/solana-pay`

Step 1 of the Solana Pay transaction request a wallet makes after scanning the session's `transfer.uri`. Open to any origin.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Label and icon for the wallet. | object |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/checkout/sessions/cs_01k7t9m2c4x8q6r0v3b5n7p9d/solana-pay"
```

[Try it in the API playground →](/playground?op=solanaPayCheckoutLabel)

**Example response** (`200`)

```json
{
  "label": "Acme",
  "icon": "https://layerhop.com/icon.svg"
}
```

### Solana Pay transaction request (transaction)

`POST /v1/checkout/sessions/{id}/solana-pay`

Step 2: the wallet posts its `account` and gets an unsigned transaction to sign and send: the
merchant transfer (with the session's reference key) and LayerHop's same-token fee transfer,
atomically. Open to any origin.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The transaction (base64) and a message for the wallet. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/checkout/sessions/cs_01k7t9m2c4x8q6r0v3b5n7p9d/solana-pay" \
  -H "content-type: application/json" \
  -d '{"account":"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"}'
```

[Try it in the API playground →](/playground?op=solanaPayCheckoutTransaction)

**Example response** (`200`)

```json
{
  "transaction": "AQAAAA…",
  "message": "Pay 50 USDC to Acme"
}
```

### List a session's refunds

`GET /v1/checkout/sessions/{id}/refunds`

Every refund of one of your sessions, newest first.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The refunds. | [RefundList](#refundlist) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/checkout/sessions/cs_01k7t9m2c4x8q6r0v3b5n7p9d/refunds"
```

[Try it in the API playground →](/playground?op=listCheckoutRefunds)

### Refund a paid session

`POST /v1/checkout/sessions/{id}/refunds`

Starts a full or partial refund of a `paid` session. Non-custodial: LayerHop never holds the
money, so you send the refund from your own wallet (`from`, default the session's payout
address). By default it is routed from the settlement token back to the payer's original chain
and token (`to: original`); `to: settlement` sends the settlement token to the payer's address on
the settlement chain (same chain family only). The response carries a `quote`: build its
transaction with `POST /v1/orders { quoteId }`, sign it from `quote.from`, then report it with
`POST /v1/orders/{quoteId}/submitted`. When the transfer lands the refund is `completed`, the
session's `refundedAmount` grows and `checkout.session.refunded` is sent. LayerHop takes no fee
on refunds. Test-mode sessions refund through the sandbox.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Request body** — [RefundCreateRequest](#refundcreaterequest)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Refund created (`pending` until you report its transaction). | [RefundCreateResponse](#refundcreateresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/checkout/sessions/cs_01k7t9m2c4x8q6r0v3b5n7p9d/refunds" \
  -H "content-type: application/json" \
  -d '{"amount":"20000000","reason":"Partial refund: one seat cancelled"}'
```

[Try it in the API playground →](/playground?op=createCheckoutRefund)

**Example response** (`201`)

```json
{
  "refund": {
    "id": "re_01k7v2a8c4x8q6r0v3b5n7p9d",
    "object": "refund",
    "sessionId": "cs_01k7t9m2c4x8q6r0v3b5n7p9d",
    "livemode": true,
    "status": "pending",
    "amount": "20000000",
    "reason": "Partial refund: one seat cancelled",
    "quoteId": "q_01k7v2a8d1y3m5p7r9t1v3x5z",
    "to": {
      "chainId": 42161,
      "token": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "address": "0x1111111111111111111111111111111111111111"
    },
    "createdAt": "2026-10-18T12:00:00.000Z",
    "updatedAt": "2026-10-18T12:00:00.000Z"
  },
  "quote": {
    "quoteId": "q_01k7v2a8d1y3m5p7r9t1v3x5z",
    "provider": "relay",
    "srcAmount": "20000000",
    "dstAmount": "19968000",
    "dstAmountMin": "19768320",
    "estimatedSeconds": 12,
    "expiresAt": 1792324830,
    "from": "0x2222222222222222222222222222222222222222"
  },
  "next": "Build the transaction with POST /v1/orders { quoteId }, sign it from the `from` wallet, then report it with POST /v1/orders/{quoteId}/submitted."
}
```

### Show a "Pay with Bitcoin" deposit address

`POST /v1/checkout/sessions/{id}/bitcoin`

Public (the payer's side, D-067; only where the operator enabled Bitcoin checkout, check
`bitcoinAvailable` on the session first). Returns the session with its `bitcoin` object: a
Bitcoin deposit address (`address`), the exact amount to send (`amountSats` / `amountBtc`) and a
BIP21 `uri` for the QR. The address is a Relay deposit address bound to this payment: Relay
converts the BTC and delivers exactly the amount due of the settlement token to the merchant;
LayerHop never holds funds. The fee is the API channel fee, taken by Relay from the BTC amount.

The BTC price holds until `expiresAt`; calling this again returns the same quote until then (or
while a payment is on its way) and a fresh one afterwards. Every address shown stays watched: a
late payment to an older address still fills. Less than `amountSats` is refunded by Relay to
`refundAddress` (or the sending address); more fills the amount due and the excess is refunded.
The session becomes `paid` (with `checkout.session.completed`) once the fill is verified on the
settlement chain. `FORBIDDEN` when Bitcoin checkout is off, for test-mode sessions and for
sessions settling on Solana.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Request body** — object

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The session with its `bitcoin` object. | [CheckoutSession](#checkoutsession) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `403` | Not allowed (`FORBIDDEN`). | [Error](#error) |
| `404` | No provider supports the route, or every provider failed (`NO_ROUTE`), or the avoid-lists (`excludeProviders` / `excludeBridges` / `excludeExchanges`) ruled out every route (`ROUTE_EXCLUDED`). When providers were asked, `error.details.errors` says why each one failed. | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/checkout/sessions/cs_01k7t9m2c4x8q6r0v3b5n7p9d/bitcoin" \
  -H "content-type: application/json" \
  -d '{"refundAddress":"bc1q4vxn43l44h30nkluqfxd9eckf45vr2awz38lwa"}'
```

[Try it in the API playground →](/playground?op=startCheckoutBitcoin)

## Invoices

Bill a customer by email: line items in a settlement stablecoin, a hosted invoice page (`https://layerhop.com/invoice/{id}`) where they pay with any token on any chain, an emailed receipt and a PDF. Managing invoices needs an API key; the customer-facing routes (`…/public`, `…/pay`, `…/receipt.pdf`) do not.

### List invoices

`GET /v1/invoices`

Your account's invoices of the key's mode (live or test), newest first.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | [InvoiceStatus](#invoicestatus) | no | Only invoices with this status. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–100, default 50. (1–100) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of invoices. | [InvoiceList](#invoicelist) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/invoices"
```

[Try it in the API playground →](/playground?op=listInvoices)

### Create an invoice

`POST /v1/invoices`

Bills a customer for line items in a settlement stablecoin (USDC or USDT on a supported chain),
paid to `recipient`. The invoice starts as a `draft` with the next number of the key's mode
(`INV-0001`, …); pass `send: true` to finalize and email it at once. The total `amount` is the
sum of `quantity × unitAmount`. An `lh_test_` key creates a test-mode invoice (`inv_test_…`).

**Request body** — [InvoiceCreateRequest](#invoicecreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Invoice created. | [Invoice](#invoice) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/invoices" \
  -H "content-type: application/json" \
  -d '{"customerEmail":"ap@acme.example","customerName":"Acme Corp","merchantName":"Studio Nine","lineItems":[{"description":"Design retainer, October","quantity":1,"unitAmount":"1500000000"},{"description":"Extra revision","quantity":2,"unitAmount":"100000000"}],"settleChain":"base","settleToken":"USDC","recipient":"0x2222222222222222222222222222222222222222","dueAt":"2026-11-01","memo":"Thank you!","send":true}'
```

[Try it in the API playground →](/playground?op=createInvoice)

**Example response** (`201`)

```json
{
  "id": "inv_01k7v0c2c4x8q6r0v3b5n7p9d",
  "object": "invoice",
  "livemode": true,
  "number": "INV-0001",
  "status": "open",
  "merchantName": "Studio Nine",
  "customerName": "Acme Corp",
  "customerEmail": "ap@acme.example",
  "memo": "Thank you!",
  "lineItems": [
    {
      "description": "Design retainer, October",
      "quantity": 1,
      "unitAmount": "1500000000"
    },
    {
      "description": "Extra revision",
      "quantity": 2,
      "unitAmount": "100000000"
    }
  ],
  "amount": "1700000000",
  "settlement": {
    "chainId": 8453,
    "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "symbol": "USDC",
    "decimals": 6
  },
  "recipient": "0x2222222222222222222222222222222222222222",
  "dueAt": "2026-11-01T23:59:59.000Z",
  "url": "https://layerhop.com/invoice/inv_01k7v0c2c4x8q6r0v3b5n7p9d",
  "sentAt": "2026-10-18T10:00:00.000Z",
  "createdAt": "2026-10-18T10:00:00.000Z",
  "updatedAt": "2026-10-18T10:00:00.000Z"
}
```

### Get an invoice

`GET /v1/invoices/{id}`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Invoice id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The invoice. | [Invoice](#invoice) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/invoices/inv_01k7v0c2c4x8q6r0v3b5n7p9d"
```

[Try it in the API playground →](/playground?op=getInvoice)

### Update a draft invoice

`PATCH /v1/invoices/{id}`

Change any field of a `draft` (other statuses return `CONFLICT`). The total and the payout are re-validated; `null` clears an optional field.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Invoice id. |

**Request body** — [InvoiceUpdateRequest](#invoiceupdaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The updated invoice. | [Invoice](#invoice) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X PATCH "https://api.layerhop.com/v1/invoices/inv_01k7v0c2c4x8q6r0v3b5n7p9d" \
  -H "content-type: application/json" \
  -d '{"dueAt":"2026-11-15","memo":"Net 30"}'
```

[Try it in the API playground →](/playground?op=updateInvoice)

### Send an invoice

`POST /v1/invoices/{id}/send`

Finalizes a `draft` (it becomes `open` and can no longer be edited) and emails it to
`customerEmail` from billing@layerhop.com with a link to the hosted page
`https://layerhop.com/invoice/{id}`. Sending an `open` invoice again re-sends the email. Sends
`invoice.sent`. Paid and void invoices return `CONFLICT`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Invoice id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The open invoice. | [Invoice](#invoice) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/invoices/inv_01k7v0c2c4x8q6r0v3b5n7p9d/send"
```

[Try it in the API playground →](/playground?op=sendInvoice)

### Void an invoice

`POST /v1/invoices/{id}/void`

Cancels a `draft` or `open` invoice for good; an open checkout session paying it is expired. Paid and void invoices return `CONFLICT`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Invoice id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The void invoice. | [Invoice](#invoice) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/invoices/inv_01k7v0c2c4x8q6r0v3b5n7p9d/void"
```

[Try it in the API playground →](/playground?op=voidInvoice)

### Get the customer's view of an invoice

`GET /v1/invoices/{id}/public`

Public, no key: what the hosted invoice page shows. Drafts return `NOT_FOUND`. Omits the customer email, the payout address and the session.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Invoice id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The invoice. | [PublicInvoice](#publicinvoice) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/invoices/inv_01k7v0c2c4x8q6r0v3b5n7p9d/public"
```

[Try it in the API playground →](/playground?op=getPublicInvoice)

### Start paying an invoice

`POST /v1/invoices/{id}/pay`

Public, no key: returns the checkout session that pays this invoice. A session that is still
open (with more than 5 minutes left) or already processing is reused (200); otherwise a new
one is created (201). Send the customer to `url`; when it is paid the invoice becomes `paid`,
the receipt is emailed and `invoice.paid` is sent. Paid and void invoices return `CONFLICT`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Invoice id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The existing session. | [InvoicePayResponse](#invoicepayresponse) |
| `201` | A new session. | [InvoicePayResponse](#invoicepayresponse) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/invoices/inv_01k7v0c2c4x8q6r0v3b5n7p9d/pay"
```

[Try it in the API playground →](/playground?op=payInvoice)

### Download a receipt

`GET /v1/invoices/{id}/receipt.pdf`

Public, no key: a one-page PDF receipt of a `paid` invoice (the `receiptUrl` of the invoice). Unpaid invoices return `NOT_FOUND`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Invoice id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The receipt. | — |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/invoices/inv_01k7v0c2c4x8q6r0v3b5n7p9d/receipt.pdf"
```

## Limit orders

Limit orders (beta): sell a token once it reaches your price, with an optional expiry. On Solana through Jupiter Trigger (on-chain order, partial fills); on EVM chains (Ethereum, Arbitrum, Base, BNB Chain, Polygon, Avalanche, Gnosis, Linea, Plasma, Ink) through CoW Protocol (a signed off-chain order, no gas to place or cancel; live once the operator enables it). The wallet signs every step; LayerHop never holds funds. Each fill becomes an order (`quoteId` starting with `lof_`, `limitOrderId` set) and sends `limit_order.filled`. For recurring buys see Recurring orders.

### List limit orders

`GET /v1/limit-orders`

Orders of `wallet` (any caller, like `GET /v1/orders?address=`), or without `wallet` the orders
of your API key's account. Only orders of the caller's mode (live, or test with an `lh_test_`
key), newest first.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `wallet` | string | no | The maker wallet (base58, or a 0x address in any case). Required without an API key. |
| `status` | [LimitOrderStatus](#limitorderstatus) | no | Only orders with this status. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–200, default 50. (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of limit orders. | [LimitOrderList](#limitorderlist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/limit-orders"
```

[Try it in the API playground →](/playground?op=listLimitOrders)

### Create a limit order

`POST /v1/limit-orders`

Builds a limit order: sell `amount` of `srcToken` for at least `dstAmount` of `dstToken` (the
limit price is `dstAmount / amount`), optionally until `expiresAt`. Nothing is placed until you
call `POST /v1/limit-orders/{id}/submit`. The fee is the channel fee plus your partner fee
(`integrator`, `integratorFeeBps`, resolved as for `GET /v1/quote`), charged on every fill.
Orders must be worth at least $5. An API key is optional (orders are attributed to its account);
an `lh_test_` key creates a test-mode order (provider `sandbox`). Uses the strict rate-limit bucket.

**Solana** (`chain` omitted or `solana`, Jupiter Trigger): returns an unsigned transaction
(`tx.submitViaApi: true`) for `wallet` to sign and submit as `signedTransaction`. Orders may fill
in several parts. The fee is written into the on-chain order and charged in `dstToken`; it
applies when `dstToken` is SOL, USDC or USDT (other output tokens: no fee, `fees` reports 0).

**EVM** (`chain` = a CoW Protocol chain, `provider: cow`): returns `tx: null`, the EIP-712
`typedData` of the order, its `appData` and an `approval` (exact amount, spender = CoW's vault
relayer). Check the typed data (receiver = `wallet`, tokens and amounts as requested, `appData`
= LayerHop's), make sure the wallet's allowance for `approval.spender` covers this order plus
its other open orders of the same token, then have `wallet` sign `typedData` with
`eth_signTypedData_v4` and submit the `signature`. `srcToken` must be an ERC-20 (wrap the
native coin first); `dstToken` may be the native coin. The fee is a CoW partner fee in the
order's `appData` (at most 100 bps in total), paid to LayerHop by CoW Protocol. Orders fill
whole (no partial fills) and always expire: `expiresAt` defaults to 90 days and may be at most
365 days ahead. Live creation answers `FORBIDDEN` until the operator enables EVM limit orders;
test mode always works. Smart-contract wallets are not supported yet.

**Request body** — [LimitOrderCreateRequest](#limitordercreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Order built; sign `tx` (Solana) or `typedData` (EVM) with `wallet` and submit it. | [LimitOrderCreated](#limitordercreated) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `403` | `FORBIDDEN`: live limit orders are not enabled on this chain family yet (use a test key). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/limit-orders" \
  -H "content-type: application/json" \
  -d '{}'
```

[Try it in the API playground →](/playground?op=createLimitOrder)

**Example response** (`201`)

```json
{
  "id": "lo_01k7x2m4c4x8q6r0v3b5n7p9d",
  "object": "limit_order",
  "livemode": true,
  "status": "built",
  "provider": "jupiter",
  "chainId": 7565164,
  "wallet": "5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9",
  "srcToken": "So11111111111111111111111111111111111111112",
  "dstToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "amount": "1000000000",
  "dstAmount": "250000000",
  "expiresAt": "2026-10-20T00:00:00.000Z",
  "fees": {
    "ourFeeBps": 10,
    "integratorFeeBps": 0
  },
  "providerOrderId": "hU7b1KJtdhUazueSB85CYFdt8osnpAQYmvNGde7U3Ut",
  "filledAmount": "0",
  "filledDstAmount": "0",
  "fillCount": 0,
  "channel": "api",
  "createdAt": "2026-10-19T10:00:00.000Z",
  "updatedAt": "2026-10-19T10:00:00.000Z",
  "tx": {
    "vm": "svm",
    "serializedTx": "AQAAAAAAAAAA…",
    "submitViaApi": true
  }
}
```

### Get a limit order

`GET /v1/limit-orders/{id}`

The order and its fills (each one an order whose `quoteId` starts with `lof_`), newest first.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Limit order id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The limit order. | [LimitOrderWithFills](#limitorderwithfills) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/limit-orders/lo_01k7x2m4c4x8q6r0v3b5n7p9d"
```

[Try it in the API playground →](/playground?op=getLimitOrder)

### Submit a signed limit order or cancellation

`POST /v1/limit-orders/{id}/submit`

Sends the wallet's signature of whatever was built last (the order, or its cancellation) to the
provider. Solana: `signedTransaction`, the signed transaction, which the provider lands. EVM:
`signature`, the 65-byte `eth_signTypedData_v4` signature of `typedData`; it must recover to the
order's wallet for exactly the order (or cancellation) built, else `LIMIT_ORDER_REJECTED` and
nothing is sent. Creating: the order becomes `open` and `limit_order.opened` is sent (EVM:
`txHash` is null, the order is off chain until a solver fills it). Cancelling: Solana sets
`cancelTxHash`; EVM sets `statusDetail: "cancel requested"` (an off-chain cancellation, no gas).
The order becomes `cancelled` (with any fills recorded first) once the provider confirms, usually
within seconds; an EVM order already being settled can still fill. `CONFLICT` when there is
nothing to submit.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Limit order id. |

**Request body** — [LimitOrderSubmitRequest](#limitordersubmitrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Landed (Solana) or accepted by the order book (EVM). | [LimitOrderSubmitResponse](#limitordersubmitresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `422` | `LIMIT_ORDER_REJECTED`: the signature is not the wallet's for this order, or CoW Protocol refused the order (for example the allowance to its vault relayer is too low). Nothing was placed. | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/limit-orders/lo_01k7x2m4c4x8q6r0v3b5n7p9d/submit" \
  -H "content-type: application/json" \
  -d '{}'
```

[Try it in the API playground →](/playground?op=submitLimitOrder)

### Cancel a limit order

`POST /v1/limit-orders/{id}/cancel`

An `open` Solana order returns an unsigned cancel transaction (`tx`) for the order's wallet: sign
it and send it to `POST /v1/limit-orders/{id}/submit`; the unfilled input goes back to the wallet.
An `open` EVM order returns `tx: null` and the `typedData` of an off-chain cancellation
(`OrderCancellations` for exactly this order): sign it and submit the `signature` (no gas; the
tokens never left the wallet). A `built` order (never submitted) is cancelled at once and `tx` is
null. Other statuses, or a cancellation already sent, return `CONFLICT`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Limit order id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Cancel transaction built (or the order cancelled). | [LimitOrderCancelResponse](#limitordercancelresponse) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/limit-orders/lo_01k7x2m4c4x8q6r0v3b5n7p9d/cancel"
```

[Try it in the API playground →](/playground?op=cancelLimitOrder)

### Simulate a fill or expiry (test mode)

`POST /v1/limit-orders/{id}/simulate`

Test-mode orders only (live orders return `FORBIDDEN`). The order must be `open`. Within a few
seconds the worker applies `outcome`: `fill` fills the rest, `partial_fill` fills half of the
rest (the order stays `open`), `expire` expires it, with the usual `limit_order.*` webhooks and a
fill order for each fill.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Limit order id. |

**Request body** — [LimitOrderSimulateRequest](#limitordersimulaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `202` | Outcome scheduled. | [LimitOrder](#limitorder) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | `FORBIDDEN`: a live order; simulate works in test mode only. | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/limit-orders/lo_01k7x2m4c4x8q6r0v3b5n7p9d/simulate" \
  -H "content-type: application/json" \
  -d '{"outcome":"fill"}'
```

[Try it in the API playground →](/playground?op=simulateLimitOrder)

## Recurring orders

Solana recurring buys through Jupiter Recurring (beta): deposit a budget once and Jupiter buys a token with it at a fixed interval (every day, every week, …). The order lives on chain in Jupiter's program and the wallet signs every step; LayerHop never holds funds and stores nothing. Jupiter lets integrators charge no fee on these orders, so LayerHop takes none (Jupiter keeps 0.1% of each buy). Cancel any time to get the unspent budget back.

### List recurring orders

`GET /v1/recurring-orders`

A wallet's recurring orders, read live from Jupiter: `active` (default) or `history` (completed
and cancelled), 10 per page. Test-mode callers get an empty list.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `wallet` | string | yes | The wallet that owns the orders. |
| `status` | `"active"` \| `"history"` | no | `active` (default) or `history`. |
| `page` | integer | no | Page number, from 1. (1–100) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of recurring orders. | [RecurringOrderList](#recurringorderlist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/recurring-orders"
```

### Build a recurring order

`POST /v1/recurring-orders`

Builds a Solana recurring order (Jupiter Recurring, time-based): `amount` of `srcToken` (default
USDC) is deposited when the wallet signs, then spent in `orders` equal buys of `dstToken`, one
every `intervalSeconds`, starting right away. Returns an unsigned transaction
(`tx.submitViaApi: true`) and a `requestId`: the `wallet` signs it and you send both to
`POST /v1/recurring-orders/submit`. Nothing is on chain until then. Jupiter's limits: at least 2
orders and each order worth at least $50 (`AMOUNT_TOO_SMALL` otherwise). No LayerHop fee
(`fees` is always 0). The transaction is checked before it is returned: it must open exactly
this order for this wallet. Live mode needs the operator to enable recurring orders
(`FORBIDDEN` until then); an `lh_test_` key builds a test-mode order (provider `sandbox`, a fake
transaction). Uses the strict rate-limit bucket.

**Request body** — [RecurringOrderCreateRequest](#recurringordercreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Order built; sign `tx` with `wallet` and submit it with `requestId`. | [RecurringOrderBuild](#recurringorderbuild) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `403` | `FORBIDDEN`: live recurring orders are not enabled on this deployment yet (test keys always work). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/recurring-orders" \
  -H "content-type: application/json" \
  -d '{"wallet":"5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9","srcToken":"USDC","dstToken":"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263","amount":"350000000","orders":7,"intervalSeconds":86400}'
```

**Example response** (`201`)

```json
{
  "object": "recurring_order_build",
  "livemode": true,
  "provider": "jupiter",
  "chainId": 7565164,
  "wallet": "5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9",
  "srcToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "dstToken": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
  "amount": "350000000",
  "amountPerOrder": "50000000",
  "orders": 7,
  "intervalSeconds": 86400,
  "fees": {
    "ourFeeBps": 0,
    "integratorFeeBps": 0
  },
  "requestId": "96974c32-7b0d-468d-b3db-55feb898a430",
  "tx": {
    "vm": "svm",
    "serializedTx": "AQAAAAAAAAAA…",
    "submitViaApi": true
  }
}
```

### Submit a signed recurring order transaction

`POST /v1/recurring-orders/submit`

Sends a wallet-signed create or cancel transaction with the `requestId` it was built with to
Jupiter, which lands it. Returns the signature and, for a create, the order account. Uses the
strict rate-limit bucket.

**Request body** — [RecurringOrderSubmitRequest](#recurringordersubmitrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Landed. | [RecurringOrderSubmitResponse](#recurringordersubmitresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/recurring-orders/submit" \
  -H "content-type: application/json" \
  -d '{"requestId":"96974c32-7b0d-468d-b3db-55feb898a430","signedTransaction":"AQAB…"}'
```

### Cancel a recurring order

`POST /v1/recurring-orders/{id}/cancel`

Builds the cancel transaction for an active order (`id` is the order account from
`GET /v1/recurring-orders`). The `wallet` signs it and you send it with `requestId` to
`POST /v1/recurring-orders/submit`; the unspent budget (and any bought tokens not sent yet) goes
back to the wallet. Works whether or not live creation is enabled.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | The order account. |

**Request body** — [RecurringOrderCancelRequest](#recurringordercancelrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Cancel transaction built. | [RecurringOrderCancelResponse](#recurringordercancelresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/recurring-orders/G1wnaWMJ7VTRnryBHvxNwWmwUDD5yUNBmLvZkRK1mPcT/cancel" \
  -H "content-type: application/json" \
  -d '{"wallet":"5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9"}'
```

## Subscriptions

Recurring billing in crypto. A wallet can't be charged automatically, so each period LayerHop issues an invoice for the subscription and emails its pay link; the customer pays it with any token on any chain. Unpaid past its due date the subscription becomes `past_due`, the customer gets reminders 1 and 3 days after the due date, and after 7 days it is canceled. Managing subscriptions needs an API key; an `lh_test_` key creates test-mode subscriptions whose invoices are paid in the sandbox.

### List subscriptions

`GET /v1/subscriptions`

Your account's subscriptions of the key's mode (live or test), newest first.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | [SubscriptionStatus](#subscriptionstatus) | no | Only subscriptions with this status. |
| `customerEmail` | string | no | Only this customer's subscriptions. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–100, default 50. (1–100) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of subscriptions. | [SubscriptionList](#subscriptionlist) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/subscriptions"
```

[Try it in the API playground →](/playground?op=listSubscriptions)

### Create a subscription

`POST /v1/subscriptions`

Starts billing a customer every `intervalCount` × `interval` (day, week, month or year) in a
settlement stablecoin. Pass `productId` to bill a product's price, settlement token and payout
address, or `amount`, `settleChain`, `settleToken`, `recipient` and `description` directly.
The first invoice is issued and emailed at `startAt` (default: now, within a minute); each next
one at the end of the period. Invoices are due `daysUntilDue` days after they are issued
(default 3). Sends `subscription.created`. An `lh_test_` key creates a test-mode subscription
(`sub_test_…`).

**Request body** — [SubscriptionCreateRequest](#subscriptioncreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Subscription created. | [Subscription](#subscription) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/subscriptions" \
  -H "content-type: application/json" \
  -d '{"customerEmail":"ada@example.com","customerName":"Ada Lovelace","merchantName":"Studio Nine","description":"Pro plan","amount":"49000000","settleChain":"base","settleToken":"USDC","recipient":"0x2222222222222222222222222222222222222222","interval":"month","metadata":{"plan":"pro"}}'
```

[Try it in the API playground →](/playground?op=createSubscription)

### Get a subscription

`GET /v1/subscriptions/{id}`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Subscription id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The subscription. | [Subscription](#subscription) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/subscriptions/sub_01k7v0c2c4x8q6r0v3b5n7p9d"
```

[Try it in the API playground →](/playground?op=getSubscription)

### Update a subscription

`PATCH /v1/subscriptions/{id}`

Changes apply from the next invoice: the customer, `description`, `memo`, `amount`, `daysUntilDue`
and `metadata`. `cancelAtPeriodEnd: true` schedules a cancel at the end of the current period and
`false` undoes it. The interval and the settlement can't change (create a new subscription).
Canceled subscriptions return `CONFLICT`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Subscription id. |

**Request body** — [SubscriptionUpdateRequest](#subscriptionupdaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The subscription. | [Subscription](#subscription) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X PATCH "https://api.layerhop.com/v1/subscriptions/sub_01k7v0c2c4x8q6r0v3b5n7p9d" \
  -H "content-type: application/json" \
  -d '{"amount":"59000000","cancelAtPeriodEnd":false}'
```

[Try it in the API playground →](/playground?op=updateSubscription)

### List a subscription's invoices

`GET /v1/subscriptions/{id}/invoices`

The invoices issued for this subscription (up to 100), newest first.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Subscription id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Its invoices. | [SubscriptionInvoiceList](#subscriptioninvoicelist) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/subscriptions/sub_01k7v0c2c4x8q6r0v3b5n7p9d/invoices"
```

[Try it in the API playground →](/playground?op=listSubscriptionInvoices)

### Cancel a subscription

`POST /v1/subscriptions/{id}/cancel`

Cancels now (`atPeriodEnd` false, the default): no more invoices and `subscription.canceled`.
Invoices already sent stay open; void them with `POST /v1/invoices/{id}/void` if the customer
shouldn't pay them. With `atPeriodEnd: true` it stays active until `currentPeriodEnd` and is
canceled instead of renewed (`cancelAtPeriodEnd` true). Already canceled returns `CONFLICT`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Subscription id. |

**Request body** — [SubscriptionCancelRequest](#subscriptioncancelrequest)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The subscription. | [Subscription](#subscription) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/subscriptions/sub_01k7v0c2c4x8q6r0v3b5n7p9d/cancel" \
  -H "content-type: application/json" \
  -d '{"atPeriodEnd":true}'
```

[Try it in the API playground →](/playground?op=cancelSubscription)

### Pause a subscription

`POST /v1/subscriptions/{id}/pause`

Stops issuing invoices and sending reminders. Only `active` subscriptions can be paused (a
`past_due` one must be paid or canceled first); others return `CONFLICT`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Subscription id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The subscription. | [Subscription](#subscription) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/subscriptions/sub_01k7v0c2c4x8q6r0v3b5n7p9d/pause"
```

[Try it in the API playground →](/playground?op=pauseSubscription)

### Resume a subscription

`POST /v1/subscriptions/{id}/resume`

Resumes a `paused` subscription. If the current period hasn't ended, billing continues on the
old schedule; otherwise a new period starts now and its invoice goes out right away (paused
time is never billed). Invoices still open get a fresh due date. Other statuses return `CONFLICT`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Subscription id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The subscription. | [Subscription](#subscription) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/subscriptions/sub_01k7v0c2c4x8q6r0v3b5n7p9d/resume"
```

[Try it in the API playground →](/playground?op=resumeSubscription)

## Plans

Paid developer plans (Free, Pro, Scale; names, prices and limits are set by the operator). **Off unless the operator runs the API with `PLANS_LIVE=1`**: until then every route in this group returns 404 and every account has the Free limits, which equal the limits without plans (120 requests/minute per key, no monthly quota, 10 webhook endpoints, 50 bps partner fee cap). With plans on, a live `lh_live_` key's account gets its plan's rate limit and monthly quota (`QUOTA_EXCEEDED` once used up; responses then carry `x-quota-limit` and `x-quota-remaining`), webhook endpoint count, partner fee cap and white-label. Plans are paid with LayerHop's own crypto subscriptions: each month an invoice in USDC, paid with any token on the hosted invoice page.

### List plans

`GET /v1/plans`

The plan catalog with monthly prices (base units of the billing token, USDC). 404 unless plans are enabled.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Plans, in display order. | [PlanList](#planlist) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/plans"
```

**Example response** (`200`)

```json
{
  "plans": [
    {
      "id": "free",
      "name": "Free",
      "tagline": "Everything you need to ship.",
      "priceUsdc": "0",
      "price": {
        "amount": "0",
        "symbol": "USDC",
        "decimals": 6,
        "chainId": 8453,
        "interval": "month"
      },
      "rateLimitRpm": 120,
      "webhookEndpoints": 10,
      "maxPartnerFeeBps": 50,
      "whiteLabel": false,
      "prioritySupport": false
    },
    {
      "id": "pro",
      "name": "Pro",
      "tagline": "Higher limits and your own brand.",
      "priceUsdc": "49",
      "price": {
        "amount": "49000000",
        "symbol": "USDC",
        "decimals": 6,
        "chainId": 8453,
        "interval": "month"
      },
      "rateLimitRpm": 600,
      "monthlyRequests": 2000000,
      "webhookEndpoints": 25,
      "maxPartnerFeeBps": 100,
      "whiteLabel": true,
      "prioritySupport": false
    }
  ]
}
```

### Get your plan and usage

`GET /v1/account/plan`

The plan of the API key's account and this month's live request count. Never counts against
the monthly quota, so it answers even after `QUOTA_EXCEEDED`. 404 unless plans are enabled.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Plan and usage. | [AccountPlan](#accountplan) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/account/plan"
```

**Example response** (`200`)

```json
{
  "plan": {
    "id": "pro",
    "name": "Pro",
    "tagline": "Higher limits and your own brand.",
    "priceUsdc": "49",
    "price": {
      "amount": "49000000",
      "symbol": "USDC",
      "decimals": 6,
      "chainId": 8453,
      "interval": "month"
    },
    "rateLimitRpm": 600,
    "monthlyRequests": 2000000,
    "webhookEndpoints": 25,
    "maxPartnerFeeBps": 100,
    "whiteLabel": true,
    "prioritySupport": false
  },
  "status": "active",
  "periodEnd": "2026-11-21T10:00:00.000Z",
  "expiresAt": "2026-12-01T10:00:00.000Z",
  "usage": {
    "requests": 18234,
    "monthlyRequests": 2000000,
    "resetsAt": "2026-11-01T00:00:00.000Z",
    "rateLimitRpm": 600,
    "webhookEndpoints": {
      "used": 2,
      "limit": 25
    }
  }
}
```

### Check white-label for a partner

`GET /v1/embed/branding`

Whether the widget may hide "Powered by LayerHop" for `integrator`: true only when that
partner's account is on a plan with white-label. The hosted widget asks this before honoring
`hidePoweredBy`, so the URL flag alone never removes the branding. Cached for 60 s. 404 unless plans are enabled.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `integrator` | string | yes | Partner id ([a-z0-9-]{1,32}). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Entitlement. | [EmbedBranding](#embedbranding) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/embed/branding"
```

**Example response** (`200`)

```json
{
  "integrator": "acme",
  "whiteLabel": true
}
```

## Market data

Market data for **Berachain** and **Robinhood Chain** from LayerHop's own indexer, read from the chain (Kodiak v2 / v3 and BEX on Berachain; Uniswap v2 / v3 / v4 on Robinhood Chain): token lists and search, token detail, OHLCV candles, trades, holders, top traders and the most active pools. No third-party market data is resold here. **Off unless the operator runs the API with `MARKET_API_LIVE=1`**: until then every route in this group returns 404. An API key (`x-api-key`) is required. Without paid plans each key gets `MARKET_API_RPM` requests a minute (default 60); with plans on, the plan's `marketRpm` and its monthly `marketMonthlyCalls` apply (`QUOTA_EXCEEDED` once used up; responses carry `x-market-quota-limit` and `x-market-quota-remaining`). On these routes `x-ratelimit-limit` / `x-ratelimit-remaining` describe the market data limit. Answers are cached for 5–60 seconds.

### List market data chains

`GET /v1/market/chains`

The chains with market data, their indexed exchanges and candle intervals. `available` is false when this deployment has no indexer for the chain.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Chains. | [MarketChainList](#marketchainlist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | The account's plan has no market data (`FORBIDDEN`; only with plans enabled). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over the key's market data rate limit (`RATE_LIMITED`, wait `retry-after` seconds) or, with plans enabled, the account's monthly market data calls (`QUOTA_EXCEEDED`). | [Error](#error) |
| `503` | The chain's indexer is unreachable or not configured on this deployment (`MARKET_UNAVAILABLE`). Retry after a few seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/market/chains"
```

**Example response** (`200`)

```json
{
  "chains": [
    {
      "chainId": 80094,
      "slug": "berachain",
      "name": "Berachain",
      "dexes": [
        "Kodiak v2",
        "Kodiak v3",
        "BEX"
      ],
      "intervals": [
        "1m",
        "5m",
        "15m",
        "1h",
        "4h",
        "1d"
      ],
      "available": true
    },
    {
      "chainId": 4663,
      "slug": "robinhood",
      "name": "Robinhood Chain",
      "dexes": [
        "Uniswap v2",
        "Uniswap v3",
        "Uniswap v4"
      ],
      "intervals": [
        "1m",
        "5m",
        "15m",
        "1h",
        "4h",
        "1d"
      ],
      "available": true
    }
  ]
}
```

### List or search tokens

`GET /v1/market/{chain}/tokens`

Tokens traded on the chain's indexed exchanges in the window, sorted by `sort`. `q` searches
symbol and name (or matches one address). Each token's price, change and quote side come from
its most traded pool (`pool`). Cached 30 s.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | yes | `berachain` (80094) or `robinhood` (4663); the slug or the chain id. Any other chain is `UNSUPPORTED_CHAIN`. |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `sort` | `"trending"` \| `"top"` \| `"new"` \| `"gainers"` | no | `trending` (default), `top` (volume), `new` (created in 7 days), `gainers` (24 h change, 1,000 USD volume or more). (default `"trending"`) |
| `window` | `"24h"` \| `"7d"` | no | Volume and trade-count window for sorting and filters. (default `"24h"`) |
| `q` | string | no | Search: part of a symbol or name, or a token address (1–64 characters). |
| `minVolumeUsd` | number | no | Least USD volume in the window; default 100 (0 with `q`). (≥ 0) |
| `minTrades` | integer | no | Fewest trades in the window; default 5 (1 with `q`). (≥ 0) |
| `limit` | integer | no | (default `50`) (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Tokens. | [MarketTokenList](#markettokenlist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | The account's plan has no market data (`FORBIDDEN`; only with plans enabled). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over the key's market data rate limit (`RATE_LIMITED`, wait `retry-after` seconds) or, with plans enabled, the account's monthly market data calls (`QUOTA_EXCEEDED`). | [Error](#error) |
| `503` | The chain's indexer is unreachable or not configured on this deployment (`MARKET_UNAVAILABLE`). Retry after a few seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/market/berachain/tokens"
```

**Example response** (`200`)

```json
{
  "chainId": 80094,
  "window": "24h",
  "sort": "top",
  "asOf": 1793000000,
  "count": 1,
  "tokens": [
    {
      "address": "0xb8cd06e46ef4ea5b0c3f1a4f1b8f5a7d2e6c4b21",
      "symbol": "COMPUTE.r",
      "name": "Compute",
      "decimals": 18,
      "priceUsd": 13.02,
      "change": {
        "m5": 0,
        "h1": 1.5,
        "h6": -2,
        "h24": 10.4
      },
      "volumeUsd": {
        "m5": 120,
        "h1": 1800,
        "h6": 9200,
        "h24": 41000
      },
      "trades": {
        "m5": 2,
        "h1": 31,
        "h6": 140,
        "h24": 610
      },
      "pool": "0xe97c6a2b1f2fd3c1e5b4a0d9c8b7a6f5e4d3a65b",
      "poolCount": 2,
      "quoteSymbol": "WBERA",
      "createdAt": 1761000000000
    }
  ]
}
```

### Get a token

`GET /v1/market/{chain}/tokens/{address}`

One token traded in the last 7 days (`NOT_FOUND` otherwise), with 7-day volume and trades (`d7`). Cached 30 s.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | yes | `berachain` (80094) or `robinhood` (4663); the slug or the chain id. Any other chain is `UNSUPPORTED_CHAIN`. |
| `address` | string | yes | Token address (0x + 40 hex). (pattern `^0x[0-9a-fA-F]{40}$`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The token. | [MarketTokenDetail](#markettokendetail) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | The account's plan has no market data (`FORBIDDEN`; only with plans enabled). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over the key's market data rate limit (`RATE_LIMITED`, wait `retry-after` seconds) or, with plans enabled, the account's monthly market data calls (`QUOTA_EXCEEDED`). | [Error](#error) |
| `503` | The chain's indexer is unreachable or not configured on this deployment (`MARKET_UNAVAILABLE`). Retry after a few seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/market/berachain/tokens/0xb8cd06e46ef4ea5b0c3f1a4f1b8f5a7d2e6c4b21"
```

**Example response** (`200`)

```json
{
  "chainId": 80094,
  "asOf": 1793000000,
  "token": {
    "address": "0xb8cd06e46ef4ea5b0c3f1a4f1b8f5a7d2e6c4b21",
    "symbol": "COMPUTE.r",
    "name": "Compute",
    "decimals": 18,
    "priceUsd": 13.02,
    "change": {
      "m5": 0,
      "h1": 1.5,
      "h6": -2,
      "h24": 10.4
    },
    "volumeUsd": {
      "m5": 120,
      "h1": 1800,
      "h6": 9200,
      "h24": 41000,
      "d7": 205000
    },
    "trades": {
      "m5": 2,
      "h1": 31,
      "h6": 140,
      "h24": 610,
      "d7": 3050
    },
    "pool": "0xe97c6a2b1f2fd3c1e5b4a0d9c8b7a6f5e4d3a65b",
    "poolCount": 2,
    "quoteSymbol": "WBERA",
    "createdAt": 1761000000000
  }
}
```

### Get a token's holders

`GET /v1/market/{chain}/tokens/{address}/holders`

The largest holders and the holder count, replayed from every Transfer since the token's
creation. Only for tokens traded in the last 7 days (`NOT_FOUND` otherwise). A token seen for
the first time is counted in the background: `status` is `syncing` (with `partial: true` and
the holders found so far) until it is `ready`; ask again in a minute. Cached 60 s.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | yes | `berachain` (80094) or `robinhood` (4663); the slug or the chain id. Any other chain is `UNSUPPORTED_CHAIN`. |
| `address` | string | yes | Token address (0x + 40 hex). (pattern `^0x[0-9a-fA-F]{40}$`) |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | (default `50`) (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Holders. | [MarketHolders](#marketholders) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | The account's plan has no market data (`FORBIDDEN`; only with plans enabled). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over the key's market data rate limit (`RATE_LIMITED`, wait `retry-after` seconds) or, with plans enabled, the account's monthly market data calls (`QUOTA_EXCEEDED`). | [Error](#error) |
| `503` | The chain's indexer is unreachable or not configured on this deployment (`MARKET_UNAVAILABLE`). Retry after a few seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/market/berachain/tokens/0xb8cd06e46ef4ea5b0c3f1a4f1b8f5a7d2e6c4b21/holders"
```

**Example response** (`200`)

```json
{
  "chainId": 80094,
  "token": "0xb8cd06e46ef4ea5b0c3f1a4f1b8f5a7d2e6c4b21",
  "status": "ready",
  "holdersCount": 50,
  "totalSupply": "2000000000000000000000000",
  "decimals": 18,
  "syncedBlock": 28118724,
  "partial": false,
  "holders": [
    {
      "address": "0xe97c6a2b1f2fd3c1e5b4a0d9c8b7a6f5e4d3a65b",
      "amount": "71600000000000000000000",
      "pct": 3.58,
      "tags": [
        "lp"
      ]
    }
  ]
}
```

### List active pools

`GET /v1/market/{chain}/pools`

The most traded pools in the window (each token's main pool), by USD volume. Use a `pool` with the candles, trades and traders routes. Cached 30 s.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | yes | `berachain` (80094) or `robinhood` (4663); the slug or the chain id. Any other chain is `UNSUPPORTED_CHAIN`. |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `window` | `"24h"` \| `"7d"` | no | (default `"24h"`) |
| `limit` | integer | no | (default `50`) (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Pools. | [MarketPoolList](#marketpoollist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | The account's plan has no market data (`FORBIDDEN`; only with plans enabled). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over the key's market data rate limit (`RATE_LIMITED`, wait `retry-after` seconds) or, with plans enabled, the account's monthly market data calls (`QUOTA_EXCEEDED`). | [Error](#error) |
| `503` | The chain's indexer is unreachable or not configured on this deployment (`MARKET_UNAVAILABLE`). Retry after a few seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/market/berachain/pools"
```

**Example response** (`200`)

```json
{
  "chainId": 80094,
  "window": "24h",
  "asOf": 1793000000,
  "count": 1,
  "pools": [
    {
      "pool": "0xe97c6a2b1f2fd3c1e5b4a0d9c8b7a6f5e4d3a65b",
      "token": {
        "address": "0xb8cd06e46ef4ea5b0c3f1a4f1b8f5a7d2e6c4b21",
        "symbol": "COMPUTE.r",
        "name": "Compute"
      },
      "quoteSymbol": "WBERA",
      "priceUsd": 13.02,
      "volumeUsd": 41000,
      "trades": 610
    }
  ]
}
```

### Get OHLCV candles

`GET /v1/market/{chain}/pools/{pool}/candles`

USD candles of one side of a pool, oldest first. `time` is the candle's start in unix
**seconds**; `volume` is USD. 1m / 5m / 15m cover the last 7 days; 1h / 4h / 1d the whole
indexed history. Quiet periods have no candle (no gap filling); each candle opens at the
previous close. Cached 15 s (minute intervals) or 60 s.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | yes | `berachain` (80094) or `robinhood` (4663); the slug or the chain id. Any other chain is `UNSUPPORTED_CHAIN`. |
| `pool` | string | yes | Pool address (0x + 40 hex), or a Uniswap v4 pool id (0x + 64 hex). (pattern `^0x([0-9a-fA-F]{40}\|[0-9a-fA-F]{64})$`) |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `token` | string | no | Which side of the pool (a token address); default the pool's priced token. (pattern `^0x[0-9a-fA-F]{40}$`) |
| `interval` | `"1m"` \| `"5m"` \| `"15m"` \| `"1h"` \| `"4h"` \| `"1d"` | no | (default `"1h"`) |
| `limit` | integer | no | The newest candles to return. (default `300`) (1–1000) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Candles. | [MarketCandles](#marketcandles) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | The account's plan has no market data (`FORBIDDEN`; only with plans enabled). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over the key's market data rate limit (`RATE_LIMITED`, wait `retry-after` seconds) or, with plans enabled, the account's monthly market data calls (`QUOTA_EXCEEDED`). | [Error](#error) |
| `503` | The chain's indexer is unreachable or not configured on this deployment (`MARKET_UNAVAILABLE`). Retry after a few seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/market/berachain/pools/0xe97c6a2b1f2fd3c1e5b4a0d9c8b7a6f5e4d3a65b/candles"
```

**Example response** (`200`)

```json
{
  "chainId": 80094,
  "pool": "0xe97c6a2b1f2fd3c1e5b4a0d9c8b7a6f5e4d3a65b",
  "token": "0xb8cd06e46ef4ea5b0c3f1a4f1b8f5a7d2e6c4b21",
  "interval": "1h",
  "indexed": true,
  "candles": [
    {
      "time": 1793001600,
      "open": 12.8,
      "high": 13.4,
      "low": 12.7,
      "close": 13.02,
      "volume": 1820.5
    }
  ]
}
```

### Get trades

`GET /v1/market/{chain}/pools/{pool}/trades`

A pool's trades, newest first, as trades of one side (`kind` buy / sell of that token). `time`
is unix **milliseconds**. Page back with `before` = the previous page's `next` (null at the
end). `wallet` is the transaction's sender (null while not yet looked up). `zap` marks a
trade whose transaction also added or removed liquidity on the pool. The first page is cached
5 s, older pages 60 s.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | yes | `berachain` (80094) or `robinhood` (4663); the slug or the chain id. Any other chain is `UNSUPPORTED_CHAIN`. |
| `pool` | string | yes | Pool address (0x + 40 hex), or a Uniswap v4 pool id (0x + 64 hex). (pattern `^0x([0-9a-fA-F]{40}\|[0-9a-fA-F]{64})$`) |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `token` | string | no | Which side of the pool (a token address); default the pool's priced token. (pattern `^0x[0-9a-fA-F]{40}$`) |
| `before` | string | no | A trades page's `next` cursor. (pattern `^\d+:\d+:\d+$`) |
| `limit` | integer | no | (default `50`) (1–100) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Trades. | [MarketTrades](#markettrades) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | The account's plan has no market data (`FORBIDDEN`; only with plans enabled). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over the key's market data rate limit (`RATE_LIMITED`, wait `retry-after` seconds) or, with plans enabled, the account's monthly market data calls (`QUOTA_EXCEEDED`). | [Error](#error) |
| `503` | The chain's indexer is unreachable or not configured on this deployment (`MARKET_UNAVAILABLE`). Retry after a few seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/market/berachain/pools/0xe97c6a2b1f2fd3c1e5b4a0d9c8b7a6f5e4d3a65b/trades"
```

**Example response** (`200`)

```json
{
  "chainId": 80094,
  "pool": "0xe97c6a2b1f2fd3c1e5b4a0d9c8b7a6f5e4d3a65b",
  "token": "0xb8cd06e46ef4ea5b0c3f1a4f1b8f5a7d2e6c4b21",
  "indexed": true,
  "trades": [
    {
      "time": 1793001234000,
      "kind": "buy",
      "usd": 0.15,
      "tokenAmount": 0.0115,
      "priceUsd": 13.02,
      "wallet": "0x5a1f0b6c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f70",
      "txHash": "0x16ff9c1e2d3b4a5f6e7d8c9b0a1f2e3d4c5b6a7f8e9d0c1b2a3f4e5d6c7bdda3",
      "block": 28118724,
      "logIndex": 12
    }
  ],
  "next": "1793001234000:28118724:12",
  "partial": false
}
```

### Get top traders

`GET /v1/market/{chain}/pools/{pool}/traders`

A pool's traders ranked by `sort`, for the pool's priced token: buys and sells in USD and
tokens, cost basis, realized and unrealized PnL (USD, average cost). Only for the main pool of
a token traded in the last 7 days (see `GET /v1/market/{chain}/pools`; `NOT_FOUND` otherwise).
`coverage.complete` is false while the indexer is still filling in wallets or older history.
Token amounts are integer strings in base units. Cached 60 s.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `chain` | string | yes | `berachain` (80094) or `robinhood` (4663); the slug or the chain id. Any other chain is `UNSUPPORTED_CHAIN`. |
| `pool` | string | yes | Pool address (0x + 40 hex), or a Uniswap v4 pool id (0x + 64 hex). (pattern `^0x([0-9a-fA-F]{40}\|[0-9a-fA-F]{64})$`) |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `token` | string | no | Which side of the pool (a token address); default the pool's priced token. (pattern `^0x[0-9a-fA-F]{40}$`) |
| `sort` | `"pnl"` \| `"volume"` \| `"buys"` \| `"sells"` | no | (default `"pnl"`) |
| `days` | `"all"` \| `"1"` \| `"7"` \| `"30"` \| `"90"` | no | Window: `all` (default) or the last 1, 7, 30 or 90 days. (default `"all"`) |
| `limit` | integer | no | (default `50`) (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Traders. | [MarketTraders](#markettraders) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | The account's plan has no market data (`FORBIDDEN`; only with plans enabled). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `429` | Over the key's market data rate limit (`RATE_LIMITED`, wait `retry-after` seconds) or, with plans enabled, the account's monthly market data calls (`QUOTA_EXCEEDED`). | [Error](#error) |
| `503` | The chain's indexer is unreachable or not configured on this deployment (`MARKET_UNAVAILABLE`). Retry after a few seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/market/berachain/pools/0xe97c6a2b1f2fd3c1e5b4a0d9c8b7a6f5e4d3a65b/traders"
```

**Example response** (`200`)

```json
{
  "chainId": 80094,
  "pool": "0xe97c6a2b1f2fd3c1e5b4a0d9c8b7a6f5e4d3a65b",
  "token": "0xb8cd06e46ef4ea5b0c3f1a4f1b8f5a7d2e6c4b21",
  "indexed": true,
  "asOf": 1793001300,
  "decimals": 18,
  "priceUsd": 13.02,
  "coverage": {
    "trades": 610,
    "withWallet": 610,
    "complete": true
  },
  "traders": [
    {
      "wallet": "0x5a1f0b6c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f70",
      "buys": 4,
      "sells": 2,
      "boughtUsd": 520.1,
      "soldUsd": 610.4,
      "boughtTokens": "40000000000000000000",
      "soldTokens": "30000000000000000000",
      "heldTokens": "10000000000000000000",
      "costBasisUsd": 130.02,
      "realizedPnlUsd": 220.3,
      "unrealizedPnlUsd": 0.18,
      "pnlUsd": 220.48,
      "firstTrade": 1792500000000,
      "lastTrade": 1793000000000
    }
  ]
}
```

## Deposit addresses

Swap or bridge by sending tokens to an address, without connecting a wallet (beta). Each deposit becomes an order (`quoteId` starting with `dep_`, `depositAddressId` set) with the usual `order.*` webhooks. The address belongs to the liquidity provider (Relay); LayerHop never holds funds. Needs an API key; live mode is rolling out (test keys always work).

### List deposit addresses

`GET /v1/deposit-addresses`

Your account's deposit addresses of the key's mode (live or test), newest first.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | [DepositAddressStatus](#depositaddressstatus) | no | Only addresses with this status. |
| `label` | string | no | Only addresses with exactly this label. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–200, default 50. (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of deposit addresses. | [DepositAddressList](#depositaddresslist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/deposit-addresses"
```

[Try it in the API playground →](/playground?op=listDepositAddresses)

### Create a deposit address

`POST /v1/deposit-addresses`

Returns an address on `srcChain` that your user sends `srcToken` to; each deposit is swapped or
bridged to `dstToken` on `dstChain` and delivered to `recipient`. The address is created by the
liquidity provider (Relay); LayerHop never holds the funds. The fee is the API channel fee plus
your partner fee (`integrator`, `integratorFeeBps`, resolved exactly as for `GET /v1/quote`).
`reusable: true` (default) accepts any number of deposits of any amount on the same route;
`reusable: false` is a one-time address for exactly `amount` (underpayments are refunded to
`refundTo`). Deposits must be worth at least $1. The response adds an `estimate` for `amount`
(default: about $100 of `srcToken`). An `lh_test_` key creates a test-mode address (provider
`sandbox`, a fake address you can `simulate` deposits to); live keys get `FORBIDDEN` until
deposit addresses are enabled for live mode on your account (rolling out, available on
request). Uses the strict rate-limit bucket.

**Request body** — [DepositAddressCreateRequest](#depositaddresscreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Deposit address created. | [DepositAddressCreated](#depositaddresscreated) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | `FORBIDDEN`: deposit addresses are not enabled for live mode on this account yet; use a test key. | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/deposit-addresses" \
  -H "content-type: application/json" \
  -d '{"srcChain":"base","srcToken":"USDC","dstChain":"arbitrum","dstToken":"USDC","recipient":"0x2222222222222222222222222222222222222222","refundTo":"0x3333333333333333333333333333333333333333","label":"user-4821","metadata":{"userId":"4821"}}'
```

[Try it in the API playground →](/playground?op=createDepositAddress)

**Example response** (`201`)

```json
{
  "id": "da_01k7x2m4c4x8q6r0v3b5n7p9d",
  "object": "deposit_address",
  "livemode": true,
  "status": "active",
  "provider": "relay",
  "address": "0x7d3a9f0c1b2e4d5f6a7b8c9d0e1f2a3b4c5d6e7f",
  "chainId": 8453,
  "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "dstChainId": 42161,
  "dstToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
  "recipient": "0x2222222222222222222222222222222222222222",
  "refundTo": "0x3333333333333333333333333333333333333333",
  "reusable": true,
  "fees": {
    "ourFeeBps": 10,
    "integratorFeeBps": 0
  },
  "label": "user-4821",
  "metadata": {
    "userId": "4821"
  },
  "depositCount": 0,
  "createdAt": "2026-10-19T10:00:00.000Z",
  "estimate": {
    "amount": "100000000",
    "dstAmount": "99780000",
    "dstAmountMin": "99280000",
    "estimatedSeconds": 12
  }
}
```

### Get a deposit address

`GET /v1/deposit-addresses/{id}`

The address and its 20 most recent deposits (each one an order), newest first.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Deposit address id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The deposit address. | [DepositAddressWithDeposits](#depositaddresswithdeposits) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/deposit-addresses/da_01k7x2m4c4x8q6r0v3b5n7p9d"
```

[Try it in the API playground →](/playground?op=getDepositAddress)

### Check for deposits now

`POST /v1/deposit-addresses/{id}/refresh`

Deposits are detected every ~15 seconds while an address is busy, backing off to every 15 minutes
when it is idle. Call this when your user says they sent funds: the next check runs right away
and the backoff resets. Disabled addresses return `CONFLICT`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Deposit address id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `202` | Check scheduled. | [DepositAddress](#depositaddress) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/deposit-addresses/da_01k7x2m4c4x8q6r0v3b5n7p9d/refresh"
```

[Try it in the API playground →](/playground?op=refreshDepositAddress)

### Disable a deposit address

`POST /v1/deposit-addresses/{id}/disable`

Stops tracking the address (`status: disabled`). Stop showing it to your user: the provider may
still process funds sent to it later, but LayerHop no longer reports them.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Deposit address id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The disabled address. | [DepositAddress](#depositaddress) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/deposit-addresses/da_01k7x2m4c4x8q6r0v3b5n7p9d/disable"
```

[Try it in the API playground →](/playground?op=disableDepositAddress)

### Simulate a deposit (test mode)

`POST /v1/deposit-addresses/{id}/simulate`

Test keys only (live addresses return `FORBIDDEN`). Records a deposit of `amount` as a new
`submitted` order that settles like any test order: an amount ending in `4001` is refunded,
`4002` fails, anything else fills, with the usual `order.*` webhooks. A one-time address needs
exactly its `amount` and accepts a single deposit (`CONFLICT` after that); disabled addresses
return `CONFLICT`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Deposit address id. |

**Request body** — [SimulateDepositRequest](#simulatedepositrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Test deposit recorded. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | `FORBIDDEN`: a live address; simulate works in test mode only. | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/deposit-addresses/da_01k7x2m4c4x8q6r0v3b5n7p9d/simulate" \
  -H "content-type: application/json" \
  -d '{"amount":"25000000"}'
```

[Try it in the API playground →](/playground?op=simulateDeposit)

### Start a swap paid from an exchange or any wallet

`POST /v1/swap-deposits`

For someone with no wallet to connect: returns a one-time address on `srcChain`. Sending exactly
`amount` of `srcToken` to it swaps or bridges to `dstToken` on `dstChain`, delivered to
`recipient`. No API key. The address belongs to the liquidity provider (Relay); LayerHop never
holds the funds, and anything that can't be delivered goes back to `refundTo` on `srcChain`. The
fee is the web channel fee. Deposits must be worth at least $1. The address is shown as usable
for one hour (`expiresAt`). Off unless enabled on the API (`FORBIDDEN`). Uses the strict
rate-limit bucket.

**Request body** — [SwapDepositCreateRequest](#swapdepositcreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Swap deposit created. | [SwapDepositCreated](#swapdepositcreated) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `403` | `FORBIDDEN`: swaps by deposit address are not enabled. | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/swap-deposits" \
  -H "content-type: application/json" \
  -d '{"srcChain":"base","srcToken":"USDC","dstChain":"arbitrum","dstToken":"USDC","amount":"25000000","recipient":"0x2222222222222222222222222222222222222222","refundTo":"0x3333333333333333333333333333333333333333"}'
```

[Try it in the API playground →](/playground?op=createSwapDeposit)

**Example response** (`201`)

```json
{
  "id": "da_01k7x2m4c4x8q6r0v3b5n7p9d",
  "object": "swap_deposit",
  "state": "waiting",
  "address": "0x7d3a9f0c1b2e4d5f6a7b8c9d0e1f2a3b4c5d6e7f",
  "chainId": 8453,
  "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "amount": "25000000",
  "dstChainId": 42161,
  "dstToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
  "recipient": "0x2222222222222222222222222222222222222222",
  "refundTo": "0x3333333333333333333333333333333333333333",
  "feeBps": 15,
  "createdAt": "2026-11-30T10:00:00.000Z",
  "expiresAt": "2026-11-30T11:00:00.000Z",
  "estimate": {
    "amount": "25000000",
    "dstAmount": "24930000",
    "dstAmountMin": "24805000",
    "estimatedSeconds": 12
  }
}
```

### Get a swap deposit

`GET /v1/swap-deposits/{id}`

The address and where its deposit is: `waiting` (nothing seen yet), `received` (the deposit was
seen and the swap is running), `filled`, `refunded`, `failed`, or `expired` (nothing arrived
within the hour; ask for a new address).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Swap deposit id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The swap deposit. | [SwapDeposit](#swapdeposit) |
| `403` | `FORBIDDEN`: swaps by deposit address are not enabled. | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/swap-deposits/da_01k7x2m4c4x8q6r0v3b5n7p9d"
```

[Try it in the API playground →](/playground?op=getSwapDeposit)

## x402

HTTP 402 pay-per-request in USDC (Coinbase's open x402 protocol, v1 and v2): payment requirements for your resources and a facilitator (`verify`, `settle`) for payments to your own fee-splitting deposit addresses. Needs an API key; settlement is rolling out.

### Supported x402 networks

`GET /v1/x402/supported`

x402 `GET /supported`: the schemes and networks this facilitator verifies and settles (scheme
`exact`, USDC with EIP-3009, as x402 v2 CAIP-2 ids and v1 names), and the settler address while
settlement is enabled (`settle`).

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Supported kinds. | object |

**Example request**

```bash
curl "https://api.layerhop.com/v1/x402/supported"
```

**Example response** (`200`)

```json
{
  "kinds": [
    {
      "x402Version": 2,
      "scheme": "exact",
      "network": "eip155:8453"
    },
    {
      "x402Version": 1,
      "scheme": "exact",
      "network": "base"
    }
  ],
  "extensions": [],
  "signers": {},
  "settle": false
}
```

### Payment requirements for a resource

`POST /v1/x402/requirements`

Merchant side (API key). Returns the x402 payment requirements to answer `402 Payment Required`
with, for a price you net per request (`amount`, USDC base units) paid out to `payTo`.

The requirements' `payTo` is not your address: it is your own fee-splitting deposit address
(`payee.depositAddress`, the D-065 `CheckoutSplitterFactory` contract), one per resource and
payout address. The payer signs `amount` = your price plus LayerHop's checkout fee on top
(`fee.bps` of the gross, 0.25% by default); the deposit address can only pay you and the fee.
LayerHop sweeps it to `payTo` once it holds at least $1. `accepts` is the x402 v2 form,
`acceptsV1` the v1 form, `paymentRequired` the whole v2 `PaymentRequired` object (base64 it into
the `PAYMENT-REQUIRED` header). The `@layerhop/sdk` `x402()` middleware does all of this.

**Request body** — [X402RequirementsRequest](#x402requirementsrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Requirements. | [X402RequirementsResponse](#x402requirementsresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | Not allowed (`FORBIDDEN`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/x402/requirements" \
  -H "content-type: application/json" \
  -d '{"network":"base","amount":"10000","payTo":"0x2222222222222222222222222222222222222222","resource":"https://api.example.com/v1/weather","description":"Current weather"}'
```

### Verify an x402 payment

`POST /v1/x402/verify`

x402 facilitator `POST /verify` (read-only), for payments to your own requirements (API key).
Checks the EIP-3009 signature (EOA wallets), scheme, network, asset, `payTo` (one of your
deposit addresses), the exact amount, the validity window (at least 6 s left), that the nonce is
unused (on chain and here), the payer's USDC balance, and simulates the transfer with `eth_call`.
Always HTTP 200 for a well-formed call; `isValid: false` carries an x402 `invalidReason`.

**Request body** — [X402FacilitatorRequest](#x402facilitatorrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Verification result. | [X402VerifyResponse](#x402verifyresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/x402/verify" \
  -H "content-type: application/json" \
  -d '{}'
```

**Example response** (`200`)

```json
{
  "isValid": true,
  "payer": "0x857b06519e91e3a54538791bdbb0e22373e36b66"
}
```

### Settle an x402 payment

`POST /v1/x402/settle`

x402 facilitator `POST /settle` (live API key). Verifies again, records the payment (an
authorization settles once; repeating the call returns the same result), submits
`transferWithAuthorization` from LayerHop's gas-only settler and waits for the receipt (about
20 s). `success: true` → the USDC is in your deposit address and `x402.payment.settled` fires;
`errorReason: settlement_pending` → sent, receipt not in yet (LayerHop finishes it and the
webhook fires then). `FORBIDDEN` while x402 settlement is not enabled on this API, and for test
keys.

**Request body** — [X402FacilitatorRequest](#x402facilitatorrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Settlement result. | [X402SettleResponse](#x402settleresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | Not allowed (`FORBIDDEN`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/x402/settle" \
  -H "content-type: application/json" \
  -d '{}'
```

**Example response** (`200`)

```json
{
  "success": true,
  "payer": "0x857b06519e91e3a54538791bdbb0e22373e36b66",
  "transaction": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "network": "eip155:8453"
}
```

### List x402 payments

`GET /v1/x402/payments`

Payments settled through LayerHop for your account, newest first.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | `"submitted"` \| `"settled"` \| `"failed"` | no | Only payments with this status. |
| `network` | string | no | Only payments on this network: `base`, `optimism`, `arbitrum`, `polygon`, a CAIP-2 id (`eip155:8453`) or a chain id. |
| `from` | string | no | Only payments created at or after this time (ISO 8601 or unix seconds). |
| `to` | string | no | Only payments created before this time (ISO 8601 or unix seconds). |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–200, default 50. (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of payments. | [X402PaymentList](#x402paymentlist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/x402/payments"
```

### Get an x402 payment

`GET /v1/x402/payments/{id}`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Payment id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The payment. | [X402Payment](#x402payment) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/x402/payments/x402_01k7t9m2c4x8q6r0v3b5n7p9d"
```

## Status

Public platform status, the data behind status.layerhop.com.

### Get bridge route status

`GET /v1/status/bridge`

Public, no key, CORS open, cached for a minute: the bridge routes section of
layerhop.com/status. Per chain, whether routes into and out of it work right now (route health:
small read-only probe quotes every few hours, a direction turns `failing` after two failed
checks in a row), and per main route pair (both directions) whether it works (the source's
routes out and the destination's routes in; derived, not probed per pair). Success rate and
typical fill time come from LayerHop's own live orders over the last 7 days (`fills`, each with
its sample size `n`; under `smallSample` orders a figure says little). Fill time runs from the
transaction being built to the fill, so it includes the time a user took to sign. Also lists the
route providers with their monitor state and fills, and route incidents of the last 14 days (a
direction that turned failing and, once resolved, when it worked again).

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Bridge route status. | [BridgeStatus](#bridgestatus) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/status/bridge"
```

[Try it in the API playground →](/playground?op=getBridgeStatus)

**Example response** (`200`)

```json
{
  "status": "operational",
  "title": "All main routes are working (2 smaller chains have limited routes)",
  "generatedAt": "2026-10-26T12:00:00.000Z",
  "windowDays": 7,
  "smallSample": 20,
  "routeHealth": {
    "lastRunAt": "2026-10-26T11:10:00.000Z",
    "intervalMinutes": 120,
    "stale": false
  },
  "counts": {
    "ok": 160,
    "deposit_only": 1,
    "withdraw_only": 0,
    "unavailable": 1,
    "unknown": 4
  },
  "overall": {
    "n": 412,
    "filled": 405,
    "successRate": 0.983,
    "medianFillSeconds": 34,
    "p90FillSeconds": 140
  },
  "allTime": {
    "since": "2026-10-18T08:05:31.729Z",
    "swaps": 520,
    "swapVolumeUsd": 46675,
    "relayerFills": 842,
    "relayerVolumeUsd": 36634,
    "transactions": 1362,
    "volumeUsd": 83309
  },
  "chains": [
    {
      "chainId": 8453,
      "slug": "base",
      "name": "Base",
      "logoURI": "https://example.com/base.svg",
      "popular": true,
      "status": "ok",
      "in": "ok",
      "out": "ok",
      "checkedAt": "2026-10-26T11:10:00.000Z",
      "fills": {
        "n": 230,
        "filled": 228,
        "successRate": 0.9913,
        "medianFillSeconds": 22,
        "p90FillSeconds": 90
      }
    }
  ],
  "pairs": [
    {
      "srcChainId": 1,
      "dstChainId": 8453,
      "src": "Ethereum",
      "dst": "Base",
      "state": "ok",
      "fills": {
        "n": 40,
        "filled": 40,
        "successRate": 1,
        "medianFillSeconds": 41,
        "p90FillSeconds": 120
      }
    }
  ],
  "providers": [
    {
      "id": "relay",
      "name": "Relay",
      "status": "operational",
      "fills": {
        "n": 300,
        "filled": 297,
        "successRate": 0.99,
        "medianFillSeconds": 18,
        "p90FillSeconds": 60
      }
    }
  ],
  "incidents": [
    {
      "chainId": 14,
      "chain": "Flare",
      "direction": "out",
      "startedAt": "2026-10-24T08:00:00.000Z",
      "resolvedAt": "2026-10-25T10:00:00.000Z",
      "errorCode": "NO_ROUTE"
    }
  ]
}
```

### Get platform status

`GET /v1/status`

Public, no key, CORS open, cached for 30 seconds: the data behind status.layerhop.com. Every
component is probed each minute; `status` is `outage` when a component is down, `degraded` when
one failed its latest probe, else `operational`. Includes 90 days of daily uptime per component
and the incidents of the last 14 days.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Current status. | [StatusResponse](#statusresponse) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/status"
```

[Try it in the API playground →](/playground?op=getStatus)

**Example response** (`200`)

```json
{
  "status": "operational",
  "updatedAt": "2026-10-18T10:00:00.000Z",
  "components": [
    {
      "id": "api",
      "name": "API",
      "group": "Core",
      "status": "operational",
      "latencyMs": 84,
      "uptime90d": 99.98,
      "days": [
        {
          "date": "2026-10-18",
          "uptime": 100
        }
      ]
    },
    {
      "id": "provider:relay",
      "name": "Relay",
      "group": "Liquidity providers",
      "status": "operational",
      "latencyMs": 412,
      "uptime90d": 99.9,
      "days": [
        {
          "date": "2026-10-18",
          "uptime": 100
        }
      ]
    }
  ],
  "incidents": [
    {
      "id": "inc_01k7r1a8c4x8q6r0v3b5n7p9d",
      "componentId": "provider:relay",
      "component": "Relay",
      "title": "Relay quotes failing",
      "startedAt": "2026-10-12T08:10:00.000Z",
      "resolvedAt": "2026-10-12T08:24:00.000Z"
    }
  ],
  "url": "https://layerhop.com/status"
}
```

## Webhooks

Developer tools for webhooks with an API key: stream your account's events to your laptop (`layerhop listen`), trigger sample events in test mode (`layerhop trigger`) and resend an event (`layerhop events resend`).

### Stream your webhook events

`GET /v1/webhooks/stream`

Server-Sent Events: every webhook event of the API key's account and mode (live or test),
as it is created, as `event: event` with the exact payload your endpoints receive. This is what
`layerhop listen --forward-to <url>` uses to deliver events to your laptop without a public URL.
Events resent from the dashboard or with `POST /v1/webhooks/events/{id}/resend` arrive again
(same `id`). Pass `since` when you reconnect to first get the events created while you were
away (at most one hour back, at most 100). Streams close after 30 minutes; reconnect.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `since` | string | no | Replay events created after this time first (ISO 8601 or unix seconds; at most one hour back). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | An event stream (`event: event`). | — |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/webhooks/stream"
```

### Trigger a sample event

`POST /v1/webhooks/trigger`

Creates a realistic sample event of `type` in test mode (`livemode: false`, `sample: true`),
delivered to your test endpoints that subscribe to it and to open `listen` streams. Test keys
only, so a sample can never reach a live endpoint.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `202` | Event created. | object |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | `FORBIDDEN`: a live key; use a test key. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/webhooks/trigger" \
  -H "content-type: application/json" \
  -d '{"type":"order.filled"}'
```

[Try it in the API playground →](/playground?op=triggerWebhookEvent)

### Resend an event with an API key

`POST /v1/webhooks/events/{id}/resend`

Sends one of your account's events again with the same `id` and payload: to `endpointId`, or to
every active endpoint of the event's mode that subscribes to its type, and to open
`GET /v1/webhooks/stream` connections (`layerhop listen`). The event must be of the key's mode
and not older than 30 days (events are kept 30 days). With no matching endpoint it still
reaches open streams (`deliveries` is empty).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Event id. |

**Request body** — object

**Responses**

| Status | Description | Body |
|---|---|---|
| `202` | Queued. | [WebhookResendResult](#webhookresendresult) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/webhooks/events/evt_01m54s1b2c3d4e5f6g7h8j9k0m/resend" \
  -H "content-type: application/json" \
  -d '{}'
```

[Try it in the API playground →](/playground?op=resendWebhookEvent)

**Example response** (`202`)

```json
{
  "eventId": "evt_01m54s1b2c3d4e5f6g7h8j9k0m",
  "type": "order.filled",
  "livemode": false,
  "deliveries": [
    {
      "id": "whd_01m54s1b2c3d4e5f6g7h8j9k0n",
      "endpointId": "whe_01m54s1a2b3c4d5e6f7g8h9j0k"
    }
  ]
}
```

## Usage

Usage and errors of the API key's own account and mode, per hour or day: request counts by endpoint group and status class, p50 / p95 latency, error-code counts and the most recent failed requests. The same data as the dashboard's Usage page. Counts are rolled up in memory and written every 30 seconds, so the newest requests can take up to a minute to appear.

### Usage and latency

`GET /v1/usage`

Requests of the key's account and mode per hour or day (UTC, zero-filled), with totals, counts
per status class, p50 / p95 latency (estimated from a latency histogram), a breakdown by
endpoint group (`quote`, `orders`, `checkout`, ...; unknown paths count as `other`) and the
stable error codes returned. Defaults: the last 48 hours for `bucket=hour`, the last 30 days
for `bucket=day`. At most 800 buckets per call; data is kept 400 days.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `bucket` | `"hour"` \| `"day"` | no | Bucket size. (default `"day"`) |
| `from` | string | no | Inclusive start, ISO 8601 or unix seconds. |
| `to` | string | no | Exclusive end, ISO 8601 or unix seconds. Default now. |
| `keyId` | string | no | Only requests made with this key of your account. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The report. | [UsageReport](#usagereport) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/usage"
```

**Example response** (`200`)

```json
{
  "bucket": "day",
  "from": "2026-10-05T10:00:00.000Z",
  "to": "2026-11-04T10:00:00.000Z",
  "livemode": true,
  "keyId": "key_01m54s12va302av4ay4epqndye",
  "totals": {
    "requests": 1480,
    "errors": 21,
    "byStatusClass": {
      "2xx": 1459,
      "3xx": 0,
      "4xx": 19,
      "5xx": 2
    },
    "avgMs": 318,
    "p50Ms": 212,
    "p95Ms": 1240
  },
  "series": [
    {
      "ts": "2026-11-04T00:00:00.000Z",
      "requests": 61,
      "errors": 1,
      "byStatusClass": {
        "2xx": 60,
        "3xx": 0,
        "4xx": 1,
        "5xx": 0
      },
      "p50Ms": 198,
      "p95Ms": 1105
    }
  ],
  "byEndpoint": [
    {
      "group": "quote",
      "requests": 1210,
      "errors": 18,
      "byStatusClass": {
        "2xx": 1192,
        "3xx": 0,
        "4xx": 17,
        "5xx": 1
      },
      "avgMs": 352,
      "p50Ms": 240,
      "p95Ms": 1320
    }
  ],
  "errorCodes": [
    {
      "code": "NO_ROUTE",
      "count": 12,
      "byEndpoint": {
        "quote": 12
      }
    }
  ]
}
```

### Recent errors

`GET /v1/usage/errors`

The newest failed requests of the key's account and mode that returned a stable error code
(last 30 days): code, endpoint, status, time and `requestId` (quote it to support).

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `code` | string | no | Only this error code. |
| `keyId` | string | no | Only requests made with this key of your account. |
| `limit` | integer | no | Number of rows. (default `50`) (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Newest first. | [UsageErrorList](#usageerrorlist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/usage/errors"
```

**Example response** (`200`)

```json
{
  "livemode": true,
  "errors": [
    {
      "ts": "2026-11-04T09:58:12.120Z",
      "keyId": "key_01m54s12va302av4ay4epqndye",
      "requestId": "0d5e1f6a-3b2c-4d1e-8f9a-7b6c5d4e3f21",
      "method": "GET",
      "path": "/v1/quote",
      "endpointGroup": "quote",
      "status": 404,
      "code": "NO_ROUTE",
      "latencyMs": 812
    }
  ]
}
```

## Auth

Wallet sign-in (SIWE for EVM, the same message format for Solana) for the developer dashboard. Sets an HttpOnly `lh_session` cookie. These routes exist only when the operator runs the API with a database (`DATABASE_URL`); otherwise they return 404.

### Get a sign-in message

`POST /v1/auth/nonce`

Step 1 of wallet sign-in for the developer dashboard. Returns a single-use nonce and the exact
message to sign: EIP-4361 (Sign-In with Ethereum) text for EVM wallets, the same layout for
Solana. The message expires after 10 minutes.

**Request body** — [NonceRequest](#noncerequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The message to sign. | [NonceResponse](#nonceresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The operator runs the API without a database, so platform routes are off (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/auth/nonce" \
  -H "content-type: application/json" \
  -d '{"vm":"evm","address":"0x1111111111111111111111111111111111111111"}'
```

**Example response** (`200`)

```json
{
  "nonce": "4fQx9LmZ2pT7cV1aB",
  "message": "dashboard.layerhop.com wants you to sign in with your Ethereum account:\n0x1111111111111111111111111111111111111111\n\nSign in to the LayerHop developer dashboard.\n\nURI: https://dashboard.layerhop.com\nVersion: 1\nChain ID: 1\nNonce: 4fQx9LmZ2pT7cV1aB\nIssued At: 2026-10-17T10:00:00.000Z\nExpiration Time: 2026-10-17T10:10:00.000Z",
  "expiresAt": "2026-10-17T10:10:00.000Z"
}
```

### Verify the signature and sign in

`POST /v1/auth/verify`

Step 2. Send back the message from `POST /v1/auth/nonce` unchanged with the wallet's signature
(EVM: hex `personal_sign`; Solana: ed25519 `signMessage`, base58 or base64). On success the
account is found or created for this wallet and the `lh_session` cookie is set (HttpOnly,
Secure, SameSite=Lax, 7 days). The nonce is consumed even when verification fails.

**Request body** — [VerifyRequest](#verifyrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Signed in. The response sets the `lh_session` cookie. | [VerifyResponse](#verifyresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The operator runs the API without a database, so platform routes are off (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/auth/verify" \
  -H "content-type: application/json" \
  -d '{"vm":"evm","message":"dashboard.layerhop.com wants you to sign in with your Ethereum account:\n…","signature":"0x5c1a…1b"}'
```

**Example response** (`200`)

```json
{
  "account": {
    "id": "acc_01m54s12tq01zx09z5jr07jxg1",
    "createdAt": "2026-10-17T10:00:05.000Z"
  }
}
```

### Current account

`GET /v1/auth/me`

The signed-in account, its wallets and its partner profile (or `null`).

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The session's account. | [MeResponse](#meresponse) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/auth/me"
```

**Example response** (`200`)

```json
{
  "account": {
    "id": "acc_01m54s12tq01zx09z5jr07jxg1",
    "createdAt": "2026-10-17T10:00:05.000Z"
  },
  "wallets": [
    {
      "vm": "evm",
      "address": "0x1111111111111111111111111111111111111111",
      "createdAt": "2026-10-17T10:00:05.000Z"
    }
  ],
  "partner": {
    "id": "myapp",
    "name": "My App",
    "feeBps": 20,
    "maxFeeBps": 50,
    "payoutEvm": "0x1111111111111111111111111111111111111111",
    "status": "active",
    "createdAt": "2026-10-17T10:05:00.000Z"
  }
}
```

### Sign out

`POST /v1/auth/logout`

Clears the `lh_session` cookie.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Signed out. | [OkResponse](#okresponse) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/auth/logout"
```

**Example response** (`200`)

```json
{
  "ok": true
}
```

## Dashboard

Developer dashboard: API keys, usage, request logs, orders, webhooks and the partner profile. Every route needs the `lh_session` cookie (401 otherwise). Browser calls must come from the dashboard origin with `credentials: "include"`; writes from any other `Origin` get `FORBIDDEN`. Resources of other accounts return `NOT_FOUND`.

### List products

`GET /v1/dashboard/checkout/products`

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of products. | object |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/checkout/products"
```

### Create a product

`POST /v1/dashboard/checkout/products`

`CheckoutProductCreateRequest` plus `mode` (`live` or `test`).

**Request body** — [CheckoutProductCreateRequest](#checkoutproductcreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Product created. | [CheckoutProduct](#checkoutproduct) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/checkout/products" \
  -H "content-type: application/json" \
  -d '{}'
```

### Update a product

`PATCH /v1/dashboard/checkout/products/{id}`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Product id. |

**Request body** — [CheckoutProductCreateRequest](#checkoutproductcreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The updated product. | [CheckoutProduct](#checkoutproduct) |

**Example request**

```bash
curl -X PATCH "https://api.layerhop.com/v1/dashboard/checkout/products/prod_01m57hq2c4x8q6r0v3b5n7p9d" \
  -H "content-type: application/json" \
  -d '{}'
```

### Update the account

`PATCH /v1/dashboard/account`

Optional display name and contact email (not used for sign-in). Send `null` to clear a field.

**Request body** — [AccountUpdateRequest](#accountupdaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The account. | [VerifyResponse](#verifyresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl -X PATCH "https://api.layerhop.com/v1/dashboard/account" \
  -H "content-type: application/json" \
  -d '{"displayName":"Acme Wallet","email":"dev@acme.example"}'
```

### Address screening setting

`GET /v1/dashboard/screening`

Whether the account refuses sanctioned addresses (D-069), whether the deployment enforces it for everyone, and the loaded list version.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The setting. | [ScreeningSettings](#screeningsettings) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/screening"
```

### Opt in to blocking sanctioned addresses

`PUT /v1/dashboard/screening`

`block: true`: quotes and orders made with this account's API keys, its deposit addresses and its
checkout sessions (payout address and payers) answer `ADDRESS_SANCTIONED` when an address is on
the OFAC SDN list, even while the deployment only annotates. Takes effect within a minute.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The setting. | [ScreeningSettings](#screeningsettings) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl -X PUT "https://api.layerhop.com/v1/dashboard/screening" \
  -H "content-type: application/json" \
  -d '{"block":true}'
```

### Link another wallet

`POST /v1/dashboard/wallets`

Links another wallet to the signed-in account. Get a message from `POST /v1/auth/nonce` for the
new wallet, sign it with that wallet, and send the same body as `POST /v1/auth/verify`.
`CONFLICT` if the wallet already belongs to another account.

**Request body** — [VerifyRequest](#verifyrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The account's wallets. | [WalletsResponse](#walletsresponse) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/wallets" \
  -H "content-type: application/json" \
  -d '{"vm":"svm","message":"dashboard.layerhop.com wants you to sign in with your Solana account:\n…","signature":"3Bv7…base58"}'
```

**Example response** (`200`)

```json
{
  "wallets": [
    {
      "vm": "evm",
      "address": "0x1111111111111111111111111111111111111111",
      "createdAt": "2026-10-17T10:00:05.000Z"
    },
    {
      "vm": "svm",
      "address": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
      "createdAt": "2026-10-17T10:02:00.000Z"
    }
  ]
}
```

### 30-day overview

`GET /v1/dashboard/overview`

Totals for the last 30 days: API requests and errors made with this account's keys, quotes,
orders built and filled, filled volume per source token, and (for partners) fee earnings.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Overview. | [Overview](#overview) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/overview"
```

**Example response** (`200`)

```json
{
  "from": "2026-09-17T10:00:00.000Z",
  "to": "2026-10-17T10:00:00.000Z",
  "requests": 1520,
  "errors": 12,
  "quotes": 1311,
  "orders": {
    "built": 42,
    "filled": 39,
    "byStatus": {
      "filled": 39,
      "submitted": 1,
      "expired": 2
    }
  },
  "volume": [
    {
      "srcChainId": 8453,
      "srcToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "orders": 39,
      "amount": "3900000000"
    }
  ],
  "activeKeys": 2
}
```

### List API keys

`GET /v1/dashboard/keys`

Every key of the account, newest first, including revoked ones. Secrets are never returned.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Keys. | [ApiKeyList](#apikeylist) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/keys"
```

**Example response** (`200`)

```json
{
  "keys": [
    {
      "id": "key_01m54s12va302av4ay4epqndye",
      "name": "production",
      "prefix": "lh_live_7Hq2",
      "rateLimitRpm": 120,
      "createdAt": "2026-10-17T10:01:00.000Z",
      "lastUsedAt": "2026-10-17T11:20:00.000Z"
    }
  ]
}
```

### Create an API key

`POST /v1/dashboard/keys`

Returns the key's plaintext `secret` (`lh_live_` or, with `mode: test`, `lh_test_` + 32
characters) **once**. LayerHop stores only its SHA-256 hash. At most 20 active keys per account.
New keys get 120 requests/minute. Test keys never reach a real provider (see the `ApiKey`
security scheme).

**Request body** — [ApiKeyCreateRequest](#apikeycreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Created. Store the secret now. | [ApiKeyCreated](#apikeycreated) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/keys" \
  -H "content-type: application/json" \
  -d '{"name":"staging","mode":"test"}'
```

**Example response** (`201`)

```json
{
  "key": {
    "id": "key_01m54s12va302av4ay4epqndye",
    "name": "production",
    "prefix": "lh_live_7Hq2",
    "rateLimitRpm": 120,
    "createdAt": "2026-10-17T10:01:00.000Z"
  },
  "secret": "lh_live_7Hq2mX9pLr4TcV8bN1wQ6zKs3dF5gJ0a"
}
```

### Rename an API key

`PATCH /v1/dashboard/keys/{id}`

Only the name can be changed here; rate limits are set by LayerHop.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Key id. |

**Request body** — [ApiKeyNameRequest](#apikeynamerequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The updated key. | [ApiKeyResponse](#apikeyresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X PATCH "https://api.layerhop.com/v1/dashboard/keys/key_01m54s12va302av4ay4epqndye" \
  -H "content-type: application/json" \
  -d '{"name":"staging"}'
```

### Revoke an API key

`DELETE /v1/dashboard/keys/{id}`

The key stops working immediately on this API instance (and within 60 s everywhere).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Key id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The revoked key. | [ApiKeyResponse](#apikeyresponse) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X DELETE "https://api.layerhop.com/v1/dashboard/keys/key_01m54s12va302av4ay4epqndye"
```

### Usage time series

`GET /v1/dashboard/usage`

Request counts per hour or day (UTC), gap-filled with zeros. Defaults: the last 24 hours for
`bucket=hour`, the last 30 days for `bucket=day`. At most 800 buckets per call.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `from` | string | no | Inclusive start, ISO 8601 or unix seconds. |
| `to` | string | no | Exclusive end, ISO 8601 or unix seconds. Default now. |
| `keyId` | string | no | Only requests made with this key. |
| `bucket` | `"hour"` \| `"day"` | no | Bucket size. (default `"hour"`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The series. | [UsageResponse](#usageresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/usage"
```

**Example response** (`200`)

```json
{
  "bucket": "hour",
  "from": "2026-10-16T10:00:00.000Z",
  "to": "2026-10-17T10:00:00.000Z",
  "series": [
    {
      "ts": "2026-10-17T09:00:00.000Z",
      "requests": 61,
      "errors": 1,
      "quotes": 55,
      "orders": 3
    }
  ]
}
```

### Usage by endpoint, status and latency

`GET /v1/dashboard/usage/stats`

The same report as `GET /v1/usage`, for the signed-in account and `mode`.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `bucket` | `"hour"` \| `"day"` | no | Bucket size. (default `"day"`) |
| `from` | string | no | Inclusive start, ISO 8601 or unix seconds. |
| `to` | string | no | Exclusive end, ISO 8601 or unix seconds. Default now. |
| `keyId` | string | no | Only requests made with this key. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The report. | [UsageReport](#usagereport) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/usage/stats"
```

### Recent errors (dashboard)

`GET /v1/dashboard/usage/errors`

The same list as `GET /v1/usage/errors`, for the signed-in account and `mode`.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `code` | string | no | Only this error code. |
| `keyId` | string | no | Only requests made with this key. |
| `limit` | integer | no | Number of rows. (default `50`) (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Newest first. | [UsageErrorList](#usageerrorlist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/usage/errors"
```

### Request logs

`GET /v1/dashboard/logs`

Requests made with this account's keys, newest first (kept 30 days).

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `keyId` | string | no | Only requests made with this key. |
| `status` | string | no | An exact code (`429`), a class (`4xx`), or `error` (any status >= 400). |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | Page size. (default `50`) (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | One page of log rows. | [RequestLogList](#requestloglist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/logs"
```

**Example response** (`200`)

```json
{
  "logs": [
    {
      "id": "1042",
      "ts": "2026-10-17T09:59:58.120Z",
      "keyId": "key_01m54s12va302av4ay4epqndye",
      "requestId": "0d5e1f6a-3b2c-4d1e-8f9a-7b6c5d4e3f21",
      "method": "GET",
      "path": "/v1/quote",
      "query": {
        "srcChain": "base",
        "dstChain": "solana"
      },
      "status": 200,
      "latencyMs": 412,
      "provider": "relay"
    }
  ],
  "nextCursor": "MjAyNi0xMC0xN1QwOTo1OTo1OC4xMjBafDEwNDI"
}
```

### Account orders

`GET /v1/dashboard/orders`

Orders built with this account's keys, newest first, with attribution fields.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `status` | [OrderLifecycleStatus](#orderlifecyclestatus) | no | Only orders with this status. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | Page size. (default `50`) (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | One page of orders. | [AccountOrderList](#accountorderlist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/orders"
```

### List webhook endpoints

`GET /v1/dashboard/webhooks`

The account's endpoints. Signing secrets are only shown at creation.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Endpoints. | [WebhookList](#webhooklist) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/webhooks"
```

**Example response** (`200`)

```json
{
  "webhooks": [
    {
      "id": "whe_01m54s1a2b3c4d5e6f7g8h9j0k",
      "url": "https://example.com/layerhop",
      "events": [
        "order.filled",
        "order.failed"
      ],
      "active": true,
      "createdAt": "2026-10-17T10:03:00.000Z"
    }
  ]
}
```

### Create a webhook endpoint

`POST /v1/dashboard/webhooks`

`url` must be public `https`. `events` empty or omitted = every order event. Returns the
signing `secret` (`whsec_…`) once. Deliveries carry
`LayerHop-Signature: t=<unix>,v1=<hex HMAC-SHA256(secret, "<t>.<raw body>")>`. At most 10 endpoints.

**Request body** — [WebhookCreateRequest](#webhookcreaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Created. Store the secret now. | [WebhookCreated](#webhookcreated) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/webhooks" \
  -H "content-type: application/json" \
  -d '{"url":"https://example.com/layerhop","events":["order.filled","order.failed"]}'
```

**Example response** (`201`)

```json
{
  "webhook": {
    "id": "whe_01m54s1a2b3c4d5e6f7g8h9j0k",
    "url": "https://example.com/layerhop",
    "events": [
      "order.filled",
      "order.failed"
    ],
    "active": true,
    "createdAt": "2026-10-17T10:03:00.000Z"
  },
  "secret": "whsec_Z8kQ1mN4pR7tV0xB3dF6hJ9lC2eG5iK8"
}
```

### Update a webhook endpoint

`PATCH /v1/dashboard/webhooks/{id}`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Endpoint id. |

**Request body** — [WebhookUpdateRequest](#webhookupdaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The updated endpoint. | [WebhookResponse](#webhookresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X PATCH "https://api.layerhop.com/v1/dashboard/webhooks/whe_01m54s1a2b3c4d5e6f7g8h9j0k" \
  -H "content-type: application/json" \
  -d '{"active":false}'
```

### Delete a webhook endpoint

`DELETE /v1/dashboard/webhooks/{id}`

Deletes the endpoint and its delivery history.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Endpoint id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Deleted. | [OkResponse](#okresponse) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X DELETE "https://api.layerhop.com/v1/dashboard/webhooks/whe_01m54s1a2b3c4d5e6f7g8h9j0k"
```

**Example response** (`200`)

```json
{
  "ok": true
}
```

### Send a test event

`POST /v1/dashboard/webhooks/{id}/test`

Queues an event for this endpoint only: `webhook.test` by default, or a realistic sample of any
event type (`sample: true` in the payload, `livemode` of the endpoint). Delivery is asynchronous
(within seconds).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Endpoint id. |

**Request body** — object

**Responses**

| Status | Description | Body |
|---|---|---|
| `202` | Queued. | [WebhookTestResponse](#webhooktestresponse) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/webhooks/whe_01m54s1a2b3c4d5e6f7g8h9j0k/test" \
  -H "content-type: application/json" \
  -d '{"type":"checkout.session.completed"}'
```

**Example response** (`202`)

```json
{
  "eventId": "evt_01m54s1b2c3d4e5f6g7h8j9k0m",
  "deliveryId": "whd_01m54s1b2c3d4e5f6g7h8j9k0n"
}
```

### List deliveries

`GET /v1/dashboard/webhooks/{id}/deliveries`

Deliveries to this endpoint, newest first: event type and id, attempt count, status, response
code, the first 2 KB of the response body, latency and the next retry. Events and their
deliveries are kept 30 days.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Endpoint id. |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | `"pending"` \| `"success"` \| `"failed"` | no | Only deliveries in this state. |
| `eventType` | string | no | Only this event type (or `webhook.test`). |
| `from` | string | no | Created at or after (ISO 8601 or unix seconds). |
| `to` | string | no | Created before (ISO 8601 or unix seconds). |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | Page size. (default `50`) (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | One page of deliveries. | [WebhookDeliveryList](#webhookdeliverylist) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/webhooks/whe_01m54s1a2b3c4d5e6f7g8h9j0k/deliveries"
```

**Example response** (`200`)

```json
{
  "deliveries": [
    {
      "id": "whd_01m54s1b2c3d4e5f6g7h8j9k0n",
      "endpointId": "whe_01m54s1a2b3c4d5e6f7g8h9j0k",
      "eventId": "evt_01m54s1b2c3d4e5f6g7h8j9k0m",
      "eventType": "webhook.test",
      "attempt": 1,
      "status": "success",
      "responseCode": 200,
      "responseSnippet": "ok",
      "createdAt": "2026-10-17T10:04:00.000Z",
      "deliveredAt": "2026-10-17T10:04:02.000Z"
    }
  ],
  "nextCursor": "MjAyNi0xMC0xN1QxMDowNDowMC4wMDBafHdoZF8wMW01NHMxYjJj"
}
```

### Rotate the signing secret

`POST /v1/dashboard/webhooks/{id}/rotate-secret`

Issues a new `whsec_` secret (shown once). For `graceHours` (default 24, 0 = none, max 168) the
old secret keeps signing too: the `LayerHop-Signature` header carries two `v1` values, so
receivers verify with either while you update yours.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Endpoint id. |

**Request body** — object

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The new secret. | object |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/webhooks/whe_01m54s1a2b3c4d5e6f7g8h9j0k/rotate-secret" \
  -H "content-type: application/json" \
  -d '{"graceHours":24}'
```

### Get one delivery

`GET /v1/dashboard/webhooks/{id}/deliveries/{deliveryId}`

The delivery with the request that was sent (URL, headers, exact body) and the event.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Endpoint id. |
| `deliveryId` | string | yes | Delivery id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The delivery. | object |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/webhooks/whe_01m54s1a2b3c4d5e6f7g8h9j0k/deliveries/whd_01m54s1b2c3d4e5f6g7h8j9k0n"
```

### Endpoint health

`GET /v1/dashboard/webhooks/{id}/stats`

Deliveries in the last 24 hours and 7 days (success, failed, pending, success rate, average and p95 latency), last success and failure.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Endpoint id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Stats. | object |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/webhooks/whe_01m54s1a2b3c4d5e6f7g8h9j0k/stats"
```

### List events

`GET /v1/dashboard/events`

Every webhook event of your account (newest first) with a delivery summary.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `type` | string | no | Only events of this type. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–100, default 50. (1–100) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of events. | object |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/events"
```

### Get an event

`GET /v1/dashboard/events/{id}`

The event payload and every delivery of it.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Event id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The event. | object |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/events/evt_01m54s1b2c3d4e5f6g7h8j9k0m"
```

### Resend an event

`POST /v1/dashboard/events/{id}/resend`

Queues the event again for one endpoint (`endpointId`, same mode) or for every active endpoint of its mode that subscribes to its type.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Event id. |

**Request body** — object

**Responses**

| Status | Description | Body |
|---|---|---|
| `202` | Queued. | object |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/events/evt_01m54s1b2c3d4e5f6g7h8j9k0m/resend" \
  -H "content-type: application/json" \
  -d '{}'
```

[Try it in the API playground →](/playground?op=resendWebhookEvent)

### Replay a delivery

`POST /v1/dashboard/webhooks/{id}/deliveries/{deliveryId}/replay`

Queues a new delivery of the same event to this endpoint (the original row is kept).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Endpoint id. |
| `deliveryId` | string | yes | Delivery id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `202` | Queued. | [WebhookDeliveryResponse](#webhookdeliveryresponse) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/webhooks/whe_01m54s1a2b3c4d5e6f7g8h9j0k/deliveries/whd_01m54s1b2c3d4e5f6g7h8j9k0n/replay"
```

### Partner profile

`GET /v1/dashboard/partner`

The account's partner (integrator) profile, or `null`.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Profile or null. | [PartnerProfileResponse](#partnerprofileresponse) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/partner"
```

### Apply as a partner

`POST /v1/dashboard/partner`

Creates the account's partner profile. `id` is the public label used as `integrator=<id>`.
The profile is `active` at once with a starter `maxFeeBps` (50 bps by default) and `feeBps` 0:
set your fee with `PATCH` to start earning. LayerHop can raise the cap or suspend a profile.
When the operator turns instant activation off, the profile starts `pending` instead.
One profile per account.

**Request body** — [PartnerApplyRequest](#partnerapplyrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Created (`active`, or `pending` under manual review). | [PartnerProfileResponse](#partnerprofileresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/partner" \
  -H "content-type: application/json" \
  -d '{"id":"myapp","name":"My App","payoutEvm":"0x1111111111111111111111111111111111111111"}'
```

### Update the partner profile

`PATCH /v1/dashboard/partner`

`feeBps` must be <= `maxFeeBps`. At least one payout address must remain.

**Request body** — [PartnerUpdateRequest](#partnerupdaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The updated profile. | [PartnerProfileResponse](#partnerprofileresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X PATCH "https://api.layerhop.com/v1/dashboard/partner" \
  -H "content-type: application/json" \
  -d '{"feeBps":25}'
```

### Partner earnings

`GET /v1/dashboard/earnings`

Partner fee estimates (input-token base units) per source token and per month (UTC), from orders
carrying this partner's fee. `filled` orders are confirmed; `unconfirmed` = built, submitted or
pending. Default range: the last 365 days. Payouts are reconciled by LayerHop.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `from` | string | no | Inclusive start, ISO 8601 or unix seconds. |
| `to` | string | no | Inclusive end, ISO 8601 or unix seconds. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Earnings. | [EarningsResponse](#earningsresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/earnings"
```

**Example response** (`200`)

```json
{
  "partner": "myapp",
  "from": "2025-10-17T10:00:00.000Z",
  "to": "2026-10-17T10:00:00.000Z",
  "basis": "estimate",
  "byToken": [
    {
      "srcChainId": 8453,
      "srcToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "filled": {
        "orders": 39,
        "partnerFee": "7800000"
      },
      "unconfirmed": {
        "orders": 3,
        "partnerFee": "600000"
      }
    }
  ],
  "byMonth": [
    {
      "month": "2026-10",
      "srcChainId": 8453,
      "srcToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "filled": {
        "orders": 39,
        "partnerFee": "7800000"
      },
      "unconfirmed": {
        "orders": 3,
        "partnerFee": "600000"
      }
    }
  ]
}
```

### Export the account's orders as CSV

`GET /v1/dashboard/orders.csv`

The account's filled orders (made with its API keys or dashboard), filled in [`from`, `to`)
(default: the last 365 days), as CSV with both legs matched. Same columns and formats as
`GET /v1/portfolio/trades.csv` (`raw`, `koinly`, `cointracker`). `mode=test` exports test-mode
orders.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `format` | `"raw"` \| `"koinly"` \| `"cointracker"` | no | (default `"raw"`) |
| `mode` | `"live"` \| `"test"` | no | (default `"live"`) |
| `from` | string | no | Inclusive start, ISO 8601 or unix seconds. |
| `to` | string | no | Exclusive end, ISO 8601 or unix seconds. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The CSV, as an attachment download. | — |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/orders.csv"
```

### Partner statement (CSV)

`GET /v1/dashboard/earnings/statement.csv`

A CSV download of filled live orders that carried this partner's fee (`type` = `earning`) and
the payouts LayerHop recorded (`type` = `payout`, negative `partner_fee`), oldest first.
Columns: `type,date,reference,provider,chain_id,token,amount_in,fee_bps,partner_fee,tx_hash,status`.
Amounts are base units of `token`. Default range: the last 365 days.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `from` | string | no | Inclusive start, ISO 8601 or unix seconds. |
| `to` | string | no | Inclusive end, ISO 8601 or unix seconds. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The statement. | — |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/earnings/statement.csv"
```

### Partner balances and payouts

`GET /v1/dashboard/payouts`

What LayerHop owes this partner per token, and the payouts recorded so far. `earned` sums partner
fees of filled live orders, `paid` sums recorded payouts, `owed` = `earned` - `paid`. LayerHop
collects partner fees in its fee wallets and pays them out to the profile's payout addresses.
Test mode always returns empty lists (test earnings are never paid out).

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Balances and payout history. | [PayoutsResponse](#payoutsresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/payouts"
```

**Example response** (`200`)

```json
{
  "partner": "myapp",
  "balances": [
    {
      "chainId": 8453,
      "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "earned": "7800000",
      "paid": "5000000",
      "owed": "2800000",
      "decimals": 6,
      "owedUsd": 2.8
    }
  ],
  "payouts": [
    {
      "id": "po_01hxexample",
      "partnerId": "myapp",
      "chainId": 8453,
      "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "5000000",
      "toAddress": "0x1111111111111111111111111111111111111111",
      "txHash": "0xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd",
      "note": "September",
      "paidAt": "2026-10-01T12:00:00.000Z",
      "createdAt": "2026-10-01T12:00:05.000Z"
    }
  ]
}
```

### List checkout sessions

`GET /v1/dashboard/checkout/sessions`

The same list as `GET /v1/checkout/sessions`, with the dashboard session and `mode`.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `status` | [CheckoutStatus](#checkoutstatus) | no | Only sessions with this status. |
| `productId` | string | no | Only sessions started from this product. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–100, default 50. (1–100) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of sessions. | [CheckoutSessionList](#checkoutsessionlist) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/checkout/sessions"
```

### Create a payment link

`POST /v1/dashboard/checkout/sessions`

Creates a checkout session from the dashboard: the `CheckoutSessionCreateRequest` body plus `mode` (`live` or `test`).

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Session created. | [CheckoutSession](#checkoutsession) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/checkout/sessions" \
  -H "content-type: application/json" \
  -d '{"amount":"49000000","settleChain":"base","settleToken":"USDC","recipient":"0x2222222222222222222222222222222222222222","description":"Pro plan, 1 month","mode":"test"}'
```

### Get a payment link

`GET /v1/dashboard/checkout/sessions/{id}`

One of your sessions (either mode), with reference, metadata, `refundedAmount` and `invoiceId`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The session. | [CheckoutSession](#checkoutsession) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/checkout/sessions/cs_test_01k7t9m2c4x8q6r0v3b5n7p9d"
```

### Expire a payment link

`POST /v1/dashboard/checkout/sessions/{id}/expire`

Expires one of your `open` sessions.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The expired session. | [CheckoutSession](#checkoutsession) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/checkout/sessions/cs_test_01k7t9m2c4x8q6r0v3b5n7p9d/expire"
```

### List x402 payments

`GET /v1/dashboard/x402/payments`

The same list as `GET /v1/x402/payments`, with the dashboard session.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | `"submitted"` \| `"settled"` \| `"failed"` | no | Only payments with this status. |
| `network` | string | no | Only payments on this network: `base`, `optimism`, `arbitrum`, `polygon`, a CAIP-2 id (`eip155:8453`) or a chain id. |
| `from` | string | no | Only payments created at or after this time (ISO 8601 or unix seconds). |
| `to` | string | no | Only payments created before this time (ISO 8601 or unix seconds). |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–200, default 50. (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of payments. | [X402PaymentList](#x402paymentlist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/x402/payments"
```

### Get an x402 payment

`GET /v1/dashboard/x402/payments/{id}`

The same as `GET /v1/x402/payments/{id}`, with the dashboard session.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Payment id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The payment. | [X402Payment](#x402payment) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/x402/payments/x402_01k7t9m2c4x8q6r0v3b5n7p9d"
```

### x402 summary

`GET /v1/dashboard/x402/summary`

For the dashboard's x402 page: whether settlement is enabled on this API (`settle`, false while
x402 is in preview), the networks with a deposit contract, settled payments over the last 24 hours
and 7 days (by settle time), and the account's x402 deposit addresses (newest 100).

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Summary. | [X402Summary](#x402summary) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/x402/summary"
```

**Example response** (`200`)

```json
{
  "settle": false,
  "networks": [
    {
      "network": "eip155:8453",
      "name": "base",
      "chainId": 8453
    }
  ],
  "settled": {
    "24h": {
      "count": 12,
      "amount": "120300",
      "merchantAmount": "120000"
    },
    "7d": {
      "count": 80,
      "amount": "802000",
      "merchantAmount": "800000"
    }
  },
  "payees": []
}
```

### List a session's refunds

`GET /v1/dashboard/checkout/sessions/{id}/refunds`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The refunds. | [RefundList](#refundlist) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/checkout/sessions/cs_01k7t9m2c4x8q6r0v3b5n7p9d/refunds"
```

### Refund a paid session

`POST /v1/dashboard/checkout/sessions/{id}/refunds`

The same as `POST /v1/checkout/sessions/{id}/refunds`, with the dashboard session; the dashboard then asks your connected wallet to sign the refund.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Session id. |

**Request body** — [RefundCreateRequest](#refundcreaterequest)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Refund created. | [RefundCreateResponse](#refundcreateresponse) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/checkout/sessions/cs_01k7t9m2c4x8q6r0v3b5n7p9d/refunds" \
  -H "content-type: application/json" \
  -d '{}'
```

### Checkout analytics

`GET /v1/dashboard/checkout/analytics`

Revenue of sessions created in `[from, to)` (default the last 30 days, at most 366 days): totals,
revenue per UTC day, by the token and chain customers paid with, and by settlement. Settlement
tokens are USD stablecoins, so amounts are summed as USD.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `from` | string | no | Start (ISO 8601 or unix seconds). Default `to` minus 30 days. |
| `to` | string | no | End, exclusive (ISO 8601 or unix seconds). Default now. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The analytics. | [CheckoutAnalytics](#checkoutanalytics) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/checkout/analytics"
```

### Export sessions as CSV

`GET /v1/dashboard/checkout/analytics/sessions.csv`

Sessions created in `[from, to)` as a CSV download (at most 50,000 rows, newest first) with the
columns `id, created_at, status, amount, currency, settlement_chain, amount_usd, refunded,
description, reference, product_id, invoice_id, payer, paid_with_chain, paid_with_token,
paid_with_amount, src_tx_hash, dst_tx_hash, paid_at, livemode`. `status=paid` exports payments only.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `from` | string | no | Start (ISO 8601 or unix seconds). Default `to` minus 30 days. |
| `to` | string | no | End, exclusive (ISO 8601 or unix seconds). Default now. |
| `status` | [CheckoutStatus](#checkoutstatus) | no | Only sessions with this status. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The CSV file. | — |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/checkout/analytics/sessions.csv"
```

### Monthly statement

`GET /v1/dashboard/statements`

One calendar month (UTC) of what the account received through checkout: paid sessions (one-off,
invoice and subscription payments) by the time they were confirmed, minus refunds completed in
that month. Amounts are integer base units of the settlement token (refunds negative); USD counts
USDC and USDT 1:1, rounded to cents. Fees (LayerHop and provider, as recorded on each payment's
order) were paid by the customer on top of the amount due, so they are listed but not deducted:
`netUsd = grossUsd - refundsUsd`. `format=csv` returns every line (one row per payment or refund)
with the columns `type, date_utc, id, session_id, source, invoice_number, subscription_id,
reference, description, chain, chain_id, token, symbol, amount, amount_base, amount_usd,
counterparty, paid_with_chain_id, paid_with_token, paid_with_amount_base, layerhop_fee_chain_id,
layerhop_fee_token, layerhop_fee_base, layerhop_fee_usd, provider_fee_usd, tx_hash`;
`format=pdf` a short statement (totals, per-token table, the first 60 lines). JSON lists at most
5,000 lines (`linesTruncated`). Not the partner statement (`/v1/dashboard/earnings/statement.csv`).

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `month` | string | no | `YYYY-MM` (UTC), 2024-01 or later, not in the future. Default the current month. (pattern `^\d{4}-(0[1-9]\|1[0-2])$`) |
| `format` | `"json"` \| `"csv"` \| `"pdf"` | no | Default `json`. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The statement (JSON), or the CSV / PDF file (`attachment; filename="layerhop-statement-2026-09.csv"`, `-test` suffix in test mode). | [MerchantStatement](#merchantstatement) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/statements"
```

**Example response** (`200`)

```json
{
  "object": "statement",
  "account": {
    "id": "acc_01jdemo7k2",
    "name": "Nova Labs"
  },
  "month": "2026-09",
  "mode": "live",
  "livemode": true,
  "from": "2026-09-01T00:00:00.000Z",
  "to": "2026-10-01T00:00:00.000Z",
  "currency": "USD",
  "notes": [
    "Payments count in the month they were confirmed, refunds in the month they completed (UTC)."
  ],
  "totals": {
    "payments": 2,
    "refunds": 1,
    "grossUsd": 150,
    "feesUsd": 0.31,
    "layerhopFeesUsd": 0.25,
    "providerFeesUsd": 0.06,
    "feesUnknown": 0,
    "refundsUsd": 20,
    "netUsd": 130
  },
  "byToken": [
    {
      "chainId": 8453,
      "chain": "Base",
      "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "symbol": "USDC",
      "decimals": 6,
      "payments": 2,
      "refunds": 1,
      "gross": "150000000",
      "refunded": "20000000",
      "net": "130000000",
      "grossUsd": 150,
      "refundsUsd": 20,
      "netUsd": 130,
      "feesUsd": 0.31
    }
  ],
  "lines": [
    {
      "type": "payment",
      "at": "2026-09-03T10:12:00.000Z",
      "id": "cs_01j9x",
      "sessionId": "cs_01j9x",
      "source": "invoice",
      "invoiceId": "inv_01j9",
      "invoiceNumber": "INV-0007",
      "reference": "INV-0007",
      "description": "Invoice INV-0007",
      "chainId": 8453,
      "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "symbol": "USDC",
      "decimals": 6,
      "amount": "100000000",
      "amountUsd": 100,
      "counterparty": "0x1111111111111111111111111111111111111111",
      "paidWith": {
        "chainId": 8453,
        "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "amount": "100250000"
      },
      "layerhopFee": {
        "chainId": 8453,
        "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "amount": "250000",
        "usd": 0.25
      },
      "providerFeeUsd": 0,
      "txHash": "0xabc"
    },
    {
      "type": "refund",
      "at": "2026-09-20T08:00:00.000Z",
      "id": "re_01ja",
      "sessionId": "cs_01j8",
      "source": "checkout",
      "reference": "order-42",
      "description": "Hoodie",
      "chainId": 8453,
      "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "symbol": "USDC",
      "decimals": 6,
      "amount": "-20000000",
      "amountUsd": -20,
      "counterparty": "0x1111111111111111111111111111111111111111",
      "txHash": "0xdef"
    }
  ],
  "lineCount": 2,
  "linesTruncated": false,
  "complete": true
}
```

### List invoices

`GET /v1/dashboard/invoices`

The same list as `GET /v1/invoices`, with the dashboard session and `mode`.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `status` | [InvoiceStatus](#invoicestatus) | no | Only invoices with this status. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–100, default 50. (1–100) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of invoices. | [InvoiceList](#invoicelist) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/invoices"
```

### Create an invoice

`POST /v1/dashboard/invoices`

`InvoiceCreateRequest` plus `mode` (`live` or `test`).

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Invoice created. | [Invoice](#invoice) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/invoices" \
  -H "content-type: application/json" \
  -d '{}'
```

### Get an invoice

`GET /v1/dashboard/invoices/{id}`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Invoice id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The invoice. | [Invoice](#invoice) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/invoices/inv_test_01k7v0c2c4x8q6r0v3b5n7p9d"
```

### Update a draft invoice

`PATCH /v1/dashboard/invoices/{id}`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Invoice id. |

**Request body** — [InvoiceUpdateRequest](#invoiceupdaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The updated invoice. | [Invoice](#invoice) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X PATCH "https://api.layerhop.com/v1/dashboard/invoices/inv_test_01k7v0c2c4x8q6r0v3b5n7p9d" \
  -H "content-type: application/json" \
  -d '{}'
```

### Send an invoice

`POST /v1/dashboard/invoices/{id}/send`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Invoice id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The open invoice. | [Invoice](#invoice) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/invoices/inv_test_01k7v0c2c4x8q6r0v3b5n7p9d/send"
```

### Void an invoice

`POST /v1/dashboard/invoices/{id}/void`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Invoice id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The void invoice. | [Invoice](#invoice) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/invoices/inv_test_01k7v0c2c4x8q6r0v3b5n7p9d/void"
```

### List subscriptions

`GET /v1/dashboard/subscriptions`

The same as `GET /v1/subscriptions`, with the dashboard session and `mode`.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `status` | [SubscriptionStatus](#subscriptionstatus) | no | Only subscriptions with this status. |
| `customerEmail` | string | no | Only this customer's subscriptions. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–100, default 50. (1–100) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of subscriptions. | [SubscriptionList](#subscriptionlist) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/subscriptions"
```

### Create a subscription

`POST /v1/dashboard/subscriptions`

`SubscriptionCreateRequest` plus `mode` (`live` or `test`).

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Subscription created. | [Subscription](#subscription) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/subscriptions" \
  -H "content-type: application/json" \
  -d '{}'
```

### Get a subscription

`GET /v1/dashboard/subscriptions/{id}`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Subscription id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The subscription. | [Subscription](#subscription) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/subscriptions/sub_test_01k7v0c2c4x8q6r0v3b5n7p9d"
```

### Update a subscription

`PATCH /v1/dashboard/subscriptions/{id}`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Subscription id. |

**Request body** — [SubscriptionUpdateRequest](#subscriptionupdaterequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The subscription. | [Subscription](#subscription) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X PATCH "https://api.layerhop.com/v1/dashboard/subscriptions/sub_test_01k7v0c2c4x8q6r0v3b5n7p9d" \
  -H "content-type: application/json" \
  -d '{}'
```

### List a subscription's invoices

`GET /v1/dashboard/subscriptions/{id}/invoices`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Subscription id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Its invoices. | [SubscriptionInvoiceList](#subscriptioninvoicelist) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/subscriptions/sub_test_01k7v0c2c4x8q6r0v3b5n7p9d/invoices"
```

### Cancel a subscription

`POST /v1/dashboard/subscriptions/{id}/cancel`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Subscription id. |

**Request body** — [SubscriptionCancelRequest](#subscriptioncancelrequest)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The subscription. | [Subscription](#subscription) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/subscriptions/sub_test_01k7v0c2c4x8q6r0v3b5n7p9d/cancel" \
  -H "content-type: application/json" \
  -d '{}'
```

### Pause a subscription

`POST /v1/dashboard/subscriptions/{id}/pause`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Subscription id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The subscription. | [Subscription](#subscription) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/subscriptions/sub_test_01k7v0c2c4x8q6r0v3b5n7p9d/pause"
```

### Resume a subscription

`POST /v1/dashboard/subscriptions/{id}/resume`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Subscription id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The subscription. | [Subscription](#subscription) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/subscriptions/sub_test_01k7v0c2c4x8q6r0v3b5n7p9d/resume"
```

### List deposit addresses

`GET /v1/dashboard/deposit-addresses`

The same list as `GET /v1/deposit-addresses`, with the dashboard session and `mode`. It includes addresses created with API keys and from the dashboard.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` (default) or `test`: which data to show. Test-mode data comes from `lh_test_` keys and never mixes with live data. (default `"live"`) |
| `status` | [DepositAddressStatus](#depositaddressstatus) | no | Only addresses with this status. |
| `label` | string | no | Only addresses with exactly this label. |
| `cursor` | string | no | `nextCursor` from the previous page. |
| `limit` | integer | no | 1–200, default 50. (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of deposit addresses. | [DepositAddressList](#depositaddresslist) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/deposit-addresses"
```

### Create a deposit address

`POST /v1/dashboard/deposit-addresses`

`DepositAddressCreateRequest` plus `mode` (`live` or `test`; default the `mode` query parameter,
then live), with the same validation as `POST /v1/deposit-addresses`. The address belongs to the
signed-in account and has no API key. Live mode returns `FORBIDDEN` until deposit addresses are
enabled for live mode. Uses the strict rate-limit bucket.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Deposit address created. | [DepositAddressCreated](#depositaddresscreated) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | `FORBIDDEN`: live mode before deposit addresses are enabled for live, or a cross-origin request. | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |
| `502` | The upstream provider failed (`PROVIDER_ERROR`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/deposit-addresses" \
  -H "content-type: application/json" \
  -d '{"mode":"test","srcChain":"base","srcToken":"USDC","dstChain":"arbitrum","dstToken":"USDC","recipient":"0x2222222222222222222222222222222222222222","refundTo":"0x3333333333333333333333333333333333333333","label":"user-4821"}'
```

### Get a deposit address

`GET /v1/dashboard/deposit-addresses/{id}`

The address and its 20 most recent deposits (each one an order), newest first. Addresses of other accounts return `NOT_FOUND`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Deposit address id. |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` or `test`. When given, an address of the other mode returns `NOT_FOUND`. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The deposit address. | [DepositAddressWithDeposits](#depositaddresswithdeposits) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/deposit-addresses/da_01k7x2m4c4x8q6r0v3b5n7p9d"
```

### Check a deposit address for deposits now

`POST /v1/dashboard/deposit-addresses/{id}/refresh`

Same as `POST /v1/deposit-addresses/{id}/refresh`. Disabled addresses return `CONFLICT`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Deposit address id. |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` or `test`. When given, an address of the other mode returns `NOT_FOUND`. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `202` | Check scheduled. | [DepositAddress](#depositaddress) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/deposit-addresses/da_01k7x2m4c4x8q6r0v3b5n7p9d/refresh"
```

### Disable a deposit address

`POST /v1/dashboard/deposit-addresses/{id}/disable`

Same as `POST /v1/deposit-addresses/{id}/disable`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Deposit address id. |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` or `test`. When given, an address of the other mode returns `NOT_FOUND`. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The disabled address. | [DepositAddress](#depositaddress) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/deposit-addresses/da_01k7x2m4c4x8q6r0v3b5n7p9d/disable"
```

### Simulate a deposit (test mode)

`POST /v1/dashboard/deposit-addresses/{id}/simulate`

Same as `POST /v1/deposit-addresses/{id}/simulate`. Live addresses return `FORBIDDEN`.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Deposit address id. |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `mode` | `"live"` \| `"test"` | no | `live` or `test`. When given, an address of the other mode returns `NOT_FOUND`. |

**Request body** — [SimulateDepositRequest](#simulatedepositrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | Test deposit recorded. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | `FORBIDDEN`: a live address; simulate works in test mode only. | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/deposit-addresses/da_01k7x2m4c4x8q6r0v3b5n7p9d/simulate" \
  -H "content-type: application/json" \
  -d '{"amount":"25000000"}'
```

### Get plan and billing

`GET /v1/dashboard/billing`

Current plan and its status, usage against the plan's limits, the plan subscription, the
invoice still to pay, every plan, and past plan invoices (newest first, up to 24). 404 unless plans are enabled.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Billing overview. | [Billing](#billing) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/dashboard/billing"
```

### Upgrade or change plan

`POST /v1/dashboard/billing/subscribe`

Starts a monthly LayerHop subscription for `plan` and returns its first invoice: open it
(`invoice.url`) and pay with any token. The plan applies within a minute of the payment
settling. `email` (required once, saved on the account) receives invoices and receipts.
Asking for the plan you already pay for returns the same subscription and open invoice (200).
Changing plans ends the current subscription (its unpaid invoice is voided); a more expensive
plan is billed at once, while a cheaper plan (or the same plan after a cancel) starts when the
paid period ends (`invoice: null`, `subscription.startsAt` in the future). No proration.
`CONFLICT` while a payment for the current plan is still settling. 404 unless plans are enabled.

**Request body** — [BillingSubscribeRequest](#billingsubscriberequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Already subscribed to this plan. | [BillingSubscribeResponse](#billingsubscriberesponse) |
| `201` | Subscription created. | [BillingSubscribeResponse](#billingsubscriberesponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/billing/subscribe" \
  -H "content-type: application/json" \
  -d '{"plan":"pro","email":"dev@example.com"}'
```

### Downgrade to Free

`POST /v1/dashboard/billing/cancel`

Ends the plan subscription now and voids its unpaid invoice. A plan already paid for stays
until its period end, then the account is on Free. `CONFLICT` without a paid plan or while a
payment is settling. 404 unless plans are enabled.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The billing overview after the change. | [Billing](#billing) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/dashboard/billing/cancel"
```

## Admin

Operator-only partner registry, fee ledger and business reports (D-020). Every admin route returns 404 unless the operator sets `ADMIN_TOKEN` or the owner sign-in (`ADMIN_EMAIL` + `ADMIN_PASSWORD_HASH`), and 401 without the matching `Authorization: Bearer` token or the owner's `lh_admin` cookie from `POST /v1/admin/login`. Cookie writes must come from the dashboard origin.

### List partners

`GET /v1/admin/partners`

The partner registry (`PARTNERS_JSON`) without API keys.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Registered partners. | [PartnersResponse](#partnersresponse) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | Admin routes are disabled (`ADMIN_TOKEN` is not set). | — |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/partners"
```

**Example response** (`200`)

```json
{
  "partners": [
    {
      "id": "myapp",
      "name": "My App",
      "feeBps": 20,
      "maxFeeBps": 100,
      "payoutEvm": "0x1111111111111111111111111111111111111111",
      "hasApiKey": true
    }
  ]
}
```

### Partner fee ledger

`GET /v1/admin/partners/{id}/ledger`

Ledger entries for one partner plus per-source-token totals. `basis` is `built`: entries mean a
transaction was built (`POST /v1/orders`) or submitted (`POST /v1/orders/submit`) through
LayerHop, not that the swap filled. Reconcile against order status before paying out.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Partner id. (pattern `^[a-z0-9-]{1,32}$`) |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `from` | string | no | Inclusive start, ISO 8601 date/time or unix seconds. |
| `to` | string | no | Inclusive end, ISO 8601 date/time or unix seconds. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Entries and totals. | [PartnerLedgerResponse](#partnerledgerresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | Admin routes are disabled (`ADMIN_TOKEN` is not set). | — |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/partners/myapp/ledger"
```

**Example response** (`200`)

```json
{
  "partner": "myapp",
  "basis": "built",
  "from": "2026-10-01T00:00:00.000Z",
  "entries": [
    {
      "type": "built",
      "quoteId": "q_6f1c2d0e-8a51-4c1e-9d0b-2f7a9e3c4b10",
      "partner": "myapp",
      "provider": "relay",
      "srcChainId": 8453,
      "srcToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "dstChainId": 7565164,
      "dstToken": "So11111111111111111111111111111111111111112",
      "amount": "100000000",
      "dstAmount": "612345678",
      "ourFeeBps": 15,
      "integratorFeeBps": 20,
      "partnerFeeEstimate": "200000",
      "createdAt": "2026-10-17T10:00:00.000Z"
    }
  ],
  "totals": [
    {
      "srcChainId": 8453,
      "srcToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "builtCount": 1,
      "submittedCount": 0,
      "partnerFeeEstimate": "200000"
    }
  ]
}
```

### Approve a partner

`POST /v1/admin/partners/{id}/approve`

Sets a DB partner `active` with `maxFeeBps` (<= `MAX_TOTAL_FEE_BPS`); `feeBps` is clamped to it. Needs a database.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Partner id. |

**Request body** — [ApproveRequest](#approverequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The updated partner. | [AdminPartnerResponse](#adminpartnerresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/partners/myapp/approve" \
  -H "content-type: application/json" \
  -d '{"maxFeeBps":50}'
```

### Suspend a partner

`POST /v1/admin/partners/{id}/suspend`

Sets a DB partner `suspended`; its fee stops applying within 60 s.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Partner id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The updated partner. | [AdminPartnerResponse](#adminpartnerresponse) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/partners/myapp/suspend"
```

### Partner balances and payouts

`GET /v1/admin/partners/{id}/payouts`

Balances per token (as in `GET /v1/dashboard/payouts`) and every recorded payout, voided ones included. Needs a database.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Partner id (DB or `PARTNERS_JSON`). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Balances and payouts. | [PayoutsResponse](#payoutsresponse) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/partners/myapp/payouts"
```

### Record a payout

`POST /v1/admin/partners/{id}/payouts`

Records a transfer the operator already made to the partner (LayerHop never sends it). It
reduces the partner's `owed` balance for that token. `token` and `toAddress` must be valid for
`chainId`; `txHash` is a 0x hash on EVM chains or a base58 signature on Solana.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Partner id. |

**Request body** — [PayoutRequest](#payoutrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | The recorded payout. | [PayoutResponse](#payoutresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/partners/myapp/payouts" \
  -H "content-type: application/json" \
  -d '{"chainId":8453,"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"5000000","toAddress":"0x1111111111111111111111111111111111111111","txHash":"0xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd","note":"September"}'
```

### Void a payout

`POST /v1/admin/partners/{id}/payouts/{payoutId}/void`

Marks a payout recorded by mistake as void. It stops counting toward `paid` but stays in the admin history.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Partner id. |
| `payoutId` | string | yes | Payout id. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The voided payout. | [PayoutResponse](#payoutresponse) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/partners/myapp/payouts/po_01hxexample/void"
```

### Partners owed a payout

`GET /v1/admin/payouts/owed`

Every partner with a positive `owed` balance in at least one token, with only those balances.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Partners to pay. | object |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/payouts/owed"
```

**Example response** (`200`)

```json
{
  "partners": [
    {
      "partner": "myapp",
      "balances": [
        {
          "chainId": 8453,
          "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "earned": "7800000",
          "paid": "5000000",
          "owed": "2800000",
          "decimals": 6,
          "owedUsd": 2.8
        }
      ]
    }
  ]
}
```

### API traffic per day

`GET /v1/admin/traffic`

Per UTC day (oldest first, today last, days without traffic as zeros): requests to the public
API, unique clients, successful `GET /v1/quote` responses and orders built, each split into
requests with and without an API key.

Unique clients are distinct daily client hashes: an HMAC-SHA256 of the client IP under a key
derived from `SESSION_SECRET` and the UTC date, truncated to 16 hex chars. IPs are never stored
and hashes can't be linked across days. A client that called both with and without a key
counts once in `total` and once in each of `withKey` and `withoutKey`.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `days` | integer | no | Number of days, 1 to 90 (default 30). (default `30`) (1–90) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Traffic per day. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/traffic"
```

**Example response** (`200`)

```json
{
  "days": [
    {
      "date": "2026-10-19",
      "requests": {
        "total": 1840,
        "withKey": 1210,
        "withoutKey": 630
      },
      "uniqueClients": {
        "total": 96,
        "withKey": 12,
        "withoutKey": 88
      },
      "quotes": {
        "total": 702,
        "withKey": 455,
        "withoutKey": 247
      },
      "ordersBuilt": {
        "total": 41,
        "withKey": 29,
        "withoutKey": 12
      }
    }
  ]
}
```

### Filler bot results

`GET /v1/admin/filler`

What the live filler bot did: fills, lost bids, win rate, volume and expected profit for the
window and for all time, per UTC day and per route, lost bids by block builder, why orders were
not bid on, and the newest bids.

A bid is an order the filler sent a fill for. It is `won` when the fill landed and `lost` when
another relayer filled first. USD figures are the filler's own estimates at decision time (gas
at the quoted price, plus its internal capital and risk charges), not realized profit.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `days` | integer | no | Number of days, 1 to 90 (default 7). (default `7`) (1–90) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Filler results. | [FillerStats](#fillerstats) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/filler"
```

**Example response** (`200`)

```json
{
  "status": {
    "lastDecisionAt": "2026-11-10T15:41:12.000Z",
    "decisionsLastHour": 512,
    "paused": true,
    "pausedReason": "rebalance"
  },
  "window": {
    "ordersPriced": 10250,
    "fills": 23,
    "lostBids": 78,
    "winRate": 0.2277,
    "volumeUsd": 597.11,
    "grossUsd": 3.37,
    "gasUsd": 2.82,
    "netUsd": 0.21
  },
  "allTime": {
    "ordersPriced": 18400,
    "fills": 23,
    "lostBids": 78,
    "winRate": 0.2277,
    "volumeUsd": 597.11,
    "grossUsd": 3.37,
    "gasUsd": 2.82,
    "netUsd": 0.21
  },
  "days": [
    {
      "date": "2026-11-10",
      "fills": 17,
      "lostBids": 31,
      "volumeUsd": 389.2,
      "netUsd": 0.16
    }
  ],
  "routes": [
    {
      "srcChainId": 8453,
      "dstChainId": 1,
      "kind": "usdt>usdt",
      "fills": 5,
      "lostBids": 9,
      "volumeUsd": 136.5,
      "netUsd": 0.07
    }
  ],
  "lostByBuilder": [
    {
      "builder": "Titan (titanbuilder.xyz)",
      "count": 12
    }
  ],
  "skips": [
    {
      "reason": "route_not_watched",
      "count": 4123
    }
  ],
  "recent": [
    {
      "decidedAt": "2026-11-10T15:34:02.000Z",
      "orderId": "42161:4800218",
      "srcChainId": 42161,
      "dstChainId": 1,
      "kind": "usdt>usdt",
      "sizeUsd": 10.17,
      "result": "won",
      "netUsd": 0.0113,
      "fillTxHash": "0xd675c9c5a2c59aee900e0435615c7f7e04d65b102a58700d9ef1fb7e61f1e560",
      "ourTipGwei": 0.033961,
      "winnerTipGwei": 0.033961,
      "builder": "Titan (titanbuilder.xyz)"
    }
  ]
}
```

### Filler wallet ledger

`GET /v1/admin/ledger`

The filler wallet's double-entry ledger, built by the worker from what happened on-chain (every
transaction the wallet sent and every transfer it received on Ethereum, Optimism, Base and
Arbitrum), not from the filler's own estimates.

`position` is what the wallet holds now, what Across still owes it and how much capital was put in.
`balances` compares the ledger's balance of every asset with the chain: a row with `matches: false`
means the ledger missed or misread something. `pnl` and `days` are realised profit and loss: the fees
fills earned minus all gas (fills, lost races, approvals, rebalancing) and what moving funds between
chains cost. Income is positive and a cost negative. `unclassified` lists movements the importer
could not explain; classify them with `PUT /v1/admin/ledger/overrides`.

Stablecoins are valued at 1 USD; ETH and WETH at the hourly price when a line was booked, and at the
newest price in `position`, `balances` and `receivables`.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `days` | integer | no | Days in `pnl.window` and `days`, 1 to 90 (default 30). (default `30`) (1–90) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The ledger summary. | [FillerLedger](#fillerledger) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/ledger"
```

**Example response** (`200`)

```json
{
  "walletId": "filler-evm",
  "builtAt": "2026-11-28T00:05:00.000Z",
  "firstEntryAt": "2026-11-08T00:27:12.000Z",
  "lines": 9120,
  "ethUsd": 1655.2,
  "sync": [
    {
      "chainId": 1,
      "ok": false,
      "source": "blockscout",
      "block": 26509522,
      "at": "2026-11-28T00:05:00.000Z",
      "error": "blockscout 1 transactions: HTTP 500"
    }
  ],
  "position": {
    "walletUsd": 2314.02,
    "receivableUsd": 4.22,
    "transitUsd": 0,
    "capitalInUsd": 578.17,
    "unclassifiedUsd": 1768.14,
    "mismatches": 1
  },
  "balances": [
    {
      "chainId": 8453,
      "asset": "USDC",
      "amount": "1240.829647",
      "usd": 1240.83,
      "ledgerAmount": "1240.329647",
      "diff": "0.5",
      "matches": false,
      "checkedAt": "2026-11-28T00:05:00.000Z",
      "mismatchSince": "2026-11-27T23:55:00.000Z"
    }
  ],
  "receivables": [
    {
      "chainId": 8453,
      "asset": "USDT",
      "amount": "250.1",
      "usd": 250.1
    }
  ],
  "pnl": {
    "window": {
      "fillSpreadUsd": 185.43,
      "gasFillUsd": -100.4,
      "gasLostRaceUsd": -19.54,
      "gasApprovalUsd": -13.56,
      "gasRebalanceUsd": -8.11,
      "gasOtherUsd": -0.08,
      "rebalanceUsd": -45.38,
      "otherUsd": 0.05,
      "netUsd": -1.59
    },
    "allTime": {
      "fillSpreadUsd": 185.43,
      "gasFillUsd": -100.4,
      "gasLostRaceUsd": -19.54,
      "gasApprovalUsd": -13.56,
      "gasRebalanceUsd": -8.11,
      "gasOtherUsd": -0.08,
      "rebalanceUsd": -45.38,
      "otherUsd": 0.05,
      "netUsd": -1.59
    }
  },
  "days": [
    {
      "date": "2026-11-27",
      "fillSpreadUsd": 16.41,
      "gasFillUsd": -8.83,
      "gasLostRaceUsd": -1.42,
      "gasApprovalUsd": -1.4,
      "gasRebalanceUsd": -1.08,
      "gasOtherUsd": 0,
      "rebalanceUsd": -4.17,
      "otherUsd": 0,
      "netUsd": -0.49
    }
  ],
  "activity": [
    {
      "category": "fill",
      "journals": 808
    }
  ],
  "unclassified": [
    {
      "occurredAt": "2026-11-22T20:40:02.000Z",
      "chainId": 8453,
      "txHash": "0x9838a166372d49d5375142bd7a71c65289cdf6adaf209de4cba5930631366021",
      "direction": "in",
      "asset": "USDC",
      "amount": "749.8",
      "usd": 749.8
    }
  ],
  "overrides": []
}
```

### Filler ledger journal

`GET /v1/admin/ledger/entries`

The journal lines of the filler wallet's ledger, newest first. The lines of one transaction share a
`txHash` and sum to zero in `usd`. A debit is positive and a credit negative: an asset going up, a
cost and money owed to the wallet are positive; an asset going down, income and capital put in are
negative.

With `format=csv` the filtered journal is returned as a CSV file, oldest first (at most 100,000 lines).
The worker rebuilds the journal when new facts arrive, so an `id` is only stable between two builds.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `account` | string | no | An account or a prefix of one: `expense` matches every expense account, `asset:8453` every asset on Base. |
| `category` | string | no | `fill`, `lost_race`, `approval`, `refund`, `rebalance`, `gas_refill`, `owner_deposit`, `owner_withdrawal`, `transfer_in`, `transfer_out`, `unclassified_in`, `unclassified_out`, `dust` or `other`. |
| `chainId` | integer | no | — |
| `txHash` | string | no | (pattern `^0x[0-9a-fA-F]{64}$`) |
| `from` | string (date-time) | no | Only lines at or after this time. |
| `to` | string (date-time) | no | Only lines before this time. |
| `limit` | integer | no | (default `100`) (1–500) |
| `before` | integer | no | `nextCursor` of the previous page. |
| `format` | `"json"` \| `"csv"` | no | (default `"json"`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | A page of journal lines, or the CSV file. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/ledger/entries"
```

**Example response** (`200`)

```json
{
  "entries": [
    {
      "id": 9120,
      "occurredAt": "2026-11-27T22:10:03.000Z",
      "chainId": 8453,
      "txHash": "0x4b53a93a90bcbf0f1cb16f9f3606eb9062a307544bdd900a9bb1a13f040dd3e1",
      "account": "income:fill_spread",
      "asset": "USD",
      "amount": "-0.05",
      "usd": -0.05,
      "category": "fill",
      "ref": "1:4800218",
      "memo": ""
    }
  ],
  "nextCursor": "9020"
}
```

### Classify a ledger transaction

`PUT /v1/admin/ledger/overrides`

Says what a transaction of the filler wallet was, for one the importer could not classify (or got
wrong): `owner_deposit` (capital put in), `owner_withdrawal` (capital taken out) or `other` (other
income or cost). Replaces an earlier classification of the same transaction. The worker applies it
when it next builds the journal, within a few minutes.

**Request body** — [FillerLedgerOverrideInput](#fillerledgeroverrideinput) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The stored classification. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl -X PUT "https://api.layerhop.com/v1/admin/ledger/overrides" \
  -H "content-type: application/json" \
  -d '{"chainId":8453,"txHash":"0x9838a166372d49d5375142bd7a71c65289cdf6adaf209de4cba5930631366021","category":"owner_deposit","note":"capital top-up"}'
```

**Example response** (`200`)

```json
{
  "override": {
    "chainId": 8453,
    "txHash": "0x9838a166372d49d5375142bd7a71c65289cdf6adaf209de4cba5930631366021",
    "category": "owner_deposit",
    "note": "capital top-up"
  }
}
```

### Remove a ledger classification

`DELETE /v1/admin/ledger/overrides`

Removes the owner's classification of a transaction, so the importer's own reading applies again at the next build.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Removed. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X DELETE "https://api.layerhop.com/v1/admin/ledger/overrides" \
  -H "content-type: application/json" \
  -d '{"chainId":8453,"txHash":"0x9838a166372d49d5375142bd7a71c65289cdf6adaf209de4cba5930631366021"}'
```

**Example response** (`200`)

```json
{
  "ok": true
}
```

### Owner sign-in

`POST /v1/admin/login`

Signs the owner in to the dashboard's admin pages with `ADMIN_EMAIL` and the password whose
scrypt hash is `ADMIN_PASSWORD_HASH` (`node scripts/admin-password-hash.mjs`). Sets the
`lh_admin` cookie (HttpOnly, Secure, SameSite=Strict, path `/v1/admin`, 12 hours), which every
admin route accepts in place of the Bearer token. Changing the password ends every session.
5 attempts per client per 15 minutes. Exists only when the owner sign-in is configured.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Signed in; the `lh_admin` cookie is set. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/login" \
  -H "content-type: application/json" \
  -d '{"email":"owner@example.com","password":"••••••••"}'
```

**Example response** (`200`)

```json
{
  "email": "owner@example.com"
}
```

### Owner sign-out

`POST /v1/admin/logout`

Clears the `lh_admin` cookie.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Signed out. | object |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/logout"
```

**Example response** (`200`)

```json
{
  "ok": true
}
```

### Current owner session

`GET /v1/admin/session`

The signed-in owner's email; 401 when the `lh_admin` cookie is missing or expired.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Signed in. | object |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/session"
```

**Example response** (`200`)

```json
{
  "email": "owner@example.com"
}
```

### Business overview

`GET /v1/admin/overview`

Live orders only. A swap is a filled order. `volumeUsd` is the source amount in USD and
`feesUsd` estimates our fee income as `volumeUsd × ourFeeBps / 10000` (`partnerFeesUsd` the
same with the partner's bps). Filled orders not priced yet count in `swaps` and
`unpricedSwaps` but add nothing to the USD sums.

`days` has one entry per UTC day (oldest first, today last); `today`, `last7Days` and
`allTime` ignore `days`, `window` covers it. `byProvider`, `byChannel`, `byRoute` (top 20) and
`topWallets` (top 20, by sender) cover the window's swaps, by volume. `recent` is the latest
100 live orders that reached a source transaction, any status.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `days` | integer | no | Number of days, 1 to 90 (default 30). (default `30`) (1–90) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The overview. | [AdminOverview](#adminoverview) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/overview"
```

**Example response** (`200`)

```json
{
  "generatedAt": "2026-10-26T15:32:45Z",
  "days": [
    {
      "date": "2026-10-26",
      "swaps": 7,
      "volumeUsd": 29.89,
      "feesUsd": 0.01,
      "partnerFeesUsd": 0,
      "uniqueWallets": 5,
      "ordersBuilt": 27,
      "submitted": 7,
      "failed": 0,
      "unpricedSwaps": 0
    }
  ],
  "today": {
    "swaps": 7,
    "volumeUsd": 29.89,
    "feesUsd": 0.01,
    "partnerFeesUsd": 0,
    "uniqueWallets": 5,
    "ordersBuilt": 27,
    "submitted": 7,
    "failed": 0,
    "unpricedSwaps": 0
  },
  "last7Days": {
    "swaps": 36,
    "volumeUsd": 412.5,
    "feesUsd": 0.31,
    "partnerFeesUsd": 0,
    "uniqueWallets": 19,
    "ordersBuilt": 74,
    "submitted": 36,
    "failed": 1,
    "unpricedSwaps": 0
  },
  "window": {
    "swaps": 36,
    "volumeUsd": 412.5,
    "feesUsd": 0.31,
    "partnerFeesUsd": 0,
    "uniqueWallets": 19,
    "ordersBuilt": 78,
    "submitted": 36,
    "failed": 1,
    "unpricedSwaps": 0
  },
  "allTime": {
    "swaps": 36,
    "volumeUsd": 412.5,
    "feesUsd": 0.31,
    "partnerFeesUsd": 0,
    "uniqueWallets": 19,
    "ordersBuilt": 78,
    "submitted": 36,
    "failed": 1,
    "unpricedSwaps": 0
  },
  "byProvider": [
    {
      "provider": "lifi",
      "swaps": 4,
      "volumeUsd": 3.92,
      "feesUsd": 0.01
    }
  ],
  "byChannel": [
    {
      "channel": "web",
      "swaps": 7,
      "volumeUsd": 29.89,
      "feesUsd": 0.01
    }
  ],
  "byRoute": [
    {
      "srcChainId": 7565164,
      "dstChainId": 56,
      "swaps": 3,
      "volumeUsd": 2.53,
      "feesUsd": 0
    }
  ],
  "topWallets": [
    {
      "sender": "0x38df82630000000000000000000000000000beef",
      "swaps": 1,
      "volumeUsd": 22.98,
      "feesUsd": 0
    }
  ],
  "recent": []
}
```

### Revenue

`GET /v1/admin/revenue`

What LayerHop earns, for the owner (dashboard Admin → Revenue). Basis: live orders with
status `filled`, by `createdAt`, in [`from`, `to`). `feesUsd` is an ESTIMATE: USD value at fill
× `ourFeeBps` / 10000, gross of any share the provider keeps (`byProvider[].netFeesUsdEstimate`
nets it out where the cut is documented, else null). Filled orders without a USD value at fill
count in `swaps` and `unpricedSwaps` and add nothing to USD sums; no price is invented.

Orders sent from LayerHop's own test wallets (D-033; `INTERNAL_TEST_WALLETS` overrides the
list) are left out of every number and reported in `internalTests`. Test-mode orders are never
revenue (`testModeSwaps` counts them).

Products: `limit_order` (a limit-order fill), `deposit_address`, `plans` (a payment of a plan
invoice), `checkout` (checkout payments and refunds), else `swap`. `plansBilling` is the plan
invoice revenue itself (paid invoices of the billing account, USDC / USDT at face value);
`totals.revenueUsd = feesUsd + plansBillingUsd`. Launch fees are not recorded (`launchFees`).

`pending` groups fees by how the provider pays them (`settlement`): `onchain` (in the user's
transaction, nothing pending), `claimable` (accrues at the provider until we claim it; claims
aren't recorded, so the estimate is all-time fees: an upper bound), `paid_periodically` (the
provider pays weekly; estimate: the last 7 days), `none`, `unknown`. `settlementTable` lists
the documented mechanics per provider. `partnerFees.owed` and `referralRewards` are all-time
balances; `topIntegrators` / `topReferrers` (top 20) cover the window. `selection` (D-076) counts
how this API process picked the first quote since it started: by payout, a tie broken toward the
higher LayerHop margin, or an own source.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `window` | `"24h"` \| `"7d"` \| `"30d"` \| `"90d"` \| `"all"` | no | 24h, 7d, 30d, 90d or all (default 30d). Ignored when from or to is set. (default `"30d"`) |
| `from` | string | no | Start, ISO date or unix seconds (default: 30 days before to). At most 1000 days before to. |
| `to` | string | no | End (exclusive), ISO date or unix seconds (default: now). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The revenue report. | [AdminRevenue](#adminrevenue) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/revenue"
```

**Example response** (`200`)

```json
{
  "generatedAt": "2026-11-03T15:00:00Z",
  "window": "7d",
  "from": "2026-10-27T15:00:00Z",
  "to": "2026-11-03T15:00:00Z",
  "basis": "Live filled orders by createdAt. Fees are estimates: USD at fill × our fee bps, gross of provider cuts. Orders without a USD value at fill are unpriced and add $0.",
  "totals": {
    "swaps": 41,
    "pricedSwaps": 40,
    "unpricedSwaps": 1,
    "volumeUsd": 1840.5,
    "feesUsd": 2.31,
    "partnerFeesUsd": 0.12,
    "uniqueWallets": 23,
    "plansBillingUsd": 0,
    "revenueUsd": 2.31
  },
  "internalTests": {
    "swaps": 3,
    "pricedSwaps": 3,
    "unpricedSwaps": 0,
    "volumeUsd": 15,
    "feesUsd": 0.02,
    "partnerFeesUsd": 0,
    "wallets": [
      "0x7f8f3c6f2de98b9ace6c7ea9d54d75f1229730f9"
    ]
  },
  "testModeSwaps": 12,
  "days": [
    {
      "date": "2026-11-03",
      "swaps": 6,
      "pricedSwaps": 6,
      "unpricedSwaps": 0,
      "volumeUsd": 210.4,
      "feesUsd": 0.27,
      "partnerFeesUsd": 0,
      "plansBillingUsd": 0,
      "internalTestSwaps": 1
    }
  ],
  "byProduct": [
    {
      "product": "swap",
      "swaps": 39,
      "pricedSwaps": 38,
      "unpricedSwaps": 1,
      "volumeUsd": 1790.5,
      "feesUsd": 2.21,
      "partnerFeesUsd": 0.12
    }
  ],
  "byProvider": [
    {
      "provider": "lifi",
      "swaps": 30,
      "pricedSwaps": 30,
      "unpricedSwaps": 0,
      "volumeUsd": 1500,
      "feesUsd": 1.9,
      "partnerFeesUsd": 0.1,
      "settlement": "claimable",
      "providerCutBps": 0,
      "netFeesUsdEstimate": 1.9
    }
  ],
  "byChannel": [
    {
      "channel": "web",
      "swaps": 35,
      "pricedSwaps": 34,
      "unpricedSwaps": 1,
      "volumeUsd": 1600,
      "feesUsd": 2,
      "partnerFeesUsd": 0
    }
  ],
  "byChain": [
    {
      "srcChainId": 8453,
      "swaps": 20,
      "pricedSwaps": 20,
      "unpricedSwaps": 0,
      "volumeUsd": 900,
      "feesUsd": 1.1,
      "partnerFeesUsd": 0
    }
  ],
  "topIntegrators": [
    {
      "partnerId": "acme",
      "swaps": 4,
      "pricedSwaps": 4,
      "unpricedSwaps": 0,
      "volumeUsd": 240.5,
      "feesUsd": 0.48,
      "partnerFeesUsd": 0.12
    }
  ],
  "topReferrers": [],
  "plansBilling": {
    "invoicesPaid": 0,
    "usd": 0,
    "unpricedInvoices": 0,
    "basis": "Paid plan invoices (billing account), USDC / USDT at face value."
  },
  "partnerFees": {
    "windowUsd": 0.12,
    "owed": [
      {
        "partner": "acme",
        "owedUsd": 0.31,
        "tokens": 2,
        "unpricedTokens": 0
      }
    ],
    "owedUsd": 0.31,
    "owedUnpricedTokens": 0,
    "basis": "Owed = filled partner fee estimates minus recorded payouts, all time, per token (D-023). USD at today's price where known."
  },
  "referralRewards": {
    "enabled": false,
    "rewardBps": 0,
    "accruedUsd": 0,
    "paidUsd": 0,
    "unpaidUsd": 0,
    "paidInWindowUsd": 0,
    "payoutsInWindow": 0
  },
  "pending": [
    {
      "settlement": "claimable",
      "windowFeesUsd": 1.9,
      "allTimeFeesUsd": 6.4,
      "pendingEstimateUsd": 6.4,
      "basis": "Accrues at the provider until we claim it. Claims are not recorded here, so this is everything ever accrued: an upper bound.",
      "providers": [
        {
          "provider": "relay",
          "windowFeesUsd": 1.9,
          "allTimeFeesUsd": 6.4,
          "pendingEstimateUsd": 6.4,
          "unpricedSwaps": 2
        }
      ]
    }
  ],
  "launchFees": {
    "recorded": false,
    "note": "Launch fees (D-041) are claimed on chain from app.layerhop.com/create/admin and are not recorded in the database."
  },
  "settlementTable": [
    {
      "provider": "zerox",
      "settlement": "onchain",
      "providerCutBps": 0,
      "note": "swapFeeRecipient gets the fee inside the swap tx; 0x takes no cut."
    }
  ],
  "selection": {
    "since": "2026-11-07T09:00:00Z",
    "basis": "Quote responses of this API process since it started (resets on deploy).",
    "responses": 1200,
    "byReason": {
      "best-payout": 1150,
      "tie-margin": 50,
      "own-source": 0
    },
    "byClass": {
      "same-chain-own-router": 40,
      "cross-chain-solver": 0,
      "partners": 1160
    },
    "tiesBroken": {
      "count": 50,
      "avgBelowBestBps": 3.2,
      "maxBelowBestBps": 9.8,
      "extraMarginUsd": 4.1
    }
  }
}
```

### Revenue orders as CSV

`GET /v1/admin/revenue/orders.csv`

Every live filled order of the same range as `GET /v1/admin/revenue` (same parameters), oldest
first, at most 100,000 rows. Internal test orders are included with `internal_test=true`.
`our_fee_usd` / `partner_fee_usd` are estimates (USD at fill × bps) and empty when the order
has no USD value at fill. `settlement` is how the provider pays our fee.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `window` | `"24h"` \| `"7d"` \| `"30d"` \| `"90d"` \| `"all"` | no | 24h, 7d, 30d, 90d or all (default 30d). (default `"30d"`) |
| `from` | string | no | Start, ISO date or unix seconds. |
| `to` | string | no | End (exclusive), ISO date or unix seconds. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The CSV, as an attachment download. | — |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/revenue/orders.csv"
```

### Developer signups and API key usage

`GET /v1/admin/developers`

Accounts, API keys and keyed requests for the owner (dashboard Admin → Developers).
`totals.accounts`, `accountsWithKeys` and the key counts are all-time; `newAccounts`,
`keysCreated`, `keysUsed`, `accountsUsingKeys`, `keyedRequests` and `requests` cover the
`days` window. `requests` counts every logged API request in the window, with or without a key,
and `keyedShare` is `keyedRequests / requests`. Live and test keys both count.

`days` has one entry per UTC day (oldest first, today last). `accounts` lists the newest 200
accounts (newest first; `accountsTotal` is the full count) with wallets, keys, requests and
errors (status ≥ 400) in the window, the top 3 paths and the last request (all time). Each
account lists up to 50 keys, newest first. Accounts whose display name contains "e2e test"
are flagged `e2eTest`. Key hashes and account emails are never returned.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `days` | integer | no | Number of days, 1 to 90 (default 30). (default `30`) (1–90) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Developers and key usage. | [AdminDevelopers](#admindevelopers) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/developers"
```

**Example response** (`200`)

```json
{
  "generatedAt": "2026-10-30T12:00:00Z",
  "totals": {
    "accounts": 42,
    "newAccounts": 9,
    "accountsWithKeys": 17,
    "keys": 31,
    "liveKeys": 19,
    "testKeys": 12,
    "activeKeys": 27,
    "revokedKeys": 4,
    "keysCreated": 8,
    "keysUsed": 11,
    "accountsUsingKeys": 7,
    "keyedRequests": 15230,
    "requests": 48211,
    "keyedShare": 0.3159
  },
  "days": [
    {
      "date": "2026-10-30",
      "newAccounts": 1,
      "keysCreated": 2,
      "keyedRequests": 640
    }
  ],
  "accountsTotal": 42,
  "accounts": [
    {
      "id": "acc_01jb8x2k9w",
      "displayName": "Acme Wallet",
      "plan": "free",
      "createdAt": "2026-10-28T09:14:00Z",
      "e2eTest": false,
      "wallets": 1,
      "activeKeys": 0,
      "totalKeys": 1,
      "requests": 912,
      "errors": 14,
      "lastRequestAt": "2026-10-30T11:58:12Z",
      "topPaths": [
        {
          "path": "/v1/quote",
          "requests": 701
        },
        {
          "path": "/v1/orders",
          "requests": 180
        },
        {
          "path": "/v1/chains",
          "requests": 31
        }
      ],
      "keys": [
        {
          "id": "key_01jb8x3a",
          "name": "production",
          "prefix": "lh_live_3fA9",
          "livemode": true,
          "rateLimitRpm": 120,
          "createdAt": "2026-10-28T09:20:00Z",
          "lastUsedAt": "2026-10-30T11:58:12Z",
          "revokedAt": "2026-10-30T12:00:00Z",
          "requests": 912,
          "errors": 14,
          "errorRate": 0.0154
        }
      ]
    }
  ]
}
```

### Swap funnel per day

`GET /v1/admin/funnel`

The layerhop.com swap funnel from its first-party events (`POST /v1/events`), per UTC day
(oldest first, today last) and for the whole window: distinct sessions and event counts for
every event, and the conversion between consecutive funnel steps (`page_view` →
`quote_shown` → `wallet_connect_clicked` → `wallet_connected` → `review_opened` →
`swap_clicked` → `tx_sign_requested` → `tx_signed` → `order_submitted` → `order_filled`).

`entries` splits the whole window by landing page (the `entry` prop): `hl-hub` is
/hyperliquid and `bridge:<slug>` is /bridge/<slug>, `bridge-to:<chain>` is /bridge-to/<chain>, `swap:<slug>` is /swap/<slug>, each counting the page's own `page_view`
and every event of the swap widget it frames; `pay-hub` is /payments and `pay:<slug>` is
/payments/<slug> (merchant pages: their `page_view` and `cta_clicked`); `entry: null` is
everything else (the swap page). `?entry=` narrows `days`, `total` and `entries` to one landing page.

A rate is `sessions(to) / sessions(from)` with 4 decimals, `null` when no session reached
`from`. It can exceed 1: a returning visitor's wallet reconnects without a connect click.
Session hashes rotate at UTC midnight, so `total` counts a session that spans midnight once
per day.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `days` | integer | no | Number of days, 1 to 90 (default 7). (default `7`) (1–90) |
| `entry` | string | no | Only this landing page's events: `hl-hub`, `bridge:<slug>`, `bridge-to:<chain>`, `swap:<slug>`, `pay-hub` or `pay:<slug>`. Anything else is `INVALID_PARAMS`. (pattern `^(?:hl-hub\|pay-hub\|(?:bridge\|bridge-to\|swap\|pay):[a-z0-9][a-z0-9-]{0,47})$`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Funnel per day and for the window. | [FunnelResponse](#funnelresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/funnel"
```

**Example response** (`200`)

```json
{
  "entry": "bridge:base-to-hyperliquid",
  "days": [
    {
      "date": "2026-10-19",
      "sessions": {
        "page_view": 40,
        "quote_shown": 31,
        "wallet_connect_clicked": 9,
        "wallet_connected": 6,
        "review_opened": 2,
        "swap_clicked": 1,
        "tx_sign_requested": 1,
        "tx_signed": 0,
        "order_submitted": 0,
        "order_filled": 0,
        "amount_entered": 33,
        "route_changed": 3,
        "quote_error": 4,
        "tx_rejected": 1,
        "swap_error": 0,
        "order_failed": 0,
        "hl_referral_clicked": 0,
        "cta_clicked": 0,
        "page_leave": 0
      },
      "events": {
        "page_view": 52,
        "quote_shown": 64,
        "wallet_connect_clicked": 11,
        "wallet_connected": 6,
        "review_opened": 2,
        "swap_clicked": 1,
        "tx_sign_requested": 1,
        "tx_signed": 0,
        "order_submitted": 0,
        "order_filled": 0,
        "amount_entered": 33,
        "route_changed": 4,
        "quote_error": 5,
        "tx_rejected": 1,
        "swap_error": 0,
        "order_failed": 0,
        "hl_referral_clicked": 0,
        "cta_clicked": 0,
        "page_leave": 0
      },
      "conversion": [
        {
          "from": "page_view",
          "to": "quote_shown",
          "rate": 0.775
        },
        {
          "from": "quote_shown",
          "to": "wallet_connect_clicked",
          "rate": 0.2903
        }
      ],
      "overall": 0
    }
  ],
  "total": {
    "sessions": {
      "page_view": 40,
      "quote_shown": 31
    },
    "events": {
      "page_view": 52,
      "quote_shown": 64
    },
    "conversion": [
      {
        "from": "page_view",
        "to": "quote_shown",
        "rate": 0.775
      }
    ],
    "overall": 0
  },
  "entries": [
    {
      "entry": "bridge:base-to-hyperliquid",
      "sessions": {
        "page_view": 40,
        "quote_shown": 31
      },
      "events": {
        "page_view": 52,
        "quote_shown": 64
      },
      "conversion": [
        {
          "from": "page_view",
          "to": "quote_shown",
          "rate": 0.775
        }
      ],
      "overall": 0
    }
  ]
}
```

### Top swap funnel errors

`GET /v1/admin/funnel/errors`

The window's most frequent failures from the swap funnel (`POST /v1/events`), so the next
fixes are visible without SQL: `quoteErrors` groups `quote_error` events by route, error
code and token context (symbols and whether each token is listed); `swapErrors` groups
`swap_error`, `tx_rejected` and `order_failed` by route, provider, `error_class`, error code
and the signature that failed, with up to 3 sanitized reasons. Up to 50 groups each, most
events first. Events sent before these props existed group under `null`.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `days` | integer | no | Number of days, 1 to 90 (default 14). (default `14`) (1–90) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Top errors of the window. | [FunnelErrorsResponse](#funnelerrorsresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/funnel/errors"
```

**Example response** (`200`)

```json
{
  "days": 14,
  "from": "2026-10-15T00:00:00.000Z",
  "to": "2026-10-29T00:00:00.000Z",
  "quoteErrors": [
    {
      "srcChain": "solana",
      "dstChain": "solana",
      "errorCode": "NO_ROUTE",
      "srcToken": "SOL",
      "dstToken": "PUMPX",
      "srcTokenListed": true,
      "dstTokenListed": false,
      "events": 4,
      "sessions": 3
    }
  ],
  "swapErrors": [
    {
      "event": "swap_error",
      "provider": "lifi",
      "srcChain": "solana",
      "dstChain": "monad",
      "errorClass": "svm_blockhash",
      "errorCode": "BLOCKHASH_EXPIRED",
      "step": "swap",
      "events": 6,
      "sessions": 4,
      "reasons": [
        "Signature [addr] has expired: block height exceeded"
      ]
    }
  ]
}
```

### LayerHop's own wallets and balances

`GET /v1/admin/wallets`

Every wallet LayerHop controls (D-062): treasury, test wallets, fee recipients, billing and
launch partner addresses. Built-in list, plus the configured `FEE_RECIPIENT_*`,
`BILLING_RECIPIENT_*`, `LAUNCH_PARTNER_WALLET*` addresses and `ADMIN_WALLETS_JSON`, one entry
per address (a repeat merges its roles). Public addresses only: no private key or key location
beyond who holds it (`agent`: kept in the owner's Keychain for agent test swaps, D-033; `owner`).

Balances come from the `GET /v1/balances` machinery: EVM wallets on every EVM chain in
`GET /v1/chains` (each chain's top tokens), Solana wallets on Solana, Tron wallets TRX, USDT and
every other TRC-20 / TRC-10, and the Bitcoin treasury (mempool.space, confirmed plus unconfirmed).
On top of the top tokens, every other ERC-20 an EVM wallet holds is discovered from Blockscout
(cached 10 min; `discoveryChains` lists the chains covered, a failure is in the wallet's
`discoveryErrors` and never drops the chain's normal balances).
Tokens without a USD price (and single holdings worth over $1B, which are bad reads) are listed
in `unpriced` and never counted. Spam and look-alike tokens (address poisoning, airdrops, a fake
USDC with another contract) are listed in `spam` with a reason, never priced or counted. A chain that can't be read is listed in the wallet's `errors`;
the rest still counts. Cached 60 s; `fresh=1` reloads when the report is at least 15 s old.

Each wallet also has `pending`: money that is ours but in transit. `totalUsd` / `onchainUsd` is the
real on-chain balance, `totalWithPendingUsd` adds `pending.totalUsd`. Pending is (a) for the Across
filler wallet, the fills of the last 7 days that Across has not repaid yet (the repayment arrives
on the order's origin chain in its input token, from the chain's SpokePool; refunds are read from
Blockscout and allocated FIFO to the fills, an estimate because Across has no per-fill refund
status) and (b) treasury moves in status `submitted` (a CCTP burn whose mint is not done), counted
for the destination wallet; those older than 7 days are `stale` and never counted. What could not
be read is listed in `pending.unknown` (the pending value may then be higher).

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `fresh` | `"0"` \| `"1"` | no | 1 = read the chains again (when the cached report is at least 15 s old). |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Wallets, their balances and the totals. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/wallets"
```

**Example response** (`200`)

```json
{
  "checkedAt": "2026-11-03T20:00:00.000Z",
  "cacheSeconds": 60,
  "cached": false,
  "stale": false,
  "totals": {
    "usd": 203.43,
    "byHolder": {
      "agent": 203.43,
      "owner": 0
    },
    "byChain": [
      {
        "chainId": 8453,
        "name": "Base",
        "usd": 203.43
      }
    ]
  },
  "chainsScanned": {
    "evm": 68,
    "svm": 1,
    "tvm": 1,
    "btc": 1
  },
  "discoveryChains": [
    1,
    10,
    8453
  ],
  "wallets": [
    {
      "id": "treasury-evm",
      "label": "Treasury (EVM)",
      "purpose": "Treasury and release test swaps on every EVM chain",
      "roles": [
        "treasury",
        "test"
      ],
      "vm": "evm",
      "address": "0x5aA3766604174ef85Fe7612611F30A11837231d7",
      "keyHolder": "agent",
      "keyLocation": "Keychain on the owner's Mac (agent)",
      "decisions": [
        "D-033"
      ],
      "sources": [
        "built-in"
      ],
      "explorerUrl": "https://etherscan.io/address/0x5aA3766604174ef85Fe7612611F30A11837231d7",
      "totalUsd": 203.43,
      "byChain": [
        {
          "chainId": 8453,
          "name": "Base",
          "usd": 203.43,
          "explorerUrl": "https://basescan.org/address/0x5aA3766604174ef85Fe7612611F30A11837231d7"
        }
      ],
      "tokens": [
        {
          "chainId": 8453,
          "chainName": "Base",
          "symbol": "USDC",
          "name": "USD Coin",
          "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "decimals": 6,
          "amount": "191412732",
          "display": "191.412732",
          "priceUsd": 1,
          "usd": 191.412732
        }
      ],
      "unpriced": [],
      "spam": [],
      "discoveryErrors": [],
      "errors": [
        {
          "chainId": 50,
          "name": "XDC",
          "message": "RPC unavailable: The operation was aborted due to timeout"
        }
      ],
      "checkedAt": "2026-11-03T20:00:00.000Z"
    }
  ]
}
```

### Build an unsigned transfer between two registry wallets

`POST /v1/admin/treasury/transfer`

Treasury "Move funds" (D-063). An UNSIGNED transfer of a listed token (native coin, ERC-20 or
classic SPL) from an owner-held registry wallet to another registry wallet on the same chain,
simulated against mainnet (as the sender) before it is returned. The owner signs it in their own
wallet; LayerHop never signs, sends or holds a key. Recipients are registry wallets only (there
is no address field). Agent-held wallets are refused (`FORBIDDEN`): they move only through the
local treasury CLI. Tron isn't supported here. A failed simulation is returned in `simulation`
(the dashboard then refuses to sign), not as an error.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The unsigned transaction, its summary and the simulation. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | `FORBIDDEN`: the sending wallet is agent-held (use the local treasury CLI). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/treasury/transfer" \
  -H "content-type: application/json" \
  -d '{}'
```

### Check a quote for a treasury swap

`POST /v1/admin/treasury/swap-check`

Before the dashboard builds and signs a treasury swap or bridge (D-063): the stored live quote
(from `GET /v1/quote`) must have the owner-held registry wallet `fromWalletId` as sender and the
registry wallet `toWalletId` as recipient, on chains of their VMs, and no destination calls.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The quote may be signed. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | `FORBIDDEN`: the quote's sender or recipient isn't the chosen registry wallet, the sender is agent-held, or the quote has destination calls. | [Error](#error) |
| `404` | Unknown `quoteId`, or the provider can no longer build it (`QUOTE_NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/treasury/swap-check" \
  -H "content-type: application/json" \
  -d '{}'
```

### Treasury log

`GET /v1/admin/treasury/moves`

Sends, swaps and claims between LayerHop's wallets (D-063), newest first. Needs the platform database.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | (default `50`) (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Moves. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/treasury/moves"
```

### Record or update a treasury move

`POST /v1/admin/treasury/moves`

Without `id`: records a move (201). Wallet ids must be registry ids; their addresses are taken
from the registry, never from the body. A send or swap needs `fromWalletId`, and `actor` must
match who holds that wallet's key (`agent-cli` for agent-held, `owner-dashboard` for
owner-held); a claim may name its `source` instead. With `id`: updates `status`, appends
`txHashes`, sets `orderId` / `note` (200). A log only: nothing is signed or sent.

**Request body** — object | object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Updated. | object |
| `201` | Recorded. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/treasury/moves" \
  -H "content-type: application/json" \
  -d '{}'
```

### Claimable fee sources

`GET /v1/admin/treasury/fee-sources`

Fees that wait until claimed (D-063), read from keyless public endpoints: Relay app fees
(`GET https://api.relay.link/app-fees/{feeWallet}/balances`), EVM launch integrator fees
(Doppler, the web app's `/api/launch/evm/fees`) and Solana launch partner fees (Meteora DBC,
`/api/launch/fees`). Sources without a keyless read (Raydium LaunchLab platform fees, LI.FI) are
listed with `status: info`. Each has its existing claim flow as a link; nothing is claimed here.
Cached 60 s.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Fee sources. | object |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/treasury/fee-sources"
```

### Route health per chain

`GET /v1/admin/route-health`

The API's periodic route probes (D-036): per listed chain its `status`, both directions and
each probe row (direction × token kind) with its failure streak and last error code. Worst
first (`unavailable`, `deposit_only`, `withdraw_only`, `unknown`, `ok`). `enabled: false` when
the API runs without route health.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Route health of every listed chain. | object |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/route-health"
```

**Example response** (`200`)

```json
{
  "enabled": true,
  "lastRunAt": "2026-10-23T06:00:00.000Z",
  "chains": [
    {
      "chainId": 14,
      "slug": "flare",
      "name": "Flare",
      "status": "deposit_only",
      "in": "ok",
      "out": "failing",
      "checkedAt": "2026-10-23T06:00:00.000Z",
      "probes": [
        {
          "direction": "in",
          "tokenKind": "native",
          "token": "0x0000000000000000000000000000000000000000",
          "ok": true,
          "consecutiveFailures": 0,
          "lastOkAt": "2026-10-23T06:00:00.000Z",
          "lastCheckedAt": "2026-10-23T06:00:00.000Z"
        },
        {
          "direction": "out",
          "tokenKind": "native",
          "token": "0x0000000000000000000000000000000000000000",
          "ok": false,
          "consecutiveFailures": 3,
          "lastErrorCode": "NO_ROUTE",
          "lastCheckedAt": "2026-10-23T06:00:00.000Z"
        }
      ]
    }
  ]
}
```

### Price competitiveness vs going direct

`GET /v1/admin/price-check`

The worker's daily price check (read-only quotes). For a fixed basket of popular routes, each at
$50, $500 and $5,000, it compares our best quote as a web-channel user gets it (with the web
fee) with every provider quoted with no app or integrator fee (the provider's public API).

`gapBps` = (best direct − ours) / best direct × 10,000: above 0 a user who compares gets less
through us. `breakEvenFeeBps` = the fee our winning provider applied − `gapBps`: the fee at which
our output would match the best direct output (negative: even at 0% our pick loses). A provider's
own website may add an interface fee on top of its API price, which this check can't see, so
the real direct price can be equal or worse (see `caveats`).

Returns the latest run in full and, per route and size over the last `days`, gap and
break-even statistics. `latestRun` is null until the worker has stored a run.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `days` | integer | no | Summary window in days, 1 to 90 (default 7). (default `7`) (1–90) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Latest run and per-route summary. | [PriceCheckReport](#pricecheckreport) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/price-check"
```

**Example response** (`200`)

```json
{
  "webFeeBps": 30,
  "days": 7,
  "latestRun": {
    "runId": "pc_01m5a2b3c4d5e6f7g8h9j0k1m2",
    "checkedAt": "2026-10-20T06:00:00.000Z",
    "rows": [
      {
        "routeId": "usdc-base-arbitrum",
        "label": "USDC Base → Arbitrum",
        "sizeUsd": 500,
        "srcChainId": 8453,
        "srcToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "dstChainId": 42161,
        "dstToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
        "amount": "500000000",
        "feeBps": 30,
        "ours": {
          "provider": "relay",
          "dstAmount": "498350000",
          "appliedFeeBps": 30,
          "dstUsd": 498.35
        },
        "bestDirect": {
          "provider": "relay",
          "dstAmount": "499850000",
          "dstUsd": 499.85
        },
        "gapBps": 30.01,
        "breakEvenFeeBps": -0.01,
        "providers": [
          {
            "provider": "relay",
            "dstAmount": "499850000",
            "oursDstAmount": "498350000",
            "oursAppliedFeeBps": 30,
            "estimatedSeconds": 4
          },
          {
            "provider": "lifi",
            "error": "PROVIDER_TIMEOUT: Timed out: li.quest"
          }
        ]
      }
    ]
  },
  "routes": [
    {
      "routeId": "usdc-base-arbitrum",
      "label": "USDC Base → Arbitrum",
      "sizeUsd": 500,
      "runs": 7,
      "compared": 7,
      "latestGapBps": 30.01,
      "avgGapBps": 29.8,
      "minGapBps": 28.9,
      "maxGapBps": 30.4,
      "avgBreakEvenFeeBps": 0.2,
      "minBreakEvenFeeBps": -0.4,
      "oursMatchedOrBeat": 0,
      "bestDirectWins": {
        "relay": 7
      },
      "oursWins": {
        "relay": 7
      }
    }
  ],
  "caveats": {
    "relay": "Relay API without appFees. Relay's execution fees are included; relay.link may add its own app fee on top, which we can't see."
  }
}
```

### Set a key's rate limit

`PATCH /v1/admin/keys/{id}`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Key id. |

**Request body** — [RateLimitRequest](#ratelimitrequest) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The key. | [AdminKeyResponse](#adminkeyresponse) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X PATCH "https://api.layerhop.com/v1/admin/keys/key_01m54s12va302av4ay4epqndye" \
  -H "content-type: application/json" \
  -d '{"rateLimitRpm":600}'
```

### Hide, unhide or feature a launched token

`POST /v1/admin/launch/hide`

Takedown (D-039): a hidden token disappears from `GET /v1/launch/metadata`, the spotlight and
Discord posts, and its metadata JSON and image return `NOT_FOUND`. `hidden: false` restores it.
`featured` pins it in the spotlight (promotion only, not a safety claim). At least one of the
two is required.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The new state. | [LaunchCurationState](#launchcurationstate) |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/launch/hide" \
  -H "content-type: application/json" \
  -d '{"mint":"5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG","hidden":true}'
```

### List community reports for review

`GET /v1/admin/reports`

Community scam reports by status, newest first, with the reporter, the full note and how
many visible reports the same target has. `counts` has the totals per status.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | `"pending"` \| `"approved"` \| `"hidden"` | no | `pending` (default), `approved` or `hidden`. (default `"pending"`) |
| `limit` | integer | no | (default `100`) (1–200) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Reports and counts. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/reports"
```

### Approve a community report

`POST /v1/admin/reports/{id}/approve`

Makes the report's note public. The report keeps counting.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The reviewed report. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/reports/rep_01jd8m3q0x9f2v7w5k3n1h4b6c8d/approve"
```

### Hide a community report

`POST /v1/admin/reports/{id}/hide`

Spam or abuse. The report stops counting and its note is never shown; approve brings it back.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The reviewed report. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/reports/rep_01jd8m3q0x9f2v7w5k3n1h4b6c8d/hide"
```

### List ecosystem submissions for review

`GET /v1/admin/ecosystem`

Built on LayerHop submissions by status, newest first, with the private contact and the logo's source URL. `counts` has the totals per status.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | `"pending"` \| `"approved"` \| `"rejected"` | no | `pending` (default), `approved` or `rejected`. (default `"pending"`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Submissions and counts. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/ecosystem"
```

### A submission's logo (any status)

`GET /v1/admin/ecosystem/{id}/logo`

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The stored image. | — |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/ecosystem/eco_01jd8m3q0x9f2v7w5k3n1h4b6c/logo"
```

### Approve an ecosystem submission

`POST /v1/admin/ecosystem/{id}/approve`

Lists the project on layerhop.com/ecosystem (the page refreshes every 5 minutes).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The reviewed submission. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/ecosystem/eco_01jd8m3q0x9f2v7w5k3n1h4b6c/approve"
```

### Reject an ecosystem submission

`POST /v1/admin/ecosystem/{id}/reject`

Keeps the project off the page (or takes an approved one down).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The reviewed submission. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/ecosystem/eco_01jd8m3q0x9f2v7w5k3n1h4b6c/reject"
```

### List partner program applications

`GET /v1/admin/partner-program/applications`

Applications by status, newest first, with the private contact. `counts` has the totals per status.

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | `"new"` \| `"contacted"` \| `"accepted"` \| `"declined"` | no | `new` (default), `contacted`, `accepted` or `declined`. (default `"new"`) |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Applications and counts. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/partner-program/applications"
```

### Update a partner program application

`POST /v1/admin/partner-program/applications/{id}`

Sets the status and, optionally, a private note (an empty note clears it).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The updated application. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/partner-program/applications/papp_01jd8m3q0x9f2v7w5k3n1h4b6c" \
  -H "content-type: application/json" \
  -d '{"status":"contacted","note":"Intro call booked"}'
```

### Referral reward balances

`GET /v1/admin/referrals/rewards`

Every referrer with accrued rewards or recorded payouts, most unpaid first, and the latest 100
payouts. While rewards are off (`enabled: false`) `referrers` is empty.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Balances and payouts. | object |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |

**Example request**

```bash
curl "https://api.layerhop.com/v1/admin/referrals/rewards"
```

### Record a referral reward payout

`POST /v1/admin/referrals/payouts`

Records a transfer the operator already sent to a referrer by hand (this endpoint moves no
funds). `amountUsd` may not exceed the referrer's unpaid balance (1 cent tolerance); the same
referrer, chain and `txHash` can't be recorded twice unless voided. `FORBIDDEN` while rewards
are off.

**Request body** — object (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `201` | The recorded payout. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `403` | `FORBIDDEN`: referral rewards are off on this deployment. | [Error](#error) |
| `409` | The request conflicts with existing state (`CONFLICT`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/referrals/payouts" \
  -H "content-type: application/json" \
  -d '{"referrer":"0x2222222222222222222222222222222222222222","amountUsd":42.5,"chainId":8453,"txHash":"0x8f1c4c0f0f4bd5a1c5e0d2b6f9a3c7e1d4b2a6c8e0f1a3b5c7d9e1f3a5b7c9d1","token":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","amount":"42500000"}'
```

### Void a referral payout

`POST /v1/admin/referrals/payouts/{id}/void`

Marks a recorded payout as a mistake; it stops counting as paid.

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | The voided payout. | object |
| `401` | Missing or wrong credentials (`UNAUTHORIZED`). | [Error](#error) |
| `404` | The resource does not exist or belongs to another account (`NOT_FOUND`). | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/admin/referrals/payouts/rpo_01jd8m3q0x9f2v7w5k3n1h4b6c/void"
```

## Internal

Used by layerhop.com itself, not part of the supported API: no SDK method, no Postman entry, and it may change without notice. Exists only when the operator runs the API with a database.

### Record swap funnel events

`POST /v1/events`

Anonymous funnel events from layerhop.com's own swap app, its landing pages, and the swap
widget only while it is framed by one of those landing pages (never the widget on other
sites), read back with `GET /v1/admin/funnel`. The body is JSON; any content type is
accepted because `navigator.sendBeacon` posts `text/plain`.

Only known event names are stored (others are counted in `dropped`), and only allowlisted
props with valid values are kept: `page` (`swap` or `landing`), `entry` (landing page:
`hl-hub`, `bridge:<slug>`, `bridge-to:<chain>`, `swap:<slug>`, `pay-hub` or `pay:<slug>`), `src_chain`, `dst_chain`, `same_chain`,
`provider`, `routes`, `error_code`, `vm`, `source`, `step`, `usd_bucket`, `from_link`,
`channel`, `placement` (`success` or `landing`, for `hl_referral_clicked`), `cta` (`signup` or `docs`, for `cta_clicked`),
`error_class` and `error_reason` (on `swap_error` / `tx_rejected`: the kind of failure and its
message cut to 80 characters, refused if it contains anything address-, hash- or amount-shaped),
`src_token` / `dst_token` (symbols) and `src_token_listed` / `dst_token_listed` (on `quote_error`; on a
`page_view` from a prefilled link, with `src_chain` / `dst_chain`, the linked pair),
`entry_source` (`page_view`: `internal:<surface>` for LayerHop's own links, `external_link` for a
prefilled link without that marker, or `direct`), `referrer_host` (the referrer's host name only),
`device` (`mobile`, `tablet` or `desktop`), `in_app_browser` (`none`, a social app such as `x`,
`telegram`, `instagram`, `facebook`, `discord`, or a wallet such as `phantom`, `metamask`,
`coinbase`, `trust`; `wallet_other` for an unknown wallet's browser), `wallet_detected_evm` /
`wallet_detected_svm` (an injected wallet was present), `wallet` (connector name, at most 32
characters, on `wallet_connected` and the transaction events), `last_step` (`page_leave`: the
furthest funnel step reached) and `t_ms` (client milliseconds since the page loaded, on every
event; at most 7 days). Crawlers and automated browsers send nothing. The API
stores an HMAC of `sessionId` under a key that rotates every UTC day and the same daily IP
hash as request logs; never IPs, wallet addresses, amounts or transaction hashes.

Limits: 25 events and 16 KB per request, 30 requests per minute per IP. Requests from a
browser `Origin` other than the site's get `FORBIDDEN`. Not counted in request logs.

**Request body** — [FunnelEventBatch](#funneleventbatch) (required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `202` | Stored. | object |
| `400` | Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`, `AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`). | [Error](#error) |
| `403` | `FORBIDDEN`: sent from another site's page. | [Error](#error) |
| `413` | `INVALID_PARAMS`: body over 16 KB. | [Error](#error) |
| `429` | Over your rate limit (`RATE_LIMITED`): the key's `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP without a key. Wait `retry-after` seconds. | [Error](#error) |

**Example request**

```bash
curl -X POST "https://api.layerhop.com/v1/events" \
  -H "content-type: application/json" \
  -d '{"sessionId":"Yp3kQ0x1c2VzZXNzaW9uAA","events":[{"name":"page_view","props":{"page":"swap","channel":"web","from_link":true,"entry_source":"external_link","referrer_host":"t.co","device":"mobile","in_app_browser":"x","wallet_detected_evm":false,"wallet_detected_svm":false,"src_chain":"base","src_token":"USDC","dst_chain":"solana","dst_token":"SOL","t_ms":640}},{"name":"quote_shown","props":{"src_chain":"base","dst_chain":"solana","same_chain":false,"provider":"relay","routes":3,"usd_bucket":"10-100"}}]}'
```

**Example response** (`202`)

```json
{
  "accepted": 2,
  "dropped": 0
}
```

## Schemas

### ErrorCode

Stable error code. Each has a page at `https://docs.layerhop.com/errors/{code}`.

`string`, one of:

- [`INVALID_PARAMS`](/errors/INVALID_PARAMS)
- [`UNSUPPORTED_CHAIN`](/errors/UNSUPPORTED_CHAIN)
- [`UNSUPPORTED_TOKEN`](/errors/UNSUPPORTED_TOKEN)
- [`AMOUNT_TOO_SMALL`](/errors/AMOUNT_TOO_SMALL)
- [`AMOUNT_TOO_LARGE`](/errors/AMOUNT_TOO_LARGE)
- [`CALLS_REVERTED`](/errors/CALLS_REVERTED)
- [`LAUNCH_IMAGE_INVALID`](/errors/LAUNCH_IMAGE_INVALID)
- [`NO_ROUTE`](/errors/NO_ROUTE)
- [`ROUTE_EXCLUDED`](/errors/ROUTE_EXCLUDED)
- [`QUOTE_NOT_FOUND`](/errors/QUOTE_NOT_FOUND)
- [`QUOTE_EXPIRED`](/errors/QUOTE_EXPIRED)
- [`ORDER_NOT_FOUND`](/errors/ORDER_NOT_FOUND)
- [`PROVIDER_ERROR`](/errors/PROVIDER_ERROR)
- [`PROVIDER_TIMEOUT`](/errors/PROVIDER_TIMEOUT)
- [`RATE_LIMITED`](/errors/RATE_LIMITED)
- [`QUOTA_EXCEEDED`](/errors/QUOTA_EXCEEDED)
- [`UNAUTHORIZED`](/errors/UNAUTHORIZED)
- [`FORBIDDEN`](/errors/FORBIDDEN)
- [`ADDRESS_SANCTIONED`](/errors/ADDRESS_SANCTIONED)
- [`NOT_FOUND`](/errors/NOT_FOUND)
- [`CONFLICT`](/errors/CONFLICT)
- [`GASLESS_PENDING`](/errors/GASLESS_PENDING)
- [`GASLESS_FAILED`](/errors/GASLESS_FAILED)
- [`MARKET_UNAVAILABLE`](/errors/MARKET_UNAVAILABLE)
- [`LIMIT_ORDER_REJECTED`](/errors/LIMIT_ORDER_REJECTED)
- [`INTERNAL`](/errors/INTERNAL)

### Error

Every non-2xx response has this body.

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object | yes | — |
| `error.code` | [ErrorCode](#errorcode) | yes | — |
| `error.message` | string | yes | Human-readable detail. Do not parse it. |
| `error.requestId` | string (uuid) | yes | Same value as the `x-request-id` header. |
| `error.docsUrl` | string (uri) | yes | Error catalog page, `https://docs.layerhop.com/errors/{code}`. |
| `error.details` | object | no | Extra structured data, only on some errors. `NO_ROUTE` (and `AMOUNT_TOO_SMALL` / `AMOUNT_TOO_LARGE` decided from the providers' answers) on a quote carry `errors`: why each provider returned no quote, the same entries a successful response lists in `errors`. `AMOUNT_TOO_SMALL` on a quote may also carry the route's minimum (D-036): `minAmount`, `minAmountUsd`, `minAmountApprox`. `NO_ROUTE` on a live quote (and `UNSUPPORTED_CHAIN` into a route-restricted chain such as Blast) may carry `suggestions` (D-053). |
| `error.details.errors` | [ProviderError](#providererror)[] | no | — |
| `error.details.suggestions` | [RouteSuggestion](#routesuggestion)[] | no | `NO_ROUTE` / `UNSUPPORTED_CHAIN` on a live quote: alternatives that quoted, best first (D-053). |
| `error.details.minAmount` | string | no | `AMOUNT_TOO_SMALL`: smallest input known to quote on this route, base units of `srcToken`. (pattern `^\d+$`) |
| `error.details.minAmountUsd` | number | no | `AMOUNT_TOO_SMALL`: `minAmount` in USD, when the token has a price. |
| `error.details.minAmountApprox` | boolean | no | `AMOUNT_TOO_SMALL`: `true` when `minAmount` was found by probing larger amounts ($10 / $25 / $50), so the true minimum is at most this; `false` when a provider reported it. |

### RouteLeg

One quotable leg, in the same terms as a quote request. Amounts are base units.

| Field | Type | Required | Description |
|---|---|---|---|
| `srcChain` | integer | yes | Source chain id. |
| `srcToken` | string | yes | Source token address or mint (native coin: the zero address; SOL: the system program id). |
| `amount` | string | yes | Input in base units of `srcToken`. (pattern `^\d+$`) |
| `dstChain` | integer | yes | Destination chain id. |
| `dstToken` | string | yes | — |
| `dstAmount` | string | no | Estimated output in base units of `dstToken` (from the check quote; scaled when served from cache). (pattern `^\d+$`) |

### RouteSuggestion

An alternative to a route that returned no quote (D-053). `dst_token`: same payment, another
destination token. `src_token`: same destination token, paid with another source token worth the
same. `via_hub`: two signed steps through `hub` (`steps[0]` then `steps[1]`, each its own quote,
order and signature); the top-level fields describe the whole trip.

Type: object

### ProviderId

Liquidity provider. Loaded by default: `jupiter`, `relay`, `debridge`, `zerox`, `kyberswap`, `lifi`, `mayan`,
`blast-native` (Blast's canonical bridge: ETH on Ethereum → ETH on Blast only, no LayerHop fee).
`across` (Across Protocol, cross-chain EVM ↔ EVM), `baltex` (Baltex exchanges and DEX swaps), `routefun`
(Route, same-chain), `bebop` (Bebop RFQ and Aggregation, same-chain), `near-intents` (NEAR Intents 1Click),
`thorchain` and `chainflip` (native BTC and other non-EVM routes) `layerhop-solver` (LayerHop's own solver: USDC between Base,
Arbitrum and OP Mainnet, filled from our inventory) and `layerhop-router` (LayerHop's own same-chain
router on Robinhood Chain and Berachain) are built but not loaded by default.
`odos` is shut down; `mock` exists only in local
development (`LAYERHOP_ENABLE_MOCK=1`). `sandbox` serves every request made with an `lh_test_` key.
`direct` is a plain token transfer, used by checkout when the payer already holds the settlement token.

`string`, one of:

- `jupiter`
- `relay`
- `debridge`
- `mayan`
- `zerox`
- `kyberswap`
- `odos`
- `lifi`
- `blast-native`
- `across`
- `baltex`
- `routefun`
- `bebop`
- `near-intents`
- `thorchain`
- `chainflip`
- `layerhop-router`
- `layerhop-solver`
- `mock`
- `sandbox`
- `direct`

### FeeChannel

Where the trade comes from; decides LayerHop's fee. Defaults: `web` 15 bps, `widget`
15 bps, `api` 10 bps, `bot` 45 bps (operators can override them).

`string`, one of:

- `web`
- `widget`
- `bot`
- `api`

### Vm

Virtual machine family. `svm` is Solana; `tvm` is Tron (D-048: listed and quoted only where the
API runs with Tron enabled; until then no response carries it).

`string`, one of:

- `evm`
- `svm`
- `tvm`

### WalletVm

VM of a wallet that signs in or signs messages (EVM or Solana; Tron wallets can't yet).

`string`, one of:

- `evm`
- `svm`

### Chain

A chain in the registry (`ChainInfo`).

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | integer | yes | EVM chain id, or `7565164` for Solana (LayerHop internal id). |
| `slug` | string | yes | Unique lowercase short name usable anywhere a chain is expected, e.g. `base`, `berachain`. |
| `name` | string | yes | — |
| `vm` | [Vm](#vm) | yes | — |
| `nativeSymbol` | string | yes | — |
| `nativeDecimals` | integer | yes | — |
| `logoURI` | string (uri) | yes | Chain logo (provider CDN). |
| `explorerTx` | string (uri) | yes | Block explorer prefix; append a tx hash. |
| `explorerAddress` | string (uri) | yes | Block explorer prefix; append an address. |
| `providers` | [ProviderId](#providerid)[] | yes | Providers that can route from or to this chain. |
| `popular` | boolean | yes | Shown first in chain pickers. |
| `destinationOnly` | boolean | no | Present (`true`) for chains you can deliver to but not send from, e.g. Hyperliquid (`1337`) and Blast (`81457`). Hide them from source pickers. |
| `onlyRoute` | object | no | Present when every provider of this chain serves one fixed route into it. Blast (`81457`) is reachable only from ETH on Ethereum to ETH on Blast (its canonical bridge). Quotes into the chain from any other source chain or token fail with `UNSUPPORTED_CHAIN`; offer to switch the source instead. |
| `onlyRoute.srcChainId` | integer | yes | — |
| `onlyRoute.srcToken` | string | yes | Source token address (EVM native = 0x000…000). |
| `onlyRoute.dstToken` | string | yes | Destination token address on this chain. |
| `routeHealth` | [ChainRouteHealth](#chainroutehealth) | no | — |

### AdminWalletChainTotal

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `name` | string | yes | — |
| `usd` | number | yes | — |

### AdminWalletPendingItem

| Field | Type | Required | Description |
|---|---|---|---|
| `kind` | `"across_repayment"` \| `"bridge"` \| `"move"` | yes | — |
| `chainId` | integer | yes | Chain the money arrives on. |
| `chainName` | string | yes | — |
| `symbol` | string | yes | — |
| `amount` | string | yes | Base units, integer string. |
| `decimals` | integer | yes | — |
| `display` | string | yes | Human amount (decimal string). |
| `usd` | number \| null | yes | — |
| `count` | integer | yes | Fills or moves behind the item. |
| `oldestAt` | string \| null | yes | — |
| `detail` | string | yes | — |

### AdminWalletPending

Money that is ours but in transit (not in the on-chain balance yet).

| Field | Type | Required | Description |
|---|---|---|---|
| `totalUsd` | number | yes | — |
| `items` | [AdminWalletPendingItem](#adminwalletpendingitem)[] | yes | — |
| `stale` | [AdminWalletPendingItem](#adminwalletpendingitem)[] | yes | Moves submitted more than 7 days ago: shown, never counted. |
| `unknown` | string[] | yes | What could not be read; pending may be higher than shown. |

### AdminWalletToken

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `chainName` | string | yes | — |
| `symbol` | string | yes | — |
| `name` | string | yes | — |
| `address` | string | yes | — |
| `decimals` | integer | yes | — |
| `amount` | string | yes | Base units, integer string. |
| `display` | string | yes | Human amount (decimal string). |
| `priceUsd` | number \| null | yes | — |
| `usd` | number \| null | yes | — |
| `logoURI` | string | no | — |
| `note` | string | no | Why the token is flagged: an implausible value (unpriced), spam, or a remark (e.g. unconfirmed BTC). |

### RouteHealthState

One direction of a chain: `failing` after 2 failed probe runs in a row, `ok` after one success, `unknown` until checked.

`string`, one of:

- `ok`
- `failing`
- `unknown`

### ChainRouteHealth

Result of LayerHop's periodic read-only probe quotes (D-036). `in`: Base USDC (Arbitrum USDC for
Base) → the chain's native coin / canonical stablecoin / WETH. `out`: the reverse. `status`: `ok`,
`deposit_only` (in works, out failing), `withdraw_only` (in failing, out works), `unavailable`
(both failing) or `unknown`.

| Field | Type | Required | Description |
|---|---|---|---|
| `in` | [RouteHealthState](#routehealthstate) | yes | — |
| `out` | [RouteHealthState](#routehealthstate) | yes | — |
| `status` | `"ok"` \| `"deposit_only"` \| `"withdraw_only"` \| `"unavailable"` \| `"unknown"` | yes | — |
| `checkedAt` | string (date-time) | no | Newest probe of this chain. |

### Token

A token (`TokenInfo`).

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `address` | string | yes | Token address or mint. EVM addresses are checksummed; the native coin is `0x0000000000000000000000000000000000000000`. On Solana, native SOL is the wrapped-SOL mint `So11111111111111111111111111111111111111112`. |
| `symbol` | string | yes | — |
| `name` | string | yes | — |
| `decimals` | integer | yes | — |
| `logoURI` | string (uri) | no | — |
| `priceUsd` | number | no | USD price when known (token list, refreshed hourly). |
| `verified` | boolean | yes | On a provider list or LayerHop's curated list. `false` for tokens read on-chain only. |
| `popular` | boolean | no | Stables, wrapped native and majors on that chain. At most one token per symbol per chain (the canonical one); look-alikes stay listed without it. |

### Balance

A wallet balance (non-zero, or a token requested with `tokens`).

Type: object

### SolverHeartbeatStatus

| Field | Type | Required | Description |
|---|---|---|---|
| `solver` | string | yes | The solver wallet that signs heartbeats. |
| `live` | boolean | yes | True while the last heartbeat is under 2 minutes old (solver quotes are offered). |
| `lastSeenAt` | string \| null | yes | — |

### HealthResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `ok` | `true` | yes | — |
| `providers` | [ProviderId](#providerid)[] | yes | — |

### ChainsResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `chains` | [Chain](#chain)[] | yes | — |

### TokensResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `tokens` | [Token](#token)[] | yes | — |
| `nextCursor` | string \| null | yes | Pass as `cursor` to get the next page; `null` on the last page. |

### TokenLookupResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `token` | [Token](#token) | yes | — |

### TokenRiskResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `risk` | [TokenRisk](#tokenrisk) | yes | — |

### TokenRisk

A token's safety report (`GET /v1/tokens/{chain}/{address}/risk`).

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | Chain id (Solana: 7565164). |
| `address` | string | yes | Token address (EVM checksummed) or mint. |
| `level` | `"ok"` \| `"caution"` \| `"danger"` \| `"unknown"` | yes | The worst reason's level; `ok` when the source found nothing; `unknown` when no source answered. Show `danger` prominently and ask for an explicit confirmation before a buy. |
| `verified` | boolean | yes | A major LayerHop lists itself (curated, canonical or native); never checked upstream. |
| `symbol` | string | no | Symbol from the token list or the source, when known. |
| `reasons` | [TokenRiskReason](#tokenriskreason)[] | yes | — |
| `source` | `"list"` \| `"goplus"` \| `"none"` | yes | `list` for listed majors, `goplus` for a GoPlus report, `none` when no source answered. |
| `checkedAt` | string (date-time) | yes | — |

### TokenRiskReason

| Field | Type | Required | Description |
|---|---|---|---|
| `code` | `"honeypot"` \| `"cannot_sell"` \| `"cannot_buy"` \| `"buy_tax"` \| `"sell_tax"` \| `"transfer_fee"` \| `"mintable"` \| `"balance_changeable"` \| `"blacklist"` \| `"transfers_pausable"` \| `"freezable"` \| `"proxy"` \| `"hidden_owner"` \| `"ownership_reclaimable"` \| `"not_open_source"` \| `"transfer_hook"` \| `"few_holders"` \| `"fake_symbol"` \| `"airdrop_scam"` \| `"fake_token"` \| `"tax_modifiable"` \| `"selfdestruct"` \| `"external_call"` \| `"closable"` \| `"no_trading_data"` | yes | — |
| `level` | `"caution"` \| `"danger"` | yes | — |
| `message` | string | yes | One plain sentence for the user. |
| `value` | number | no | Percent for `buy_tax`, `sell_tax` and `transfer_fee` (10 or more is `danger`); holder count for `few_holders`. |

### CommunityReports

Community reports for one address or token. `count` includes reports not reviewed yet; notes
show only after an admin approved them. A signal from users, never a verdict.

| Field | Type | Required | Description |
|---|---|---|---|
| `target` | string | yes | EVM address (lower-case) or Solana address. |
| `count` | integer | yes | Reports that aren't hidden. |
| `approved` | integer | no | Of `count`, the reports an admin approved. Only approved reports raise a transaction preview's risk. |
| `categories` | object | yes | Reports per category. |
| `categories.scam` | integer | no | — |
| `categories.phishing` | integer | no | — |
| `categories.poisoning` | integer | no | — |
| `categories.rug` | integer | no | — |
| `chainIds` | integer[] | yes | Chains the reports were filed on. |
| `notes` | [CommunityNote](#communitynote)[] | yes | Newest approved notes (at most 5). |
| `lastReportedAt` | string (date-time) | no | — |

### CommunityNote

| Field | Type | Required | Description |
|---|---|---|---|
| `category` | [ReportCategory](#reportcategory) | yes | — |
| `note` | string | yes | — |
| `txHash` | string | no | — |
| `chainId` | integer | yes | — |
| `createdAt` | string (date-time) | yes | — |

### ReportCategory

`phishing` covers drainer sites and malicious approvals; `poisoning` look-alike addresses and zero-value transfers.

`string`, one of:

- `scam`
- `phishing`
- `poisoning`
- `rug`

### ReportRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `vm` | [WalletVm](#walletvm) | yes | — |
| `reporter` | string | yes | The signing wallet. |
| `chain` | string \| integer | yes | Chain id or slug of the target. |
| `target` | string | yes | The address or token reported. |
| `kind` | `"address"` \| `"token"` | yes | — |
| `category` | [ReportCategory](#reportcategory) | yes | — |
| `txHash` | string | no | Optional: a transaction that shows it (EVM 0x + 64 hex, Solana signature). |
| `note` | string | no | Optional; public only after review. |
| `issuedAt` | string (date-time) | yes | `Date.toISOString()` of when the wallet signed; at most 10 minutes old. |
| `signature` | string | yes | EVM: 0x 65-byte signature. Solana: 64-byte signature, base58 or base64. |

### ShareTradesRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `vm` | [WalletVm](#walletvm) | yes | — |
| `wallet` | string | yes | The signing wallet (EVM lowercased in the signed message). |
| `enabled` | boolean | yes | `true` = show my swaps in the feed; `false` = stop. |
| `issuedAt` | string (date-time) | yes | `Date.toISOString()` of when the wallet signed; at most 10 minutes old and newer than the last recorded choice. |
| `signature` | string | yes | EVM: 0x 65-byte signature. Solana: 64-byte signature, base58 or base64. |

### TradeSharing

| Field | Type | Required | Description |
|---|---|---|---|
| `wallet` | string | yes | — |
| `enabled` | boolean | yes | — |
| `since` | string \| null | yes | When sharing was turned on; the feed shows swaps filled after it. |

### FeedTrade

Type: object

### EcosystemEntry

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |
| `name` | string | yes | — |
| `tagline` | string | yes | — |
| `description` | string | no | — |
| `category` | `"wallet"` \| `"dapp"` \| `"bot"` \| `"agent"` \| `"payments"` \| `"tooling"` \| `"analytics"` \| `"other"` | yes | — |
| `uses` | `"api"` \| `"sdk"` \| `"widget"` \| `"checkout"` \| `"mcp"` \| `"telegram"` \| `"other"`[] | yes | — |
| `url` | string (uri) | yes | https only. |
| `logoUrl` | string (uri) | no | The API's copy of the logo (`GET /v1/ecosystem/{id}/logo`). |
| `twitter` | string | no | X handle without @. |
| `github` | string | no | `owner` or `owner/repo`. |
| `chainIds` | integer[] | no | — |

### EcosystemSubmission

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | One line of plain text. (min length 1) |
| `tagline` | string | yes | What it does with LayerHop; one line of plain text. (min length 1) |
| `description` | string | no | — |
| `category` | `"wallet"` \| `"dapp"` \| `"bot"` \| `"agent"` \| `"payments"` \| `"tooling"` \| `"analytics"` \| `"other"` | yes | — |
| `uses` | `"api"` \| `"sdk"` \| `"widget"` \| `"checkout"` \| `"mcp"` \| `"telegram"` \| `"other"`[] | yes | (min items 1) |
| `url` | string (uri) | yes | https only. |
| `logoUrl` | string (uri) | no | https PNG, JPEG, WebP or GIF, at most 512 KB, no redirects. |
| `twitter` | string | no | (pattern `^@?[A-Za-z0-9_]{1,15}$`) |
| `github` | string | no | `owner` or `owner/repo`. |
| `chainIds` | integer[] | no | — |
| `contact` | string | no | Private: how the reviewer reaches you. |

### AdminEcosystemEntry

Type: object

### AdminCommunityReport

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |
| `status` | `"pending"` \| `"approved"` \| `"hidden"` | yes | — |
| `reporterVm` | [WalletVm](#walletvm) | yes | — |
| `reporter` | string | yes | — |
| `chainId` | integer | yes | — |
| `target` | string | yes | — |
| `kind` | `"address"` \| `"token"` | yes | — |
| `category` | [ReportCategory](#reportcategory) | yes | — |
| `txHash` | string \| null | yes | — |
| `note` | string \| null | yes | — |
| `createdAt` | string (date-time) | yes | — |
| `reviewedAt` | string \| null | yes | — |
| `targetCount` | integer | yes | Visible reports on the same target. |

### PreviewRequest

One of three kinds, picked by `kind`.

One of: object · object · object.

### TxPreview

| Field | Type | Required | Description |
|---|---|---|---|
| `kind` | `"evm_tx"` \| `"typed_data"` \| `"solana_tx"` | yes | — |
| `chainId` | integer | yes | — |
| `from` | string | no | — |
| `summary` | string | yes | One plain sentence; starts with "Danger:" when a flag is `danger`. |
| `risk` | `"ok"` \| `"caution"` \| `"danger"` | yes | The worst flag's level. |
| `actions` | object[] | yes | Step by step, in plain language. |
| `balanceChanges` | object[] | yes | Net changes for `from` (negative = leaves the wallet). |
| `transfers` | object[] | yes | Who gets what (at most 50). |
| `approvals` | object[] | yes | Permissions granted to spend the wallet's tokens. |
| `flags` | object[] | yes | — |
| `simulation` | object | yes | — |
| `simulation.method` | `"eth_simulateV1"` \| `"debug_traceCall"` \| `"eth_call"` \| `"decode"` \| `"simulateTransaction"` \| `"none"` | yes | — |
| `simulation.ok` | boolean | yes | `false`: the transaction would fail (see `error`). |
| `simulation.error` | string | no | — |
| `simulation.gasUsed` | string | no | — |
| `community` | [CommunityReports](#communityreports)[] | yes | Community reports on the addresses involved (only those with reports). |
| `addresses` | object[] | yes | — |

### PricesResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `prices` | object | yes | USD price per requested `chainId:address` id. Ids without a price are omitted. |

### BalancesResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | The wallet (EVM addresses checksummed). |
| `vm` | [Vm](#vm) | yes | — |
| `balances` | [Balance](#balance)[] | yes | Non-zero balances plus every token requested with `tokens` (even at zero), highest USD value first. |
| `totalUsd` | number | yes | Sum of `valueUsd`. |
| `errors` | object[] | yes | Chains (or requested tokens) that could not be read; everything else is still returned. |

### FeeBreakdown

| Field | Type | Required | Description |
|---|---|---|---|
| `ourFeeBps` | integer | yes | LayerHop's fee in bps of the input amount actually applied to this quote. Can be lower than the channel fee (or 0) when a provider cannot carry it. |
| `providerFeeUsd` | number | no | Provider / protocol fees in USD, when the provider reports them. |
| `gasUsd` | number | no | Estimated network gas in USD, when known. |
| `integratorFeeBps` | integer | no | Partner fee in bps of the input amount, on top of `ourFeeBps`. Present only when the request selected a registered partner. When the provider could not apply the fee, both parts are 0; when it applied less than requested, the applied fee is split pro rata. |
| `integrator` | string | no | Partner id earning `integratorFeeBps`. Present only with a partner. |
| `tier` | `"stable"` \| `"major"` \| `"longtail"` | no | The token class LayerHop's fee was priced on, present only when the deployment prices fees by token class (off by default). `stable`: both sides are stablecoins (including USDC → USDC bridging). `major`: the riskier side is a native coin, wrapped native or listed blue chip (ETH, BTC and SOL variants). `longtail`: either side is anything else (unlisted, new or memecoins). `ourFeeBps` is always the fee actually applied. |
| `surplusPolicy` | `"user"` \| `"layerhop"` \| `"provider"` | no | Who receives positive slippage (output above `dstAmount`), when the provider documents it. `user`: the recipient keeps all of it. `layerhop`: surplus above `dstAmount` goes to LayerHop, capped at `surplusMaxBps` of `dstAmount`; the user's expected amount and `dstAmountMin` are unchanged (off by default, D-030). `provider`: the provider keeps it (KyberSwap). Absent when the provider documents no policy. |
| `surplusMaxBps` | integer | no | With `surplusPolicy` `layerhop`, the most LayerHop can take, in bps of `dstAmount`. (0–10000) |

### Quote

| Field | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | Pass to `POST /v1/orders`. Test-mode ids start with `q_test_`. (pattern `^q_`) |
| `provider` | [ProviderId](#providerid) | yes | — |
| `dstAmount` | string | yes | Expected output in base units of the destination token, after all fees. (pattern `^\d+$`) |
| `dstAmountMin` | string | yes | Minimum output after slippage. (pattern `^\d+$`) |
| `estimatedSeconds` | integer | yes | Estimated time until funds arrive. (≥ 0) |
| `fees` | [FeeBreakdown](#feebreakdown) | yes | — |
| `expiresAt` | integer | yes | Unix seconds. Build the order before this time. |
| `gasOnArrival` | [GasOnArrival](#gasonarrival) | no | — |
| `srcAmount` | string | no | What `sender` pays in base units of the source token, fees included. Present on exact-output quotes (`dstAmount` requests, destination calls); otherwise the input is the request's `amount`. (pattern `^\d+$`) |
| `srcAmountMax` | string | no | Exact-output quotes only: the most the transaction can take from `sender`, in base units of the source token, slippage included (at least `srcAmount`). Check the balance and the token approval against it. With today's providers it equals `srcAmount`: the input is fixed and price moves are absorbed by the provider or make the order fail without loss. (pattern `^\d+$`) |
| `calls` | [DestinationCallsPlan](#destinationcallsplan) | no | — |
| `gasless` | [GaslessQuoteInfo](#gaslessquoteinfo) | no | — |

### GaslessQuoteInfo

On gasless quotes (`gasless=true`) only. `dstAmount` already accounts for the gas fee.

| Field | Type | Required | Description |
|---|---|---|---|
| `gasFee` | object | no | Network fee the provider's relayer takes from the input token. |
| `gasFee.amount` | string | yes | Base units of `token`. (pattern `^\d+$`) |
| `gasFee.token` | string | yes | The input token. |
| `approval` | boolean | yes | true when the wallet signs a gasless token approval (permit) before the trade: two signatures. |

### QuoteRequestBody

`POST /v1/quote` body. The fields of `GET /v1/quote` (chains may also be numbers), plus
destination calls. Send `amount` for a plain quote, `dstAmount` alone for an exact-output
quote, or `dstAmount` with `calls` or `action`.

| Field | Type | Required | Description |
|---|---|---|---|
| `srcChain` | string \| integer | yes | Source chain id or slug. |
| `srcToken` | string | yes | Source token address, curated symbol, native symbol or popular-token symbol. |
| `amount` | string | no | Input amount in base units of `srcToken` (1 to 2^256 - 1, leading zeros ignored). Not with `dstAmount` (nor with `calls` / `action`). (pattern `^\d+$`) |
| `dstAmount` | string | no | Exact amount of `dstToken` the recipient (or the destination calls) receives, in base units. Required with `calls` / `action`; without them, an exact-output quote as for `GET /v1/quote`. Not with `amount`. (pattern `^\d+$`) |
| `dstChain` | string \| integer | yes | Destination chain id or slug. EVM only with calls. |
| `dstToken` | string | yes | Destination token address, curated symbol, native symbol or popular-token symbol. |
| `sender` | string | yes | Address that signs and pays on the source chain (receives refunds). Must be an address of the source chain's VM. (min length 1) |
| `recipient` | string | yes | Who the output (or what the calls produce) is for. Must be an address of the destination chain's VM (an EVM address with calls). (min length 1) |
| `slippageBps` | integer | no | (default `50`) (1–5000) |
| `channel` | [FeeChannel](#feechannel) | no | — |
| `integrator` | string | no | Partner id, as for `GET /v1/quote`. (pattern `^[a-z0-9-]{1,32}$`) |
| `integratorFeeBps` | integer | no | Partner fee override, as for `GET /v1/quote`. (≥ 0) |
| `referrer` | string | no | Referring wallet (attribution only), as for `GET /v1/quote`. Invalid values are ignored. |
| `copyOf` | string | no | Copy this trade: the copied trade card or wallet, as for `GET /v1/quote`. Invalid values are ignored. |
| `gasOnArrival` | boolean | no | As for `GET /v1/quote`. Not allowed with calls or `dstAmount`. |
| `gasOnArrivalUsd` | number | no | As for `GET /v1/quote`. Not allowed with calls or `dstAmount`. (0.5–20) |
| `gasless` | boolean | no | As for `GET /v1/quote`. Not allowed with calls or `dstAmount`. |
| `excludeProviders` | string \| string[] | no | As for `GET /v1/quote`: provider ids, as an array or a comma-separated string. |
| `excludeBridges` | string \| string[] | no | As for `GET /v1/quote`: bridge ids, as an array or a comma-separated string. |
| `excludeExchanges` | string \| string[] | no | As for `GET /v1/quote`: exchange ids, as an array or a comma-separated string. |
| `purpose` | `"tip"` \| `"split"` \| `"payout"` \| `"gather"` \| `"rebalance"` \| `"fund"` | no | As for `GET /v1/quote` (attribution only). |
| `splitId` | string | no | As for `GET /v1/quote`: pay one share of a split, with `splitShare`. |
| `splitShare` | integer | no | As for `GET /v1/quote`. (≥ 0) |
| `note` | string | no | As for `GET /v1/quote`: a message on a tip or split payment (kept to 140 characters). |
| `calls` | [DestinationCall](#destinationcall)[] | no | Destination calls, run in order by the provider's executor with the output. At most 8, at most 10,000 bytes of calldata each and 24,000 in total. Not with `action`. (min items 1) |
| `action` | [DestinationAction](#destinationaction) | no | — |

### DestinationCall

One contract call on the destination chain. `msg.sender` is the provider's executor, not the user.

| Field | Type | Required | Description |
|---|---|---|---|
| `to` | string | yes | Target contract. Not the zero address, a precompile or Permit2. (pattern `^0x[0-9a-fA-F]{40}$`) |
| `data` | string | yes | ABI-encoded calldata. `transferFrom`, `safeTransferFrom`, `safeBatchTransferFrom` and `permit` are rejected. (pattern `^0x([0-9a-fA-F]{2})*$`) |
| `value` | string | no | Native coin to send with the call, in wei. Only when `dstToken` is the native coin; the values together must not exceed `dstAmount`. (default `"0"`) (pattern `^\d+$`) |

### DestinationAction

A preset that builds the calls server-side. `aave-v3-supply`: `approve(pool, dstAmount)` on
`dstToken`, then `supply(dstToken, dstAmount, recipient, 0)` on the chain's Aave v3 Pool, so the
aTokens go to `recipient`. Chains: Ethereum, Optimism, BNB Chain, Polygon, Base, Arbitrum.
`dstToken` must be an ERC-20 that Aave lists on that chain (else `CALLS_REVERTED`).

| Field | Type | Required | Description |
|---|---|---|---|
| `type` | `"aave-v3-supply"` | yes | — |

### DestinationCallsPlan

The destination calls of a quote, as the provider committed to them, and their simulation.

| Field | Type | Required | Description |
|---|---|---|---|
| `items` | [DestinationCall](#destinationcall)[] | yes | The calls (normalized to lowercase hex). |
| `executor` | string | yes | Contract that receives the output and makes the calls: their `msg.sender`. |
| `executed` | boolean | yes | The provider runs the calls as part of the fill. Always true: quotes that can't are dropped. |
| `simulation` | object | no | Result of the mandatory pre-quote simulation on the destination chain. |
| `simulation.ok` | boolean | yes | — |
| `simulation.gasUsed` | string | yes | Gas the calls used together (decimal string). |
| `simulation.leftover` | string | no | ERC-20 output left in the executor after the calls (decimal string). Anything above 0 is not delivered to anyone you control; spend exactly `dstAmount`. |

### GasOnArrival

Native gas the route delivers to the recipient on top of `dstAmount` (present only when gas
on arrival was requested and this provider includes it). Its cost is already taken out of
`dstAmount`.

| Field | Type | Required | Description |
|---|---|---|---|
| `amount` | string | yes | Base units of the destination chain's native token. (pattern `^\d+$`) |
| `token` | string | yes | Native token address on the destination chain (`0x000…000`). |
| `symbol` | string | yes | — |
| `decimals` | integer | yes | — |
| `usd` | number | no | USD value at quote time. |

### ProviderError

A provider that failed while the request as a whole succeeded.

| Field | Type | Required | Description |
|---|---|---|---|
| `provider` | [ProviderId](#providerid) | yes | — |
| `code` | [ErrorCode](#errorcode) | yes | — |
| `message` | string | yes | — |

### QuoteResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `best` | [Quote](#quote) | yes | Same object as `quotes[0]`. |
| `quotes` | [Quote](#quote)[] | yes | Every successful quote, best for the user first (within 0.1% of the best, the one that supports LayerHop goes first). (min items 1) |
| `errors` | [ProviderError](#providererror)[] | yes | — |
| `warnings` | [QuoteWarning](#quotewarning)[] | no | Present only when the request was served, but not exactly as asked. Ignore codes you don't know. |
| `screening` | [ScreeningAnnotation](#screeningannotation) | no | — |
| `livemode` | boolean | no | false in test mode (an `lh_test_` key): sandbox data, never a real provider or real funds. |

### ScreeningAnnotation

Address screening (D-069): which of this request's addresses are on the OFAC SDN list. Present
once the deployment has loaded a list. With enforcement on (operator `SCREENING_ENFORCE=1`, or the
account opted in) a listed address is refused with `ADDRESS_SANCTIONED` instead.

| Field | Type | Required | Description |
|---|---|---|---|
| `source` | `"ofac_sdn"` | yes | — |
| `listUpdatedAt` | string \| null | yes | Publish date of the list version checked. |
| `sanctioned` | object[] | yes | Listed addresses of this request (empty when none). |

### ScreeningResult

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | As sent. |
| `sanctioned` | boolean | yes | — |
| `lists` | string[] | yes | Lists the address is on (`OFAC SDN`); empty when not listed. |
| `source` | `"ofac_sdn"` | yes | — |
| `listUpdatedAt` | string \| null | yes | Publish date of the list version checked; null while no list is loaded (then nothing is reported as sanctioned). |

### ScreeningSettings

| Field | Type | Required | Description |
|---|---|---|---|
| `block` | boolean | yes | This account refuses listed addresses. |
| `enforcedForEveryone` | boolean | yes | The deployment refuses them for every account (`SCREENING_ENFORCE=1`). |
| `list` | [ScreeningList](#screeninglist) \| null | yes | — |

### ScreeningList

| Field | Type | Required | Description |
|---|---|---|---|
| `source` | `"ofac_sdn"` | yes | — |
| `name` | string | yes | — |
| `publishedAt` | string \| null | yes | The list's own publish date. |
| `fetchedAt` | string (date-time) | yes | When LayerHop last downloaded and checked it (daily). |
| `addressCount` | integer | yes | Digital currency addresses on the list. |

### QuoteStreamEvent

`data` of a `quote` event on `GET /v1/quote/stream`: a `GET /v1/quote` response plus `seq` (1, 2, …).

Type: object

### QuoteWarning

| Field | Type | Required | Description |
|---|---|---|---|
| `code` | `"GAS_ON_ARRIVAL_UNAVAILABLE"` | yes | `GAS_ON_ARRIVAL_UNAVAILABLE`: gas on arrival was requested but no returned quote delivers it (the route doesn't qualify, or no provider that quoted it can deliver gas, e.g. from Solana). More codes may be added. |
| `message` | string | yes | Human-readable detail. Do not parse it. |

### Approval

An ERC-20 `approve(spender, amount)` on `token` that must be mined before the main transaction.

| Field | Type | Required | Description |
|---|---|---|---|
| `token` | string | yes | ERC-20 contract to call `approve` on. |
| `spender` | string | yes | — |
| `amount` | string | yes | Base units. (pattern `^\d+$`) |

### EvmTx

| Field | Type | Required | Description |
|---|---|---|---|
| `vm` | `"evm"` | yes | — |
| `chainId` | integer | yes | — |
| `to` | string | yes | — |
| `data` | string | yes | Hex calldata. |
| `value` | string | yes | Native value in wei. (pattern `^\d+$`) |
| `approval` | [Approval](#approval) | no | — |
| `extraTxs` | [EvmCall](#evmcall)[] | no | Further calls to send from the same wallet after the main transaction, in order. Today only same-token checkout payments carry one: LayerHop's fee transfer (an ERC-20 `transfer` to LayerHop's fee wallet). Wallets with EIP-5792 `wallet_sendCalls` may batch them with the main call. Report the main transaction's hash. |
| `sandbox` | `true` | no | Test mode only: a placeholder that moves no funds. Never broadcast it. |

### FunnelEventName

Funnel steps in order: `page_view`, `quote_shown`, `wallet_connect_clicked`,
`wallet_connected`, `review_opened`, `swap_clicked`, `tx_sign_requested`, `tx_signed`,
`order_submitted`, `order_filled`. Side events: `amount_entered`, `route_changed`,
`quote_error`, `tx_rejected`, `swap_error`, `order_failed`, `hl_referral_clicked` (a click on
LayerHop's Hyperliquid referral link, shown only on layerhop.com's own pages), `cta_clicked` (a call to
action on a merchant landing page, with `cta`), `page_leave` (the page was hidden or closed, with
`last_step` and `t_ms`; sent again only when a later step was reached).

`string`, one of:

- `page_view`
- `quote_shown`
- `wallet_connect_clicked`
- `wallet_connected`
- `review_opened`
- `swap_clicked`
- `tx_sign_requested`
- `tx_signed`
- `order_submitted`
- `order_filled`
- `amount_entered`
- `route_changed`
- `quote_error`
- `tx_rejected`
- `swap_error`
- `order_failed`
- `hl_referral_clicked`
- `cta_clicked`
- `page_leave`

### FunnelEventBatch

| Field | Type | Required | Description |
|---|---|---|---|
| `sessionId` | string | yes | Random id the browser keeps for the tab's lifetime (sessionStorage). Stored only as a daily-rotating hash. (pattern `^[A-Za-z0-9_-]{16,64}$`) |
| `events` | object[] | yes | (min items 1) |

### FunnelCounts

One integer per `FunnelEventName`.

Type: object

### FunnelConversion

| Field | Type | Required | Description |
|---|---|---|---|
| `from` | [FunnelEventName](#funneleventname) | yes | — |
| `to` | [FunnelEventName](#funneleventname) | yes | — |
| `rate` | number \| null | yes | sessions(to) / sessions(from); null when sessions(from) is 0. |

### FunnelSummary

| Field | Type | Required | Description |
|---|---|---|---|
| `sessions` | [FunnelCounts](#funnelcounts) | yes | — |
| `events` | [FunnelCounts](#funnelcounts) | yes | — |
| `conversion` | [FunnelConversion](#funnelconversion)[] | yes | — |
| `overall` | number \| null | yes | sessions(order_filled) / sessions(page_view). |

### FunnelDay

A `FunnelSummary` for one UTC day.

| Field | Type | Required | Description |
|---|---|---|---|
| `date` | string (date) | yes | UTC day. |
| `sessions` | [FunnelCounts](#funnelcounts) | yes | — |
| `events` | [FunnelCounts](#funnelcounts) | yes | — |
| `conversion` | [FunnelConversion](#funnelconversion)[] | yes | — |
| `overall` | number \| null | yes | sessions(order_filled) / sessions(page_view). |

### FunnelEntrySummary

A `FunnelSummary` for one landing page over the whole window.

| Field | Type | Required | Description |
|---|---|---|---|
| `entry` | string \| null | yes | `hl-hub`, `bridge:<slug>`, `bridge-to:<chain>`, `swap:<slug>`, `pay-hub` or `pay:<slug>`; null for events without a landing page (the swap page). |
| `sessions` | [FunnelCounts](#funnelcounts) | yes | — |
| `events` | [FunnelCounts](#funnelcounts) | yes | — |
| `conversion` | [FunnelConversion](#funnelconversion)[] | yes | — |
| `overall` | number \| null | yes | sessions(order_filled) / sessions(page_view). |

### FunnelResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `entry` | string \| null | yes | The `entry` filter, or null for all events. |
| `days` | [FunnelDay](#funnelday)[] | yes | — |
| `total` | [FunnelSummary](#funnelsummary) | yes | — |
| `entries` | [FunnelEntrySummary](#funnelentrysummary)[] | yes | The window split by landing page, most page views first. |

### FunnelErrorsResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `days` | integer | yes | — |
| `from` | string (date-time) | yes | Window start (UTC midnight). |
| `to` | string (date-time) | yes | Window end (exclusive): the next UTC midnight. |
| `quoteErrors` | object[] | yes | — |
| `swapErrors` | object[] | yes | — |

### TrafficSplit

| Field | Type | Required | Description |
|---|---|---|---|
| `total` | integer | yes | — |
| `withKey` | integer | yes | — |
| `withoutKey` | integer | yes | — |

### AdminRevenueTotals

| Field | Type | Required | Description |
|---|---|---|---|
| `swaps` | integer | yes | Filled orders. |
| `pricedSwaps` | integer | yes | Filled orders with a USD value at fill. |
| `unpricedSwaps` | integer | yes | Filled orders without a USD value at fill (they add $0). |
| `volumeUsd` | number | yes | — |
| `feesUsd` | number | yes | Estimated: USD at fill × our fee bps, gross of provider cuts. |
| `partnerFeesUsd` | number | yes | Partner (integrator) fees on the same orders, owed to partners. |

### AdminRevenueSettlement

How the provider pays our fee: in the user's tx, claimable at the provider, paid out on a schedule, no fee, or not documented.

`string`, one of:

- `onchain`
- `claimable`
- `paid_periodically`
- `none`
- `unknown`

### AdminRevenue

| Field | Type | Required | Description |
|---|---|---|---|
| `generatedAt` | string (date-time) | yes | — |
| `window` | `"24h"` \| `"7d"` \| `"30d"` \| `"90d"` \| `"all"` \| `"custom"` | yes | — |
| `from` | string \| null | yes | null for window=all. |
| `to` | string (date-time) | yes | — |
| `basis` | string | yes | — |
| `totals` | object | yes | — |
| `internalTests` | object | yes | — |
| `testModeSwaps` | integer | yes | — |
| `days` | object[] | yes | One entry per UTC day of the range, oldest first (from the first order for window=all). |
| `byProduct` | object[] | yes | — |
| `byProvider` | object[] | yes | — |
| `byChannel` | object[] | yes | — |
| `byChain` | object[] | yes | By source chain. |
| `topIntegrators` | object[] | yes | — |
| `topReferrers` | object[] | yes | Referred orders, self-referrals left out. |
| `plansBilling` | object | yes | — |
| `plansBilling.invoicesPaid` | integer | yes | — |
| `plansBilling.usd` | number | yes | — |
| `plansBilling.unpricedInvoices` | integer | yes | — |
| `plansBilling.basis` | string | yes | — |
| `selection` | object | no | D-076 quote selection, from this API process's memory since it started (resets on deploy, not filtered by the window). `byReason`: `best-payout` (the highest time-adjusted payout won), `tie-margin` (a quote within the tie band paying LayerHop more won), `own-source` (a LayerHop source paying at least as much as the best partner won). `byClass` labels each request by which own sources could serve it. `tiesBroken` says what users gave up (always within the band) and the extra margin quoted (not filled). |
| `selection.since` | string (date-time) | yes | — |
| `selection.basis` | string | yes | — |
| `selection.responses` | integer | yes | — |
| `selection.byReason` | object | yes | — |
| `selection.byReason.best-payout` | integer | yes | — |
| `selection.byReason.tie-margin` | integer | yes | — |
| `selection.byReason.own-source` | integer | yes | — |
| `selection.byClass` | object | yes | — |
| `selection.byClass.same-chain-own-router` | integer | yes | — |
| `selection.byClass.cross-chain-solver` | integer | yes | — |
| `selection.byClass.partners` | integer | yes | — |
| `selection.tiesBroken` | object | yes | — |
| `selection.tiesBroken.count` | integer | yes | — |
| `selection.tiesBroken.avgBelowBestBps` | number | yes | — |
| `selection.tiesBroken.maxBelowBestBps` | number | yes | — |
| `selection.tiesBroken.extraMarginUsd` | number | yes | — |
| `partnerFees` | object | yes | — |
| `partnerFees.windowUsd` | number | yes | — |
| `partnerFees.owed` | object[] | yes | — |
| `partnerFees.owedUsd` | number | yes | — |
| `partnerFees.owedUnpricedTokens` | integer | yes | — |
| `partnerFees.basis` | string | yes | — |
| `referralRewards` | object | yes | — |
| `referralRewards.enabled` | boolean | yes | — |
| `referralRewards.rewardBps` | integer | yes | — |
| `referralRewards.accruedUsd` | number | yes | All time. |
| `referralRewards.paidUsd` | number | yes | All time. |
| `referralRewards.unpaidUsd` | number | yes | All time. |
| `referralRewards.paidInWindowUsd` | number | yes | — |
| `referralRewards.payoutsInWindow` | integer | yes | — |
| `pending` | object[] | yes | — |
| `launchFees` | object | yes | — |
| `launchFees.recorded` | boolean | yes | — |
| `launchFees.note` | string | yes | — |
| `settlementTable` | object[] | yes | — |

### AdminTotals

| Field | Type | Required | Description |
|---|---|---|---|
| `swaps` | integer | yes | Filled orders. |
| `volumeUsd` | number | yes | — |
| `feesUsd` | number | yes | Estimated: volume × our fee bps. |
| `partnerFeesUsd` | number | yes | — |
| `uniqueWallets` | integer | yes | Distinct senders of filled orders. |
| `ordersBuilt` | integer | yes | — |
| `submitted` | integer | yes | Orders with a source transaction. |
| `failed` | integer | yes | — |
| `unpricedSwaps` | integer | yes | Filled orders without a USD price yet. |

### AdminGroup

| Field | Type | Required | Description |
|---|---|---|---|
| `swaps` | integer | yes | — |
| `volumeUsd` | number | yes | — |
| `feesUsd` | number | yes | — |

### AdminOverview

| Field | Type | Required | Description |
|---|---|---|---|
| `generatedAt` | string (date-time) | yes | — |
| `days` | object[] | yes | — |
| `today` | [AdminTotals](#admintotals) | yes | — |
| `last7Days` | [AdminTotals](#admintotals) | yes | — |
| `window` | [AdminTotals](#admintotals) | yes | — |
| `allTime` | [AdminTotals](#admintotals) | yes | — |
| `byProvider` | object[] | yes | — |
| `byChannel` | object[] | yes | — |
| `byRoute` | object[] | yes | — |
| `topWallets` | object[] | yes | — |
| `recent` | object[] | yes | — |

### AdminDevelopers

| Field | Type | Required | Description |
|---|---|---|---|
| `generatedAt` | string (date-time) | yes | — |
| `totals` | object | yes | — |
| `totals.accounts` | integer | yes | All accounts. |
| `totals.newAccounts` | integer | yes | Accounts created in the window. |
| `totals.accountsWithKeys` | integer | yes | Accounts that ever created a key (revoked ones too). |
| `totals.keys` | integer | yes | — |
| `totals.liveKeys` | integer | yes | — |
| `totals.testKeys` | integer | yes | — |
| `totals.activeKeys` | integer | yes | Not revoked. |
| `totals.revokedKeys` | integer | yes | — |
| `totals.keysCreated` | integer | yes | Keys created in the window. |
| `totals.keysUsed` | integer | yes | Distinct keys with a request in the window. |
| `totals.accountsUsingKeys` | integer | yes | Distinct accounts with a keyed request in the window. |
| `totals.keyedRequests` | integer | yes | — |
| `totals.requests` | integer | yes | Every logged API request in the window. |
| `totals.keyedShare` | number \| null | yes | keyedRequests / requests, 4 decimals; null without requests. |
| `days` | object[] | yes | — |
| `accountsTotal` | integer | yes | — |
| `accounts` | object[] | yes | — |

### FillerLedgerPnl

Realised profit and loss in USD. Income is positive, a cost negative.

| Field | Type | Required | Description |
|---|---|---|---|
| `fillSpreadUsd` | number | yes | Fees earned by fills: what Across repays minus what the fills paid out. |
| `gasFillUsd` | number | yes | Gas of the fills that landed. |
| `gasLostRaceUsd` | number | yes | Gas of fills that reverted because another relayer was first. |
| `gasApprovalUsd` | number | yes | Gas of token approvals. |
| `gasRebalanceUsd` | number | yes | Gas of the transactions that moved funds between chains and tokens. |
| `gasOtherUsd` | number | yes | — |
| `rebalanceUsd` | number | yes | Bridge and swap fees and slippage of moving funds: what left one side minus what arrived on the other. |
| `otherUsd` | number | yes | Dust received and anything the owner classified as `other`. |
| `netUsd` | number | yes | — |

### FillerLedgerEntry

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | integer | yes | — |
| `occurredAt` | string (date-time) | yes | — |
| `chainId` | integer | yes | — |
| `txHash` | string | yes | — |
| `account` | string | yes | `asset:<chainId>:<symbol>`, `receivable:across:<chainId>:<symbol>`, `transit`, `suspense`, `equity:owner`, `income:<kind>` or `expense:<kind>`. |
| `asset` | string | yes | What `amount` is in: a token symbol, or `USD` for a line that only has a value. |
| `amount` | string | yes | Signed decimal amount: a debit is positive, a credit negative. |
| `usd` | number | yes | Signed value when it happened. |
| `category` | string | yes | — |
| `ref` | string \| null | yes | The Across order of a fill, `<originChainId>:<depositId>`. |
| `memo` | string \| null | yes | — |

### FillerLedgerOverrideInput

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `txHash` | string | yes | (pattern `^0x[0-9a-fA-F]{64}$`) |
| `category` | `"owner_deposit"` \| `"owner_withdrawal"` \| `"other"` | yes | — |
| `note` | string | no | — |

### FillerLedger

| Field | Type | Required | Description |
|---|---|---|---|
| `walletId` | string | yes | — |
| `builtAt` | string \| null | yes | When the worker last built the journal; null before the first build. |
| `firstEntryAt` | string \| null | yes | — |
| `lines` | integer | yes | Journal lines of the last build. |
| `ethUsd` | number \| null | yes | The ETH price `position`, `balances` and `receivables` are valued at. |
| `sync` | object[] | yes | The last import per chain. |
| `position` | object | yes | — |
| `position.walletUsd` | number | yes | What the wallet holds on-chain, at the newest price. |
| `position.receivableUsd` | number | yes | Fills Across has not repaid yet. |
| `position.transitUsd` | number | yes | Own funds on their way between chains. |
| `position.capitalInUsd` | number | yes | Capital put in minus capital taken out, at the price of the day. |
| `position.unclassifiedUsd` | number | yes | Net of the movements nobody has classified; positive when unexplained money came in. |
| `position.mismatches` | integer | yes | Assets whose ledger balance differs from the chain. |
| `balances` | object[] | yes | — |
| `receivables` | object[] | yes | — |
| `pnl` | object | yes | — |
| `pnl.window` | [FillerLedgerPnl](#fillerledgerpnl) | yes | — |
| `pnl.allTime` | [FillerLedgerPnl](#fillerledgerpnl) | yes | — |
| `days` | object[] | yes | One row per UTC day of the window, oldest first. |
| `activity` | object[] | yes | Transactions per category, all time. |
| `unclassified` | object[] | yes | Movements waiting for a classification, largest first (at most 100). |
| `overrides` | object[] | yes | — |

### FillerTotals

| Field | Type | Required | Description |
|---|---|---|---|
| `ordersPriced` | integer | yes | Orders the live filler priced. |
| `fills` | integer | yes | Bids that landed. |
| `lostBids` | integer | yes | Bids another relayer beat. |
| `winRate` | number \| null | yes | fills / (fills + lostBids), 4 decimals; null without bids. |
| `volumeUsd` | number | yes | USD paid out by the fills. |
| `grossUsd` | number | yes | Fees earned by the fills (repayment minus payout), estimated. |
| `gasUsd` | number | yes | Destination gas of the fills, estimated at decision time. |
| `netUsd` | number | yes | Expected profit of the fills after gas and the filler's internal capital and risk charges. |

### FillerStats

| Field | Type | Required | Description |
|---|---|---|---|
| `status` | object | yes | — |
| `status.lastDecisionAt` | string \| null | yes | Newest live decision; null when the filler has never run live. |
| `status.decisionsLastHour` | integer | yes | — |
| `status.paused` | boolean | yes | The filler's send switch (`filler_controls`). |
| `status.pausedReason` | string \| null | yes | — |
| `window` | [FillerTotals](#fillertotals) | yes | — |
| `allTime` | [FillerTotals](#fillertotals) | yes | — |
| `days` | object[] | yes | Per UTC day of the window, oldest first, days without bids as zeros. |
| `routes` | object[] | yes | — |
| `lostByBuilder` | object[] | yes | Lost bids of the window by the builder of the winning block. |
| `skips` | object[] | yes | Why orders were not bid on in the window, most frequent first. |
| `recent` | object[] | yes | The newest bids (won and lost), newest first, at most 50. |

### TrafficDay

| Field | Type | Required | Description |
|---|---|---|---|
| `date` | string (date) | yes | UTC day. |
| `requests` | [TrafficSplit](#trafficsplit) | yes | — |
| `uniqueClients` | [TrafficSplit](#trafficsplit) | yes | — |
| `quotes` | [TrafficSplit](#trafficsplit) | yes | — |
| `ordersBuilt` | [TrafficSplit](#trafficsplit) | yes | — |

### PriceCheckReport

| Field | Type | Required | Description |
|---|---|---|---|
| `webFeeBps` | integer | yes | The web-channel fee the API charges now (FEE_BPS_WEB). |
| `days` | integer | yes | Summary window in days. |
| `latestRun` | object \| null | yes | — |
| `latestRun.runId` | string | yes | — |
| `latestRun.checkedAt` | string (date-time) | yes | — |
| `latestRun.rows` | [PriceCheckRow](#pricecheckrow)[] | yes | — |
| `routes` | [PriceCheckRouteSummary](#pricecheckroutesummary)[] | yes | — |
| `caveats` | object | yes | Per provider, what the direct quote includes and what a provider's own site may add. |

### PriceCheckRow

| Field | Type | Required | Description |
|---|---|---|---|
| `routeId` | string | yes | Basket route id. |
| `label` | string | yes | — |
| `sizeUsd` | integer | yes | Trade size in USD. |
| `srcChainId` | integer | yes | — |
| `srcToken` | string | yes | — |
| `dstChainId` | integer | yes | — |
| `dstToken` | string | yes | — |
| `amount` | string | yes | Input amount, base units. |
| `feeBps` | integer | yes | Web fee requested from providers for our quote. |
| `ours` | object \| null | yes | Our best quote (ranked like GET /v1/quote), with the web fee. |
| `ours.provider` | string | yes | — |
| `ours.dstAmount` | string | yes | Base units. |
| `ours.appliedFeeBps` | integer | yes | Fee the provider actually applied (0 when it couldn't take ours). |
| `ours.dstUsd` | number \| null | yes | — |
| `bestDirect` | object \| null | yes | Highest output among providers quoted with no fee. |
| `bestDirect.provider` | string | yes | — |
| `bestDirect.dstAmount` | string | yes | Base units. |
| `bestDirect.dstUsd` | number \| null | yes | — |
| `gapBps` | number \| null | yes | (best direct − ours) / best direct × 10,000. Above 0: we deliver less. |
| `breakEvenFeeBps` | number \| null | yes | appliedFeeBps − gapBps: the fee at which we'd match the best direct price. |
| `providers` | object[] | yes | Each provider's direct and with-fee result, or the error. |
| `error` | string | no | Why the route couldn't be compared. |

### PriceCheckRouteSummary

| Field | Type | Required | Description |
|---|---|---|---|
| `routeId` | string | yes | — |
| `label` | string | yes | — |
| `sizeUsd` | integer | yes | — |
| `runs` | integer | yes | Runs in the window. |
| `compared` | integer | yes | Runs that produced a comparison. |
| `latestGapBps` | number \| null | yes | — |
| `avgGapBps` | number \| null | yes | — |
| `minGapBps` | number \| null | yes | — |
| `maxGapBps` | number \| null | yes | — |
| `avgBreakEvenFeeBps` | number \| null | yes | — |
| `minBreakEvenFeeBps` | number \| null | yes | Worst run: the fee we could have charged and still matched direct every time. |
| `oursMatchedOrBeat` | integer | yes | Runs where our output was at least the best direct output. |
| `bestDirectWins` | object | yes | Runs won by each provider among direct quotes. |
| `oursWins` | object | yes | Runs won by each provider for our quote. |

### EvmCall

| Field | Type | Required | Description |
|---|---|---|---|
| `to` | string | yes | — |
| `data` | string | yes | Hex calldata. |
| `value` | string | yes | Native value in wei. (pattern `^\d+$`) |

### SvmTx

| Field | Type | Required | Description |
|---|---|---|---|
| `vm` | `"svm"` | yes | — |
| `serializedTx` | string | yes | Base64 serialized Solana `VersionedTransaction`, for the user's wallet to sign. (base64) |
| `submitViaApi` | boolean | no | When true the wallet must only sign; send the signed transaction to `POST /v1/orders/submit` (limit orders: `POST /v1/limit-orders/{id}/submit`). Plain RPC will not land it. |
| `sandbox` | `true` | no | Test mode only: a placeholder (zero blockhash, memo only) that can never land. Never broadcast it. |

### TronCall

One Tron smart-contract call (`TriggerSmartContract`). Addresses are base58 T-addresses; amounts are sun (1 TRX = 1,000,000 sun).

| Field | Type | Required | Description |
|---|---|---|---|
| `to` | string | yes | Contract called (T-address). |
| `data` | string | yes | ABI calldata, `0x` hex (selector + arguments). |
| `value` | string | yes | TRX sent with the call, sun. (pattern `^\d+$`) |
| `feeLimit` | string | yes | `fee_limit` in sun: the most TRX the network may burn for this call's energy. Sized from a `triggerconstantcontract` simulation (energy × 100 sun × 1.5, whole TRX) when the call simulates, else 150 TRX. Unused TRX is not burned. (pattern `^\d+$`) |

### TronUnsignedTx

An unsigned Tron transaction exactly as the node builds it (TronWeb's transaction object). Sign it
unchanged (`tronWeb.trx.sign(tx)` in TronLink) and broadcast it before `raw_data.expiration`
(10 minutes after it was built).

| Field | Type | Required | Description |
|---|---|---|---|
| `txID` | string | yes | The tx hash once broadcast (sha256 of `raw_data_hex`, no 0x). (pattern `^[0-9a-f]{64}$`) |
| `raw_data_hex` | string | yes | Protobuf-encoded raw transaction (what gets signed). |
| `raw_data` | object | yes | Decoded `raw_data`: contract, ref block, expiration, fee_limit. |
| `visible` | boolean | no | — |

### TronTx

Tron transaction(s) for a quote (D-048). Send `approval` first when present (its own transaction),
then the main call. `POST /v1/orders` returns both prebuilt (`unsigned`); a wallet may instead
rebuild each from its `call` with its own node (fresh reference block), the result is equivalent.
Report the main transaction's hash. The wallet pays energy in TRX (about 10 TRX for an approve
without staked energy).

| Field | Type | Required | Description |
|---|---|---|---|
| `vm` | `"tvm"` | yes | — |
| `chainId` | `728126428` | yes | — |
| `from` | string | yes | Owner (signer) of every call, T-address. |
| `call` | [TronCall](#troncall) | yes | — |
| `unsigned` | [TronUnsignedTx](#tronunsignedtx) | no | — |
| `approval` | object | no | TRC-20 approval to send before `call`. |
| `approval.token` | string | yes | TRC-20 token (T-address). |
| `approval.spender` | string | yes | Spender (T-address). |
| `approval.amount` | string | yes | Allowance granted, base units. (pattern `^\d+$`) |
| `approval.call` | [TronCall](#troncall) | yes | — |
| `approval.unsigned` | [TronUnsignedTx](#tronunsignedtx) | no | — |
| `sandbox` | `true` | no | Test mode only: a placeholder that moves no funds (no `unsigned`). Never broadcast it. |

### BuiltTx

The transaction for the user's wallet, discriminated by `vm`.

One of: [EvmTx](#evmtx) · [SvmTx](#svmtx) · [TronTx](#trontx), discriminated by `vm`.

### BuildOrderRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | — |

### BuildOrderResponse

Exactly one of `tx` (every quote but gasless ones) and `gasless` (gasless quotes) is present.

| Field | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | — |
| `provider` | [ProviderId](#providerid) | yes | — |
| `tx` | [BuiltTx](#builttx) | no | — |
| `gasless` | [GaslessSignRequest](#gaslesssignrequest) | no | — |
| `screening` | [ScreeningAnnotation](#screeningannotation) | no | — |
| `livemode` | boolean | no | false in test mode (an `lh_test_` key): sandbox data, never a real provider or real funds. |

### Eip712TypedData

EIP-712 typed data exactly as the provider returned it. Sign it unchanged (`eth_signTypedData_v4`, viem/wagmi `signTypedData`).

| Field | Type | Required | Description |
|---|---|---|---|
| `types` | object | yes | — |
| `domain` | object | yes | — |
| `message` | object | yes | — |
| `primaryType` | string | yes | — |

### GaslessSignable

| Field | Type | Required | Description |
|---|---|---|---|
| `type` | string | yes | Provider's kind, e.g. 0x `permit`, `erc7597Permit`, `daiPermit`, `executeMetaTransaction::approve` (approvals) or `settler_metatransaction` (trade). |
| `eip712` | [Eip712TypedData](#eip712typeddata) | yes | — |

### GaslessSignRequest

What the wallet signs for a gasless quote. Sign `approval` (when present) and `trade`, on `chainId`.

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `approval` | [GaslessSignable](#gaslesssignable) | no | — |
| `trade` | [GaslessSignable](#gaslesssignable) | yes | — |
| `gasFee` | object | no | Network fee the relayer takes from the input token. |
| `gasFee.amount` | string | yes | (pattern `^\d+$`) |
| `gasFee.token` | string | yes | — |

### SubmitGaslessRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | — |
| `signatures` | object | yes | — |
| `signatures.trade` | string | yes | 65-byte signature of `gasless.trade.eip712`. (pattern `^0x[0-9a-fA-F]{130}$`) |
| `signatures.approval` | string | no | 65-byte signature of `gasless.approval.eip712`. Required exactly when the order has an approval. (pattern `^0x[0-9a-fA-F]{130}$`) |

### GaslessOrderStatus

| Field | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | — |
| `provider` | [ProviderId](#providerid) | yes | — |
| `orderId` | string | yes | Provider order id (0x: the trade's EIP-712 hash). |
| `state` | [OrderState](#orderstate) | yes | — |
| `srcTxHash` | string | no | The relayer's transaction, once mined. The order is then tracked like any other (`GET /v1/orders`, webhooks). |
| `reason` | string | no | Provider failure reason when `failed`, e.g. 0x `order_expired`, `transaction_reverted`, `insufficient_balance`. |

### SubmitOrderRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | — |
| `signedTransaction` | string | yes | The wallet-signed transaction, base64. (min length 1) (base64) |

### SubmitOrderResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `provider` | [ProviderId](#providerid) | yes | — |
| `txHash` | string | yes | Solana transaction signature. |

### OrderState

`pending` in flight · `filled` delivered · `refunded` returned to the sender · `failed` ·
`unknown` the provider cannot tell (yet), or does not track this kind of order · `dropped` the
provider doesn't know the transaction and LayerHop's order for it is `dropped`: the source
transaction never reached the network, no funds moved (final; stop polling and re-quote).

`string`, one of:

- `pending`
- `filled`
- `refunded`
- `failed`
- `unknown`
- `dropped`

### OrderStatus

| Field | Type | Required | Description |
|---|---|---|---|
| `provider` | [ProviderId](#providerid) | yes | — |
| `id` | string | yes | The id you asked about. |
| `state` | [OrderState](#orderstate) | yes | — |
| `srcTxHash` | string | no | — |
| `dstTxHash` | string | no | — |

### Partner

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^[a-z0-9-]{1,32}$`) |
| `name` | string | yes | — |
| `feeBps` | integer | yes | Default partner fee in bps. |
| `maxFeeBps` | integer | yes | Highest `integratorFeeBps` an API-key request may ask for. |
| `payoutEvm` | string | no | EVM payout address. |
| `payoutSvm` | string | no | Solana payout address. |
| `hasApiKey` | boolean | yes | — |

### PartnersResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `partners` | [Partner](#partner)[] | yes | — |

### LedgerEntry

One line of the append-only ledger. `built` entries carry the trade and fee split;
`submitted` entries link a `quoteId` to the `txHash` returned by `POST /v1/orders/submit`.

| Field | Type | Required | Description |
|---|---|---|---|
| `type` | `"built"` \| `"submitted"` | yes | — |
| `quoteId` | string | yes | — |
| `partner` | string | yes | — |
| `provider` | [ProviderId](#providerid) | yes | — |
| `srcChainId` | integer | no | — |
| `srcToken` | string | no | — |
| `dstChainId` | integer | no | — |
| `dstToken` | string | no | — |
| `amount` | string | no | Input amount, base units of `srcToken`. (pattern `^\d+$`) |
| `dstAmount` | string | no | (pattern `^\d+$`) |
| `ourFeeBps` | integer | no | — |
| `integratorFeeBps` | integer | no | — |
| `partnerFeeEstimate` | string | no | `amount × integratorFeeBps / 10000`, base units of `srcToken`, rounded down. (pattern `^\d+$`) |
| `txHash` | string | no | Only on `submitted` entries. |
| `createdAt` | string (date-time) | yes | — |

### LedgerTokenTotal

| Field | Type | Required | Description |
|---|---|---|---|
| `srcChainId` | integer | yes | — |
| `srcToken` | string | yes | — |
| `builtCount` | integer | yes | Distinct quotes built (a quote built twice counts once). |
| `submittedCount` | integer | yes | — |
| `partnerFeeEstimate` | string | yes | Sum over distinct built quotes, base units of `srcToken`. (pattern `^\d+$`) |

### PartnerLedgerResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `partner` | string | yes | — |
| `basis` | `"built"` | yes | Entries are built/submitted txs, not proven fills. |
| `from` | string (date-time) | no | — |
| `to` | string (date-time) | no | — |
| `entries` | [LedgerEntry](#ledgerentry)[] | yes | — |
| `totals` | [LedgerTokenTotal](#ledgertokentotal)[] | yes | — |

### ReportSubmittedRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `txHash` | string | yes | Source-chain transaction hash: `0x` + 64 hex for EVM, a base58 signature for Solana. |

### OrderLifecycleStatus

`built` tx returned by `POST /v1/orders` · `submitted` tx hash reported · `pending` in flight ·
`filled` · `refunded` · `failed` · `expired` built but never submitted within 1 h ·
`dropped` the reported source transaction never reached the network (unknown to the source
chain after a grace period, e.g. replaced or cancelled in the wallet): no funds moved, nothing
to refund. Reporting a different hash that verifies on chain moves a `dropped` order back to
`submitted`.

`string`, one of:

- `built`
- `submitted`
- `pending`
- `filled`
- `refunded`
- `failed`
- `expired`
- `dropped`

### ReportSubmittedResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | — |
| `status` | [OrderLifecycleStatus](#orderlifecyclestatus) | yes | — |
| `verified` | boolean | no | true when the hash was confirmed on chain as this order's transaction (always true in test mode); false when it wasn't visible yet (provisional: a different hash that verifies may replace it). Present when the API runs with a database. |

### OrderSummary

An order built through LayerHop (public fields only).

| Field | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | — |
| `status` | [OrderLifecycleStatus](#orderlifecyclestatus) | yes | — |
| `statusDetail` | string \| null | no | Extra detail, e.g. `timeout`. |
| `provider` | [ProviderId](#providerid) | yes | — |
| `channel` | [FeeChannel](#feechannel) | yes | — |
| `srcChainId` | integer | yes | — |
| `srcToken` | string | yes | — |
| `dstChainId` | integer | yes | — |
| `dstToken` | string | yes | — |
| `sender` | string | yes | EVM addresses are lowercase. |
| `recipient` | string | yes | — |
| `amount` | string | yes | Input amount in base units. (pattern `^\d+$`) |
| `dstAmount` | string | yes | Quoted output in base units. (pattern `^\d+$`) |
| `dstAmountMin` | string \| null | no | The quote's guaranteed minimum output (after slippage); null for orders built before it was recorded. |
| `dstAmountReceived` | string \| null | no | Delivered output read from the destination transaction after the fill; null until read or when unreadable. |
| `ourFeeBps` | integer | yes | — |
| `partnerFeeBps` | integer | yes | — |
| `srcTxHash` | string \| null | no | — |
| `dstTxHash` | string \| null | no | — |
| `livemode` | boolean | no | false in test mode (an `lh_test_` key): sandbox data, never a real provider or real funds. |
| `checkoutSessionId` | string \| null | no | The checkout session this order pays, if any. |
| `depositAddressId` | string \| null | no | The deposit address this order came from, if any (see `POST /v1/deposit-addresses`). |
| `limitOrderId` | string \| null | no | The limit order this order is a fill of, if any (see `POST /v1/limit-orders`). |
| `refundId` | string \| null | no | The checkout refund this order sends, if any. |
| `createdAt` | string (date-time) | yes | — |
| `updatedAt` | string (date-time) | yes | — |

### ReferralStats

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | The referring wallet (EVM lowercased). |
| `referredOrders` | integer | yes | Live orders built with this referrer. (≥ 0) |
| `filledOrders` | integer | yes | The filled ones. (≥ 0) |
| `referredVolumeUsd` | number | yes | Filled volume in USD: the value at fill where recorded, else at current source-token prices (unpriced and unlisted tokens count as 0). (≥ 0) |
| `rewardBps` | integer | yes | The referrer's share of LayerHop's fee on referred filled orders, in bps of that fee (2000 = 20%). 0 = rewards off (the default). (0–10000) |
| `estimatedRewardsUsd` | number | yes | Equal to `rewards.accruedUsd`; 0 while rewards are off. Kept for older clients: read `rewards`. (≥ 0) |
| `rewards` | object | no | Present only while rewards are on. |
| `rewards.shareBps` | integer | yes | Same as `rewardBps`. (1–10000) |
| `rewards.since` | string \| null | yes | Orders created before this don't accrue (null = no start date). |
| `rewards.accruedUsd` | number | yes | Σ over counted filled orders of USD value × LayerHop's fee bps × `shareBps`, rounded to cents. (≥ 0) |
| `rewards.paidUsd` | number | yes | Rewards LayerHop has paid out to this wallet. (≥ 0) |
| `rewards.unpaidUsd` | number | yes | `accruedUsd − paidUsd` (never below 0). (≥ 0) |

### ReferralRewardBalance

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | — |
| `rewardedOrders` | integer | yes | Filled orders that accrue. (≥ 0) |
| `feeUsd` | number | yes | LayerHop's fee on those orders in USD. (≥ 0) |
| `accruedUsd` | number | yes | (≥ 0) |
| `paidUsd` | number | yes | (≥ 0) |
| `unpaidUsd` | number | yes | (≥ 0) |

### ReferralPayout

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |
| `referrer` | string | yes | — |
| `amountUsd` | number | yes | — |
| `chainId` | integer | yes | — |
| `txHash` | string | yes | — |
| `token` | string \| null | yes | — |
| `amount` | string \| null | yes | — |
| `note` | string \| null | yes | — |
| `paidAt` | string (date-time) | yes | — |
| `voidedAt` | string \| null | yes | — |
| `createdAt` | string (date-time) | yes | — |

### PartnerApplicationInput

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Your name. |
| `project` | string | yes | — |
| `url` | string (uri) | yes | https only. |
| `contact` | string | yes | Private: email, Telegram, Discord or X handle. |
| `kind` | `"wallet"` \| `"dapp"` \| `"bot"` \| `"community"` \| `"other"` | yes | — |
| `integrations` | `"widget"` \| `"button"` \| `"sdk"` \| `"api"` \| `"referral"` \| `"other"`[] | yes | (min items 1) |
| `expectedVolume` | `"under_10k"` \| `"10k_100k"` \| `"100k_1m"` \| `"1m_10m"` \| `"over_10m"` | yes | Expected monthly swap volume in USD. |
| `message` | string | no | — |

### PartnerApplication

Type: object

### ReferralLeaderboard

| Field | Type | Required | Description |
|---|---|---|---|
| `window` | `"7d"` \| `"30d"` \| `"all"` | yes | — |
| `updatedAt` | string (date-time) | yes | When this ranking was computed (cached 5 minutes). |
| `entries` | object[] | yes | — |
| `you` | null \| object | no | The `address` wallet's own rank (only when `address` was sent; null = not ranked in this window). |

### TradeCard

A filled live order as public trade data. Never includes a wallet address.

| Field | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | — |
| `provider` | string | yes | The route provider that filled it. |
| `srcChainId` | integer | yes | — |
| `srcToken` | string | yes | — |
| `srcSymbol` | string \| null | yes | Token-list symbol; null when the token is unlisted or unknown. |
| `srcDecimals` | integer \| null | yes | — |
| `srcVerified` | boolean | yes | The token is listed (LayerHop's curated list, or verified / popular on a provider list). Show an unlisted token by its address, not a name. |
| `srcAmount` | string | yes | Input amount in base units. |
| `srcAmountUsd` | number \| null | yes | USD value of the input at fill; null when not recorded or the token is unlisted. |
| `dstChainId` | integer | yes | — |
| `dstToken` | string | yes | — |
| `dstSymbol` | string \| null | yes | Token-list symbol; null when the token is unlisted or unknown. |
| `dstDecimals` | integer \| null | yes | — |
| `dstVerified` | boolean | yes | The token is listed (as `srcVerified`). |
| `dstAmount` | string | yes | Quoted output amount in base units. |
| `dstAmountUsd` | number \| null | yes | USD value of the output at fill; null when not recorded or the token is unlisted. |
| `srcTxHash` | string \| null | yes | Source transaction. In portfolio trades, null unless the wallet is the sender. |
| `srcTxVerified` | boolean | yes | The source transaction was checked on chain when reported (sent by the order's sender to the transaction LayerHop built). False when unchecked or unknown. |
| `dstTxHash` | string \| null | yes | Destination transaction. In portfolio trades, null unless the wallet is the recipient. |
| `filledAt` | string (date-time) | yes | — |
| `execution` | [TradeExecution](#tradeexecution) | yes | — |

### TradeExecution

Promised vs received: amounts in base units of the destination token, USD at fill (null when unrecorded or the token is unlisted).

| Field | Type | Required | Description |
|---|---|---|---|
| `quoted` | string | yes | The quoted output (same as `dstAmount`). |
| `minimum` | string \| null | yes | The quote's guaranteed minimum after slippage; null for orders built before it was recorded. |
| `received` | string \| null | yes | Delivered to the recipient, read from the destination transaction; null until read or when unreadable. |
| `receivedUsd` | number \| null | yes | — |
| `diffBps` | number \| null | yes | (received − quoted) / quoted in bps; negative = less than quoted. |
| `diffUsd` | number \| null | yes | — |
| `metMinimum` | boolean \| null | yes | received ≥ minimum; null when either is unknown. |
| `fees` | object | yes | — |
| `fees.feeBps` | integer | yes | The fee taken from the input, in bps: LayerHop's plus an integrating partner's, combined (the split is not public). |
| `fees.fee` | string | yes | That fee in input-token base units. |
| `fees.feeUsd` | number \| null | yes | — |
| `fees.providerFeeUsd` | number \| null | yes | Provider fee the provider reported at quote time (estimate). |
| `fees.gasUsd` | number \| null | yes | Network gas the provider estimated at quote time. |

### ProviderScore

| Field | Type | Required | Description |
|---|---|---|---|
| `provider` | string | yes | — |
| `name` | string | yes | — |
| `caveat` | string \| null | yes | What the price check's no-fee quote does and doesn't include for this provider. |
| `settled` | integer | yes | Live orders that reached an outcome in the window. |
| `filled` | integer | yes | — |
| `refunded` | integer | yes | — |
| `failed` | integer | yes | — |
| `refundRate` | number \| null | yes | refunded / settled (0..1). |
| `failureRate` | number \| null | yes | failed / settled (0..1). |
| `accuracy` | object | yes | Received vs quoted on fills whose delivered amount was read, in bps. |
| `accuracy.n` | integer | yes | — |
| `accuracy.medianBps` | number \| null | yes | — |
| `accuracy.p10Bps` | number \| null | yes | 10th percentile (the worse fills). |
| `minimum` | object | yes | Fills that delivered at least the quoted minimum. |
| `minimum.n` | integer | yes | — |
| `minimum.met` | integer | yes | — |
| `minimum.rate` | number \| null | yes | — |
| `fillTime` | object | yes | Seconds from the transaction being built to the fill (includes signing time). |
| `fillTime.n` | integer | yes | — |
| `fillTime.medianSeconds` | integer \| null | yes | — |
| `priceCheck` | object | yes | Daily price check: (provider's no-fee quote − our web quote) / provider's quote, bps. |
| `priceCheck.n` | integer | yes | — |
| `priceCheck.medianGapBps` | number \| null | yes | — |
| `priceCheck.oursMatchedOrBeat` | integer | yes | Runs where our quote was at least the provider's own. |

### ProviderScoreboard

| Field | Type | Required | Description |
|---|---|---|---|
| `days` | `7` \| `30` | yes | — |
| `generatedAt` | string (date-time) | yes | — |
| `webFeeBps` | integer | yes | The web fee the price check quotes with. |
| `priceCheckRuns` | integer | yes | — |
| `providers` | [ProviderScore](#providerscore)[] | yes | — |

### PayLink

| Field | Type | Required | Description |
|---|---|---|---|
| `input` | string | yes | — |
| `kind` | `"address"` \| `"ens"` \| `"sns"` | yes | — |
| `name` | string \| null | yes | The ENS / .sol name; null for a plain address. |
| `address` | string | yes | The wallet that receives, on `receive.chainId`. |
| `vm` | `"evm"` \| `"svm"` | yes | — |
| `receive` | object | yes | — |
| `receive.chainId` | integer | yes | — |
| `receive.chain` | string | yes | Chain slug. |
| `receive.address` | string | yes | Token address or mint. |
| `receive.symbol` | string | yes | — |
| `receive.decimals` | integer | yes | — |
| `receive.source` | `"link"` \| `"ens"` \| `"default"` | yes | Where the choice came from: the link's params, the ENS record, or the default. |
| `textRecord` | string \| null | yes | The raw `com.layerhop.receive` value (ENS only). |
| `warnings` | string[] | yes | — |

### SplitShare

| Field | Type | Required | Description |
|---|---|---|---|
| `index` | integer | yes | The share's number from 0 (`splitShare` on quotes). |
| `label` | string | yes | Who it is for (may be empty). |
| `amount` | string | yes | Base units of the split's token. |
| `received` | string | yes | Base units delivered by filled orders for this share. |
| `status` | `"unpaid"` \| `"partial"` \| `"paid"` | yes | `paid` within 0.5% of `amount`. |
| `payments` | integer | yes | Filled payments. |
| `pending` | integer | yes | Payments sent but not filled yet. |

### Split

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |
| `url` | string | yes | The split's page. |
| `status` | `"open"` \| `"closed"` | yes | — |
| `note` | string \| null | yes | — |
| `recipient` | string | yes | Who receives. |
| `recipientName` | string \| null | yes | The ENS / .sol name given at creation. |
| `chainId` | integer | yes | — |
| `chain` | string | yes | — |
| `token` | object | yes | — |
| `token.address` | string | yes | — |
| `token.symbol` | string | yes | — |
| `token.decimals` | integer | yes | — |
| `total` | string | yes | Base units. |
| `collected` | string | yes | Base units received across all shares. |
| `paidCount` | integer | yes | — |
| `shares` | [SplitShare](#splitshare)[] | yes | — |
| `createdAt` | string (date-time) | yes | — |
| `updatedAt` | string (date-time) | yes | — |

### SplitCreated

Type: object

### SplitCreateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `recipient` | string | yes | Address, ENS name or .sol name of whoever is owed. |
| `chain` | string \| integer | yes | Chain slug or id they receive on. |
| `token` | string | yes | Listed token symbol or address on that chain. |
| `total` | string | yes | Base units of `token`. (pattern `^\d+$`) |
| `participants` | integer | no | Equal shares for this many people (or send `shares`). (2–50) |
| `shares` | object[] | no | One entry per person: a label (up to 40 characters), and an amount in base units for custom shares (all or none; they must add up to `total`). (min items 2) |
| `note` | string | no | Plain text, kept to 140 characters. |

### SplitUpdateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `note` | string \| null | no | — |
| `labels` | string[] | no | One label per share. |
| `status` | `"open"` \| `"closed"` | no | — |

### TipJar

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | The address (EVM lowercased). |
| `tippers` | integer | yes | Distinct wallets with a filled tip. |
| `tips` | integer | yes | Filled tips. |
| `messages` | object[] | yes | — |

### PayoutRowInput

| Field | Type | Required | Description |
|---|---|---|---|
| `recipient` | string | yes | Address, ENS name or .sol name. |
| `amount` | string \| number | yes | Human units of `token` ("25", "0.5"); a dot for decimals, no thousands separators. |
| `token` | string | yes | Symbol or address. |
| `chain` | string \| integer | yes | Chain slug or id. |
| `label` | string | no | — |

### PayoutPlanRequest

Send `rows` or `csv`.

| Field | Type | Required | Description |
|---|---|---|---|
| `srcChain` | string \| integer | yes | The chain the payer pays from. |
| `srcToken` | string | yes | The token the payer pays with (listed). |
| `sender` | string | yes | The payer's address on `srcChain`. |
| `rows` | [PayoutRowInput](#payoutrowinput)[] | no | — |
| `csv` | string | no | `recipient,amount,token,chain[,label]` lines, header optional. |

### PayoutToken

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `address` | string | yes | — |
| `symbol` | string | yes | — |
| `decimals` | integer | yes | — |
| `usd` | number | no | USD price when known. |

### PayoutPlanRow

| Field | Type | Required | Description |
|---|---|---|---|
| `index` | integer | yes | Row number from 0 (header excluded). |
| `line` | integer | yes | 1-based line of the CSV text (0 for JSON rows). |
| `input` | [PayoutRowInput](#payoutrowinput) | yes | — |
| `ok` | boolean | yes | — |
| `error` | object | no | — |
| `error.code` | string | yes | INVALID_PARAMS, UNSUPPORTED_CHAIN, UNSUPPORTED_TOKEN, NOT_FOUND or PROVIDER_ERROR. |
| `error.message` | string | yes | — |
| `recipient` | object | no | — |
| `recipient.address` | string | yes | — |
| `recipient.name` | string \| null | yes | — |
| `chainId` | integer | no | — |
| `chain` | string | no | — |
| `token` | [PayoutToken](#payouttoken) | no | — |
| `amount` | string | no | Base units of `token`. |
| `kind` | `"transfer"` \| `"route"` | no | — |

### PayoutPlan

| Field | Type | Required | Description |
|---|---|---|---|
| `source` | object | yes | — |
| `source.chainId` | integer | yes | — |
| `source.chain` | string | yes | — |
| `source.sender` | string | yes | — |
| `source.token` | [PayoutToken](#payouttoken) | yes | — |
| `rows` | [PayoutPlanRow](#payoutplanrow)[] | yes | — |
| `transfers` | object[] | yes | Transfer batches (row indices in input order). |
| `routes` | object[] | yes | Routed rows by destination chain (one quote and one signature per row). |
| `transferTotal` | string | yes | Base units of the payer's token sent as transfers. |
| `totals` | object[] | yes | What each destination token adds up to. |
| `valid` | integer | yes | — |
| `invalid` | integer | yes | — |
| `warnings` | string[] | yes | — |

### PayoutTransfersRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `chain` | string \| integer | yes | — |
| `token` | string | yes | — |
| `sender` | string | yes | — |
| `transfers` | object[] | yes | At most 20 on EVM chains and 8 on Solana. (min items 1) |

### PayoutTransfers

| Field | Type | Required | Description |
|---|---|---|---|
| `vm` | `"evm"` \| `"svm"` | yes | — |
| `chainId` | integer | yes | — |
| `token` | [PayoutToken](#payouttoken) | yes | — |
| `calls` | object[] | no | EVM only, one per transfer, in order. |
| `serializedTx` | string | no | Solana only: base64 unsigned legacy transaction (one signature slot, the sender's). |

### PortfolioTrade

Type: object

### PortfolioTrades

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | The wallet (EVM lowercased). |
| `trades` | [PortfolioTrade](#portfoliotrade)[] | yes | — |

### AlertDraftInput

| Field | Type | Required | Description |
|---|---|---|---|
| `kind` | `"price"` \| `"wallet"` \| `"dev_sell"` \| `"rug"` \| `"unlock"` \| `"move"` \| `"gap"` | yes | `price`: a token's USD price crosses `priceUsd`. `wallet`: the wallet swaps. `dev_sell`: the `creator` wallet sells or moves `token`. `rug`, `unlock`, `move`, `gap`: see the operation description. |
| `chain` | `"solana"` \| `"robinhood"` \| `"berachain"` \| `"base"` \| `"arbitrum"` | yes | `berachain` (chain id 80094) takes every token kind, like `robinhood`. `base` and `arbitrum` are for `dev_sell`, `rug`, `unlock` and `gap` only. |
| `address` | string | no | Required for every kind but `dev_sell` (not allowed there). Token mint / contract, or the wallet for `wallet`: a base58 Solana address on `solana`, an EVM address on the EVM chains. |
| `token` | string | no | `dev_sell` only (required): the token's mint / contract on `chain`. |
| `creator` | string | no | `dev_sell` (required) and `rug` (optional): the creator's wallet on `chain` (not the token). |
| `pct` | number | no | `rug`: liquidity drop in % (20–95, default 50). `move`: price move in % (1–1000, default 10). `gap`: price gap between chains in % (0.1–50, default 1). |
| `window` | `"1h"` \| `"24h"` | no | `move` only: the window the move is measured over (default 1h). |
| `minPct` | number | no | `unlock` only: smallest unlock worth an alert, in % of circulating supply (0.1–100, default 1). |
| `minUsd` | number | no | `unlock` only: or in US dollars at the current price (10,000 and up, default 1,000,000). |
| `leadDays` | integer | no | `unlock` only: how many days ahead to warn (1–30, default 3). |
| `op` | `"above"` \| `"below"` | no | Required for `price`; not allowed for `wallet`. |
| `priceUsd` | string | no | Target USD price as a plain decimal string greater than 0 (required for `price`, not allowed for `wallet`). (pattern `^\d{1,15}(\.\d{1,18})?$`) |
| `purpose` | `"stop_loss"` | no | `stop_loss`: an exit plan's stop-loss (price with `op: below` only). When it fires the bot offers a sell, not a buy. |
| `symbol` | string | no | Token symbol to show (price, dev_sell; trimmed to 24 characters). The token-list symbol wins when the token is known. |
| `label` | string | no | Name for the wallet (wallet; trimmed to 32 characters). |

### AlertDraftYield

| Field | Type | Required | Description |
|---|---|---|---|
| `kind` | `"yield"` | yes | — |
| `asset` | `"USDC"` \| `"USDT"` | yes | — |
| `vault` | string | yes | Pool id from GET /v1/yields, e.g. aave-v3:8453:usdc. |
| `pct` | number | no | Percentage points of APY the best other depositable pool must beat the vault by. (default `1`) (0.1–20) |

### AlertDraftDrift

| Field | Type | Required | Description |
|---|---|---|---|
| `kind` | `"drift"` | yes | — |
| `wallets` | string[] | yes | (min items 1) |
| `targets` | object[] | yes | Target portfolio; weightBps sum to exactly 10000. (min items 1) |
| `pct` | number | no | Percentage points of drift that trigger the reminder. (default `5`) (1–50) |
| `link` | string (uri) | no | https on layerhop.com or app.layerhop.com only. (default `"https://app.layerhop.com/rebalance"`) |

### AlertDraftReminder

| Field | Type | Required | Description |
|---|---|---|---|
| `kind` | `"reminder"` | yes | — |
| `title` | string | yes | Plain text; control characters removed. (min length 1) |
| `schedule` | object | yes | — |
| `schedule.every` | `"day"` \| `"week"` \| `"month"` | yes | — |
| `schedule.weekday` | integer | no | 0 = Sunday; required for (and only for) week. (0–6) |
| `schedule.monthday` | integer | no | Required for (and only for) month. (1–28) |
| `schedule.hour` | integer | yes | UTC hour. (0–23) |
| `link` | string (uri) | yes | https on layerhop.com or app.layerhop.com only. |

### AlertDraftCreated

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | 10 characters of `[A-Za-z0-9_-]`; the Telegram start payload is `d_<id>`. |
| `expiresAt` | integer | yes | Unix seconds (15 minutes after creation). |

### AlertDraft

Token kinds carry `chain`, `chainId` and `address`; `yield`, `drift` and `reminder` carry their own fields instead.

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |
| `kind` | `"price"` \| `"wallet"` \| `"dev_sell"` \| `"rug"` \| `"unlock"` \| `"move"` \| `"gap"` \| `"yield"` \| `"drift"` \| `"reminder"` | yes | — |
| `chain` | `"solana"` \| `"robinhood"` \| `"berachain"` \| `"base"` \| `"arbitrum"` | no | — |
| `chainId` | integer | no | LayerHop chain id (Solana 7565164, Robinhood Chain 4663, Berachain 80094, Base 8453, Arbitrum 42161). |
| `address` | string | no | The token (price, dev_sell) or wallet (wallet). EVM addresses lowercased. |
| `token` | string | no | dev_sell: the token watched (same as `address`). |
| `creator` | string | no | dev_sell, rug: the creator wallet watched. |
| `verified` | boolean | no | dev_sell, rug: true when the creator the API resolved for the token matches `creator`; false = an unverified wallet (shown as a watched wallet). |
| `pct` | number | no | rug, move, gap: the rule's percentage (defaults filled in). |
| `window` | `"1h"` \| `"24h"` | no | move: the window. |
| `minPct` | number | no | unlock: % of circulating supply. |
| `minUsd` | number | no | unlock: US dollars. |
| `leadDays` | integer | no | unlock: days ahead. |
| `op` | `"above"` \| `"below"` | no | — |
| `priceUsd` | string | no | — |
| `purpose` | `"stop_loss"` | no | Set for an exit plan's stop-loss: offer a sell when it fires. |
| `symbol` | string | no | — |
| `label` | string | no | — |
| `asset` | `"USDC"` \| `"USDT"` | no | yield: the stablecoin. |
| `vault` | string | no | yield: the followed pool id. |
| `wallets` | string[] | no | drift: the wallets read (EVM lowercased). |
| `targets` | object[] | no | drift: the target weights. |
| `title` | string | no | reminder: the text sent. |
| `schedule` | object | no | reminder: when (UTC). |
| `schedule.every` | `"day"` \| `"week"` \| `"month"` | no | — |
| `schedule.weekday` | integer | no | — |
| `schedule.monthday` | integer | no | — |
| `schedule.hour` | integer | no | — |
| `link` | string | no | drift, reminder: the button's link. |
| `expiresAt` | integer | yes | Unix seconds. |

### MerchantStatement

| Field | Type | Required | Description |
|---|---|---|---|
| `object` | `"statement"` | yes | — |
| `account` | object | yes | — |
| `account.id` | string | yes | — |
| `account.name` | string \| null | yes | — |
| `month` | string | yes | — |
| `mode` | `"live"` \| `"test"` | yes | — |
| `livemode` | boolean | yes | — |
| `from` | string (date-time) | yes | — |
| `to` | string (date-time) | yes | Exclusive. |
| `currency` | `"USD"` | yes | — |
| `notes` | string[] | yes | — |
| `totals` | object | yes | — |
| `totals.payments` | integer | yes | — |
| `totals.refunds` | integer | yes | — |
| `totals.grossUsd` | number | yes | — |
| `totals.feesUsd` | number | yes | LayerHop + provider fees as recorded, paid by customers on top (not deducted from net). |
| `totals.layerhopFeesUsd` | number | yes | — |
| `totals.providerFeesUsd` | number | yes | — |
| `totals.feesUnknown` | integer | yes | Payments whose fee USD value is not (fully) recorded. |
| `totals.refundsUsd` | number | yes | — |
| `totals.netUsd` | number | yes | — |
| `byToken` | [MerchantStatementToken](#merchantstatementtoken)[] | yes | — |
| `lines` | [MerchantStatementLine](#merchantstatementline)[] | yes | — |
| `lineCount` | integer | yes | — |
| `linesTruncated` | boolean | yes | — |
| `complete` | boolean | yes | false when the month has more than 100,000 payments or refunds (totals cover the first ones). |

### MerchantStatementToken

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `chain` | string | yes | — |
| `token` | string | yes | — |
| `symbol` | string | yes | — |
| `decimals` | integer | yes | — |
| `payments` | integer | yes | — |
| `refunds` | integer | yes | — |
| `gross` | string | yes | Base units. |
| `refunded` | string | yes | Base units. |
| `net` | string | yes | Base units (can be negative). |
| `grossUsd` | number | yes | — |
| `refundsUsd` | number | yes | — |
| `netUsd` | number | yes | — |
| `feesUsd` | number | yes | — |

### MerchantStatementLine

| Field | Type | Required | Description |
|---|---|---|---|
| `type` | `"payment"` \| `"refund"` | yes | — |
| `at` | string (date-time) | yes | — |
| `id` | string | yes | Session id (payment) or refund id. |
| `sessionId` | string | yes | — |
| `source` | `"checkout"` \| `"invoice"` \| `"subscription"` | yes | — |
| `invoiceId` | string \| null | yes | — |
| `invoiceNumber` | string \| null | yes | — |
| `subscriptionId` | string \| null | yes | — |
| `reference` | string \| null | yes | — |
| `description` | string \| null | yes | — |
| `chainId` | integer | yes | — |
| `token` | string | yes | — |
| `symbol` | string | yes | — |
| `decimals` | integer | yes | — |
| `amount` | string | yes | Settlement-token base units; negative for refunds. |
| `amountUsd` | number | yes | — |
| `counterparty` | string \| null | yes | Payer, or the address refunded to. |
| `paidWith` | object \| null | yes | — |
| `paidWith.chainId` | integer | no | — |
| `paidWith.token` | string | no | — |
| `paidWith.amount` | string | no | — |
| `layerhopFee` | object \| null | yes | — |
| `layerhopFee.chainId` | integer | no | — |
| `layerhopFee.token` | string | no | — |
| `layerhopFee.amount` | string | no | — |
| `layerhopFee.usd` | number \| null | no | — |
| `providerFeeUsd` | number \| null | yes | — |
| `txHash` | string \| null | yes | — |

### FundTarget

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | `"polymarket"` \| `"hyperliquid"` \| `"aave-v3-base"` \| `"aave-v3-arbitrum"` \| `"deposit-address"` | yes | — |
| `name` | string | yes | — |
| `description` | string | yes | — |
| `kind` | `"bridge-address"` \| `"own-account"` \| `"vault"` \| `"custom-address"` | yes | `bridge-address`: the route pays the app's per-user address; `own-account`: the user's own address on `dst`; `vault`: route to the user's wallet, then deposit into `vaultId`; `custom-address`: an address the user pastes. |
| `dst` | object | no | Where the route lands (absent for `custom-address`). |
| `dst.chainId` | integer | yes | — |
| `dst.token` | string | yes | — |
| `dst.symbol` | string | yes | — |
| `dst.decimals` | integer | yes | — |
| `vaultId` | string | no | `vault`: the pool id for `POST /v1/yields/{id}/deposit`. |
| `minUsd` | number | no | Smallest deposit the app processes. |
| `risk` | string | yes | Shown before the user signs. |
| `source` | string | yes | The app's own docs for its deposits. |
| `url` | string | yes | — |
| `oneStep` | boolean | no | `vault` only: bridge + supply on arrival in one transaction (destination calls live). |

### FundTargetsResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `targets` | [FundTarget](#fundtarget)[] | yes | — |
| `destinationCallsLive` | boolean | yes | — |

### PolymarketAddresses

| Field | Type | Required | Description |
|---|---|---|---|
| `wallet` | string | yes | The Polymarket wallet (lowercased). |
| `evm` | string | yes | Bridge address for EVM chains (lowercased): the recipient of a route into USDC on Polygon. |
| `svm` | string | no | Bridge address on Solana. |

### YieldPool

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | `<protocol>:<chainId>:<slug>`, stable. |
| `protocol` | `"aave-v3"` \| `"compound-v3"` \| `"morpho"` \| `"spark"` | yes | — |
| `name` | string | yes | — |
| `chainId` | integer | yes | — |
| `chain` | string | yes | — |
| `token` | object | yes | — |
| `token.address` | string | yes | — |
| `token.symbol` | `"USDC"` \| `"USDT"` | yes | — |
| `token.decimals` | integer | yes | — |
| `apy` | number | yes | Percent, e.g. 4.12. Variable. |
| `apyBase` | number | yes | — |
| `apyReward` | number | yes | — |
| `tvlUsd` | number \| null | yes | Assets in the vault (stablecoins at $1). |
| `depositable` | boolean | yes | — |
| `deposit` | object | yes | — |
| `deposit.kind` | `"aave-v3-supply"` \| `"comet-supply"` \| `"erc4626-deposit"` | yes | — |
| `deposit.target` | string | yes | The contract approved and called. |
| `url` | string | yes | The vault on the protocol's own site. |

### YieldsResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `asset` | `"USDC"` \| `"USDT"` | yes | — |
| `updatedAt` | integer | yes | Unix seconds. |
| `source` | string | yes | — |
| `pools` | [YieldPool](#yieldpool)[] | yes | — |
| `unavailable` | string[] | yes | Pool ids whose rate couldn't be read this time. |

### YieldDepositPlan

| Field | Type | Required | Description |
|---|---|---|---|
| `vault` | string | yes | — |
| `chainId` | integer | yes | — |
| `token` | string | yes | — |
| `amount` | string | yes | Base units. |
| `owner` | string | yes | — |
| `calls` | object[] | yes | — |
| `simulation` | object | yes | — |
| `simulation.ok` | `true` | yes | — |
| `simulation.gasUsed` | string | yes | — |
| `simulation.leftover` | string | no | — |

### LaunchMetadataUpload

| Field | Type | Required | Description |
|---|---|---|---|
| `mint` | string | yes | The new token's address: a base58 Solana mint, or the EVM token address (`0x…`) on the EVM chains. |
| `chain` | `"solana"` \| `"robinhood"` \| `"base"` \| `"arbitrum"` | no | Where the token is created. (default `"solana"`) |
| `creator` | string | yes | The creator's wallet (base58 on Solana, `0x…` on the EVM chains). Only this wallet can replace the upload. |
| `name` | string | yes | (min length 1) |
| `symbol` | string | yes | (pattern `^[A-Za-z0-9$]{1,10}$`) |
| `description` | string | no | — |
| `website` | string (uri) | no | An http(s) URL. |
| `twitter` | string (uri) | no | An http(s) URL. |
| `telegram` | string (uri) | no | An http(s) URL. |
| `image` | string (binary) | yes | PNG, JPEG, WebP or GIF, at most 1 MB. |

### LaunchMetadataUploaded

| Field | Type | Required | Description |
|---|---|---|---|
| `mint` | string | yes | The token address (EVM addresses lowercase). |
| `chain` | `"solana"` \| `"robinhood"` \| `"base"` \| `"arbitrum"` | yes | — |
| `uri` | string (uri) | yes | The metadata JSON URL to put on chain. |
| `image` | string (uri) | yes | The hosted image URL. |

### LaunchMetadata

| Field | Type | Required | Description |
|---|---|---|---|
| `mint` | string | yes | The token address (EVM addresses lowercase). |
| `chain` | `"solana"` \| `"robinhood"` \| `"base"` \| `"arbitrum"` | yes | — |
| `creator` | string | yes | — |
| `name` | string | yes | — |
| `symbol` | string | yes | — |
| `description` | string \| null | yes | — |
| `image` | string (uri) | yes | The hosted image URL. |
| `website` | string \| null | yes | — |
| `twitter` | string \| null | yes | — |
| `telegram` | string \| null | yes | — |
| `createdAt` | string (date-time) | yes | First upload. |

### LaunchSpotlightItem

| Field | Type | Required | Description |
|---|---|---|---|
| `token` | string | yes | The token address (EVM addresses lowercase). |
| `chain` | `"solana"` \| `"robinhood"` \| `"base"` \| `"arbitrum"` | yes | — |
| `name` | string | yes | — |
| `symbol` | string | yes | — |
| `image` | string (uri) | yes | The hosted image URL. |
| `createdAt` | string (date-time) | yes | — |
| `featured` | boolean | yes | Pinned by a launch admin (promotion, not a safety claim). |
| `trades24h` | integer | no | Trending only: filled swaps buying or selling it through LayerHop in the last 24 h. |
| `traders24h` | integer | no | Trending only: distinct wallets behind those swaps, the creator excluded. |

### LaunchSpotlight

| Field | Type | Required | Description |
|---|---|---|---|
| `featured` | [LaunchSpotlightItem](#launchspotlightitem)[] | yes | — |
| `trending` | [LaunchSpotlightItem](#launchspotlightitem)[] | yes | — |

### LaunchCurationRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `vm` | `"evm"` \| `"svm"` | yes | — |
| `wallet` | string | yes | The launch admin wallet that signed. |
| `token` | string | yes | Solana mint or EVM token address. |
| `action` | `"feature"` \| `"unfeature"` \| `"hide"` \| `"unhide"` | yes | — |
| `issuedAt` | string (date-time) | yes | `Date.toISOString()`, within the last 10 minutes. |
| `signature` | string | yes | EVM: 0x hex. Solana: base58 or base64. |

### LaunchCurationState

| Field | Type | Required | Description |
|---|---|---|---|
| `mint` | string | yes | — |
| `hidden` | boolean | yes | — |
| `featured` | boolean | yes | — |

### LaunchTokenJson

Metaplex token metadata JSON.

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | — |
| `symbol` | string | yes | — |
| `description` | string | yes | Empty when none was given. |
| `image` | string (uri) | yes | — |
| `external_url` | string (uri) | no | The website, when given. |
| `extensions` | object | yes | The links that were given. |
| `extensions.website` | string | no | — |
| `extensions.twitter` | string | no | — |
| `extensions.telegram` | string | no | — |
| `createdOn` | `"https://app.layerhop.com"` | yes | — |

### OrderList

| Field | Type | Required | Description |
|---|---|---|---|
| `orders` | [OrderSummary](#ordersummary)[] | yes | — |
| `nextCursor` | string \| null | yes | Pass as `cursor` for the next page; null on the last page. |

### AccountOrder

`OrderSummary` plus `keyId`, `partnerId` and `partnerFeeEstimate` (input-token base units).

| Field | Type | Required | Description |
|---|---|---|---|
| `keyId` | string \| null | no | — |
| `partnerId` | string \| null | no | — |
| `partnerFeeEstimate` | string | no | (pattern `^\d+$`) |

### AccountOrderList

| Field | Type | Required | Description |
|---|---|---|---|
| `orders` | [AccountOrder](#accountorder)[] | yes | — |
| `nextCursor` | string \| null | yes | — |

### SimulationError

| Field | Type | Required | Description |
|---|---|---|---|
| `code` | `"SIMULATION_FAILED"` \| `"RPC_ERROR"` | yes | `SIMULATION_FAILED` the tx would fail · `RPC_ERROR` the simulation could not run. |
| `message` | string | yes | Revert reason or RPC error. |
| `logs` | string[] | no | Solana program logs (last 50 lines). |

### TreasuryWalletRef

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |
| `label` | string | yes | — |
| `address` | string | yes | — |
| `vm` | [Vm](#vm) | yes | — |
| `keyHolder` | `"agent"` \| `"owner"` | yes | — |

### TreasuryMove

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^tm_`) |
| `actor` | `"owner-dashboard"` \| `"agent-cli"` | yes | — |
| `kind` | `"send"` \| `"swap"` \| `"claim"` | yes | — |
| `status` | `"planned"` \| `"submitted"` \| `"confirmed"` \| `"failed"` \| `"cancelled"` | yes | — |
| `fromWalletId` | string \| null | yes | — |
| `fromAddress` | string \| null | yes | — |
| `toWalletId` | string | yes | — |
| `toAddress` | string | yes | — |
| `srcChainId` | integer | yes | — |
| `dstChainId` | integer | yes | — |
| `token` | string | yes | — |
| `dstToken` | string \| null | no | — |
| `symbol` | string \| null | no | — |
| `decimals` | integer \| null | no | — |
| `amount` | string | yes | (pattern `^\d+$`) |
| `usd` | number \| null | no | — |
| `quoteId` | string \| null | no | — |
| `orderId` | string \| null | no | — |
| `txHashes` | string[] | yes | — |
| `note` | string \| null | no | — |
| `createdAt` | string (date-time) | yes | — |
| `updatedAt` | string (date-time) | yes | — |

### SimulationResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | — |
| `provider` | [ProviderId](#providerid) | yes | — |
| `ok` | boolean | yes | True when what was simulated succeeded. |
| `vm` | [Vm](#vm) | yes | — |
| `gasEstimate` | string | no | EVM: gas units for what was simulated. (pattern `^\d+$`) |
| `computeUnits` | integer | no | Solana: compute units consumed. |
| `energyUsed` | integer | no | Tron: energy the simulated call used (about 100 sun of TRX each without staked energy). |
| `needsApproval` | boolean | no | EVM / Tron: the allowance is too low; send `tx.approval` first. |
| `simulated` | `"tx"` \| `"approval"` | no | EVM / Tron: `tx` the swap itself (EVM: with an allowance override if needed), `approval` only the approval. |
| `error` | [SimulationError](#simulationerror) | no | — |
| `tx` | [BuiltTx](#builttx) | yes | — |
| `livemode` | boolean | no | Present (false) in test mode, where nothing is simulated on chain and the result is always ok. |

### NonceRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `vm` | [WalletVm](#walletvm) | yes | — |
| `address` | string | yes | 0x address (EVM) or base58 public key (Solana). |

### NonceResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `nonce` | string | yes | — |
| `message` | string | yes | Sign exactly this text. |
| `expiresAt` | string (date-time) | yes | — |

### VerifyRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `vm` | [WalletVm](#walletvm) | yes | — |
| `message` | string | yes | The unchanged message from `POST /v1/auth/nonce`. |
| `signature` | string | yes | EVM: 0x hex. Solana: base58 or base64 ed25519 signature. |

### Account

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^acc_`) |
| `displayName` | string \| null | no | — |
| `email` | string \| null | no | — |
| `createdAt` | string (date-time) | yes | — |

### AccountUpdateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `displayName` | string \| null | no | Up to 64 characters. |
| `email` | string \| null | no | — |

### Wallet

| Field | Type | Required | Description |
|---|---|---|---|
| `vm` | [WalletVm](#walletvm) | yes | — |
| `address` | string | yes | EVM addresses are lowercase. |
| `createdAt` | string (date-time) | yes | — |

### VerifyResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `account` | [Account](#account) | yes | — |

### PartnerStatus

Only `active` partners earn fees.

`string`, one of:

- `pending`
- `active`
- `suspended`

### PartnerProfile

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Public label, used as `integrator=<id>`. (pattern `^[a-z0-9-]{1,32}$`) |
| `name` | string | yes | — |
| `feeBps` | integer | yes | Partner fee in bps, on top of LayerHop's. |
| `maxFeeBps` | integer | yes | Set by LayerHop on approval. |
| `payoutEvm` | string \| null | no | — |
| `payoutSvm` | string \| null | no | — |
| `status` | [PartnerStatus](#partnerstatus) | yes | — |
| `createdAt` | string (date-time) | yes | — |

### MeResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `account` | [Account](#account) | yes | — |
| `wallets` | [Wallet](#wallet)[] | yes | — |
| `partner` | [PartnerProfile](#partnerprofile) \| null | yes | The partner profile, or null. |

### OkResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `ok` | `true` | yes | — |

### WalletsResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `wallets` | [Wallet](#wallet)[] | yes | — |

### Overview

| Field | Type | Required | Description |
|---|---|---|---|
| `livemode` | boolean | yes | Which mode the numbers are for (see the `mode` parameter). |
| `from` | string (date-time) | yes | — |
| `to` | string (date-time) | yes | — |
| `requests` | integer | yes | API requests made with the account's keys. |
| `errors` | integer | yes | Of those, responses with status >= 400. |
| `quotes` | integer | yes | Successful `GET /v1/quote` calls. |
| `orders` | object | yes | — |
| `orders.built` | integer | yes | Orders built (any status). |
| `orders.filled` | integer | yes | — |
| `orders.byStatus` | object | yes | Order count per status. |
| `volume` | object[] | yes | Filled input volume per source token (base units). |
| `earnings` | object \| null | yes | For partners, 30-day fee estimates per token (same shape as `EarningsByToken`, flattened). |
| `activeKeys` | integer | yes | — |

### ApiKey

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^key_`) |
| `name` | string | yes | — |
| `prefix` | string | yes | First 12 characters of the key, for recognising it. |
| `rateLimitRpm` | integer | yes | Requests per minute (token bucket). |
| `livemode` | boolean | no | false for an `lh_test_` (test mode) key. |
| `createdAt` | string (date-time) | yes | — |
| `lastUsedAt` | string \| null | no | Updated at most once a minute. |
| `revokedAt` | string \| null | no | — |

### ApiKeyList

| Field | Type | Required | Description |
|---|---|---|---|
| `keys` | [ApiKey](#apikey)[] | yes | — |

### ApiKeyNameRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | 1–64 characters. (min length 1) |

### ApiKeyCreateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | 1–64 characters. (min length 1) |
| `mode` | `"live"` \| `"test"` | no | `test` creates an `lh_test_` sandbox key. (default `"live"`) |

### ApiKeyCreated

| Field | Type | Required | Description |
|---|---|---|---|
| `key` | [ApiKey](#apikey) | yes | — |
| `secret` | string | yes | Send as `x-api-key`. Shown once. (pattern `^lh_(live\|test)_[0-9A-Za-z]{32}$`) |

### ApiKeyResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `key` | [ApiKey](#apikey) | yes | — |

### UsagePoint

| Field | Type | Required | Description |
|---|---|---|---|
| `ts` | string (date-time) | yes | Bucket start (UTC). |
| `requests` | integer | yes | — |
| `errors` | integer | yes | — |
| `quotes` | integer | yes | — |
| `orders` | integer | yes | Successful `POST /v1/orders` calls. |

### UsageResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `bucket` | `"hour"` \| `"day"` | yes | — |
| `from` | string (date-time) | yes | — |
| `to` | string (date-time) | yes | — |
| `series` | [UsagePoint](#usagepoint)[] | yes | — |

### RequestLog

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |
| `ts` | string (date-time) | yes | — |
| `keyId` | string \| null | no | — |
| `requestId` | string (uuid) | yes | — |
| `method` | string | yes | — |
| `path` | string | yes | Route pattern, e.g. `/v1/orders/:provider/:id`. |
| `query` | object \| null | no | Query parameters (secrets redacted). |
| `status` | integer | yes | — |
| `latencyMs` | integer | yes | — |
| `errorCode` | string \| null | no | — |
| `provider` | string \| null | no | Best provider for quotes, the provider for orders. |
| `livemode` | boolean | no | — |

### RequestLogList

| Field | Type | Required | Description |
|---|---|---|---|
| `logs` | [RequestLog](#requestlog)[] | yes | — |
| `nextCursor` | string \| null | yes | — |

### StatusClassCounts

Requests per HTTP status class.

| Field | Type | Required | Description |
|---|---|---|---|
| `2xx` | integer | yes | — |
| `3xx` | integer | yes | — |
| `4xx` | integer | yes | — |
| `5xx` | integer | yes | — |

### UsageReport

| Field | Type | Required | Description |
|---|---|---|---|
| `bucket` | `"hour"` \| `"day"` | yes | — |
| `from` | string (date-time) | yes | — |
| `to` | string (date-time) | yes | — |
| `livemode` | boolean | yes | — |
| `keyId` | string \| null | yes | — |
| `totals` | object | yes | — |
| `totals.requests` | integer | yes | — |
| `totals.errors` | integer | yes | 4xx + 5xx. |
| `totals.byStatusClass` | [StatusClassCounts](#statusclasscounts) | yes | — |
| `totals.avgMs` | integer \| null | no | — |
| `totals.p50Ms` | integer \| null | no | Median latency (ms) estimated from the histogram. |
| `totals.p95Ms` | integer \| null | no | — |
| `series` | object[] | yes | — |
| `byEndpoint` | object[] | yes | Endpoint groups, busiest first. |
| `errorCodes` | object[] | yes | Stable error codes returned, most frequent first. |

### UsageErrorList

| Field | Type | Required | Description |
|---|---|---|---|
| `livemode` | boolean | yes | — |
| `errors` | object[] | yes | — |

### WebhookResendResult

| Field | Type | Required | Description |
|---|---|---|---|
| `eventId` | string | yes | — |
| `type` | string | no | — |
| `livemode` | boolean | no | — |
| `deliveries` | object[] | yes | — |

### WebhookEventType

Events you can subscribe to (`webhook.test` is always delivered to the endpoint it was sent to).
Order events carry `data.order`; `order.dropped` means the source transaction never reached
the network (no funds moved); checkout events carry `data.session` (a `CheckoutSession`);
`checkout.session.refunded` adds `data.refund` (a `Refund`); `invoice.sent` carries
`data.invoice` (an `Invoice`) and `invoice.paid` carries `data.invoice` and `data.session`.
`subscription.created` and `subscription.canceled` carry `data.subscription` (a
`Subscription`); `subscription.renewed` (a period's invoice was issued and emailed) and
`subscription.past_due` add `data.invoice`.
`limit_order.*` events carry `data.limitOrder` (a `LimitOrder`); `limit_order.filled` adds
`data.fill` (the fill's `OrderSummary`) and is sent for every fill, partial ones included.
`x402.payment.settled` carries `data.payment` (an `X402Payment`).

`string`, one of:

- `order.submitted`
- `order.filled`
- `order.refunded`
- `order.failed`
- `order.dropped`
- `checkout.session.processing`
- `checkout.session.completed`
- `checkout.session.payment_failed`
- `checkout.session.expired`
- `checkout.session.refunded`
- `invoice.sent`
- `invoice.paid`
- `subscription.created`
- `subscription.renewed`
- `subscription.past_due`
- `subscription.canceled`
- `limit_order.opened`
- `limit_order.filled`
- `limit_order.cancelled`
- `limit_order.expired`
- `limit_order.failed`
- `x402.payment.settled`

### Webhook

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^whe_`) |
| `url` | string (uri) | yes | — |
| `events` | [WebhookEventType](#webhookeventtype)[] | yes | Empty = every event. |
| `active` | boolean | yes | — |
| `livemode` | boolean | no | Test endpoints receive only test-mode events, live endpoints only live ones. |
| `createdAt` | string (date-time) | yes | — |

### WebhookList

| Field | Type | Required | Description |
|---|---|---|---|
| `webhooks` | [Webhook](#webhook)[] | yes | — |

### WebhookCreateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `url` | string (uri) | yes | Public https URL. |
| `events` | [WebhookEventType](#webhookeventtype)[] | no | — |
| `mode` | `"live"` \| `"test"` | no | `test` endpoints receive only test-mode events. Fixed after creation. (default `"live"`) |

### WebhookUpdateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `url` | string (uri) | no | — |
| `events` | [WebhookEventType](#webhookeventtype)[] | no | — |
| `active` | boolean | no | — |

### WebhookCreated

| Field | Type | Required | Description |
|---|---|---|---|
| `webhook` | [Webhook](#webhook) | yes | — |
| `secret` | string | yes | HMAC-SHA256 signing secret. Shown once. (pattern `^whsec_`) |

### WebhookResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `webhook` | [Webhook](#webhook) | yes | — |

### WebhookTestResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `eventId` | string | yes | (pattern `^evt_`) |
| `deliveryId` | string | yes | (pattern `^whd_`) |

### WebhookDelivery

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^whd_`) |
| `endpointId` | string | yes | — |
| `eventId` | string | yes | — |
| `eventType` | string | no | Event type, e.g. `order.filled` (list endpoint only). |
| `attempt` | integer | yes | Attempts made so far. |
| `status` | `"pending"` \| `"success"` \| `"failed"` | yes | — |
| `responseCode` | integer \| null | no | — |
| `responseSnippet` | string \| null | no | First 500 characters of the response body. |
| `durationMs` | integer \| null | no | Last attempt, request start to response or error. |
| `nextAttemptAt` | string \| null | no | — |
| `createdAt` | string (date-time) | yes | — |
| `deliveredAt` | string \| null | no | — |

### WebhookDeliveryList

| Field | Type | Required | Description |
|---|---|---|---|
| `deliveries` | [WebhookDelivery](#webhookdelivery)[] | yes | — |
| `nextCursor` | string \| null | yes | — |

### WebhookDeliveryResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `delivery` | [WebhookDelivery](#webhookdelivery) | yes | — |

### PartnerProfileResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `partner` | [PartnerProfile](#partnerprofile) \| null | yes | — |

### PartnerApplyRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^[a-z0-9-]{1,32}$`) |
| `name` | string | yes | (min length 1) |
| `payoutEvm` | string | no | EVM payout address. At least one payout address is required. |
| `payoutSvm` | string | no | Solana payout address. |

### PartnerUpdateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | no | (min length 1) |
| `feeBps` | integer | no | <= maxFeeBps. (≥ 0) |
| `payoutEvm` | string \| null | no | — |
| `payoutSvm` | string \| null | no | — |

### EarningsBucket

| Field | Type | Required | Description |
|---|---|---|---|
| `orders` | integer | yes | — |
| `partnerFee` | string | yes | Partner fee estimate in base units of the source token. (pattern `^\d+$`) |

### EarningsByToken

| Field | Type | Required | Description |
|---|---|---|---|
| `srcChainId` | integer | yes | — |
| `srcToken` | string | yes | — |
| `filled` | [EarningsBucket](#earningsbucket) | yes | — |
| `unconfirmed` | [EarningsBucket](#earningsbucket) | yes | — |

### EarningsByMonth

| Field | Type | Required | Description |
|---|---|---|---|
| `month` | string | yes | (pattern `^\d{4}-\d{2}$`) |
| `srcChainId` | integer | yes | — |
| `srcToken` | string | yes | — |
| `filled` | [EarningsBucket](#earningsbucket) | yes | — |
| `unconfirmed` | [EarningsBucket](#earningsbucket) | yes | — |

### EarningsResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `partner` | string \| null | yes | Partner id, or null without a profile. |
| `from` | string (date-time) | yes | — |
| `to` | string (date-time) | yes | — |
| `basis` | `"estimate"` | yes | — |
| `livemode` | boolean | no | — |
| `byToken` | [EarningsByToken](#earningsbytoken)[] | yes | — |
| `byMonth` | [EarningsByMonth](#earningsbymonth)[] | yes | — |

### PartnerBalance

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `token` | string | yes | — |
| `earned` | string | yes | Partner fees of filled live orders, base units. (pattern `^\d+$`) |
| `paid` | string | yes | Sum of non-voided payouts, base units. (pattern `^\d+$`) |
| `owed` | string | yes | `earned` - `paid`; negative when overpaid. (pattern `^-?\d+$`) |
| `decimals` | integer \| null | yes | — |
| `owedUsd` | number \| null | yes | USD value of `owed` when the price is known. |

### Payout

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | `po_…` |
| `partnerId` | string | yes | — |
| `chainId` | integer | yes | — |
| `token` | string | yes | — |
| `amount` | string | yes | Base units. (pattern `^\d+$`) |
| `toAddress` | string \| null | yes | — |
| `txHash` | string \| null | yes | — |
| `note` | string \| null | yes | — |
| `paidAt` | string (date-time) | yes | — |
| `voidedAt` | string \| null | yes | — |
| `createdAt` | string (date-time) | yes | — |

### PayoutsResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `partner` | string \| null | yes | Partner id, or null without a profile. |
| `balances` | [PartnerBalance](#partnerbalance)[] | yes | — |
| `payouts` | [Payout](#payout)[] | yes | — |

### PayoutRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | (≥ 1) |
| `token` | string | yes | Token address (EVM) or mint (Solana) that was paid. |
| `amount` | string | yes | Base units. (pattern `^[1-9]\d*$`) |
| `toAddress` | string | no | — |
| `txHash` | string | no | — |
| `note` | string | no | — |
| `paidAt` | string (date-time) | no | Defaults to now. |

### PayoutResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `payout` | [Payout](#payout) | yes | — |

### ApproveRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `maxFeeBps` | integer | yes | <= MAX_TOTAL_FEE_BPS. (≥ 0) |

### AdminPartnerResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `partner` | object | yes | The partner row (includes `accountId`). |

### RateLimitRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `rateLimitRpm` | integer | yes | (1–100000) |

### AdminKeyResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `key` | object | yes | — |
| `key.id` | string | no | — |
| `key.accountId` | string | no | — |
| `key.name` | string | no | — |
| `key.prefix` | string | no | — |
| `key.rateLimitRpm` | integer | no | — |

### CheckoutStatus

`open` (waiting for payment), `processing` (a payment was reported and is being tracked),
`paid` (delivery to the recipient verified on chain), `expired`, `needs_review` (the payment
finished but the delivery could not be verified; contact support).

`string`, one of:

- `open`
- `processing`
- `paid`
- `expired`
- `needs_review`

### CheckoutSessionCreateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `amount` | string | yes | Amount due in base units of the settlement token (49 USDC = `49000000`). (pattern `^\d+$`) |
| `settleChain` | string | yes | Settlement chain id or slug: ethereum, arbitrum, base, optimism, bsc, polygon or solana. |
| `settleToken` | string | yes | `USDC` or `USDT` (or its address) on that chain. |
| `recipient` | string | yes | Your payout address on the settlement chain. |
| `merchantName` | string | no | Shown to the payer. Defaults to nothing. |
| `description` | string | no | Shown to the payer, e.g. the product. |
| `reference` | string | no | Your own order id. Never shown to the payer. |
| `metadata` | object | no | Up to 20 string values for your records. Never shown to the payer. |
| `successUrl` | string (uri) | no | Where the hosted page sends the payer after paying (`?session_id=` is appended). |
| `cancelUrl` | string (uri) | no | Where the payer goes on Cancel. |
| `expiresInMinutes` | integer | no | (default `60`) (5–10080) |
| `embedOrigins` | string (uri)[] | no | Embedded checkout: the exact origins (`https://shop.example.com`; `http://localhost` allowed) that may show this session in an iframe and receive its postMessage events. Paths are dropped. Empty or absent: any site may embed it (see [Embedded checkout](/guides/embedded-checkout)). |

### CheckoutSettlement

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `token` | string | yes | — |
| `symbol` | string | yes | — |
| `decimals` | integer | yes | — |

### CheckoutPayment

The current (or final) payment attempt.

| Field | Type | Required | Description |
|---|---|---|---|
| `method` | `"wallet"` \| `"transfer"` | no | `wallet`: paid through a quote on the page or the API; `transfer`: a scan-to-pay transfer (no quote). |
| `quoteId` | string \| null | no | null for a scan-to-pay transfer. |
| `payer` | string \| null | no | — |
| `srcChainId` | integer \| null | no | — |
| `srcToken` | string \| null | no | — |
| `srcAmount` | string \| null | no | What the payer sent, in base units of `srcToken`. |
| `srcTxHash` | string \| null | no | — |
| `dstTxHash` | string \| null | no | The verified delivery transaction once paid. |
| `paidAt` | string \| null | no | — |

### CheckoutSession

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^cs_`) |
| `object` | `"checkout.session"` | yes | — |
| `livemode` | boolean | yes | — |
| `status` | [CheckoutStatus](#checkoutstatus) | yes | — |
| `statusDetail` | string \| null | no | — |
| `amount` | string | yes | (pattern `^\d+$`) |
| `settlement` | [CheckoutSettlement](#checkoutsettlement) | yes | — |
| `recipient` | string | yes | — |
| `merchantName` | string \| null | no | — |
| `description` | string \| null | no | — |
| `url` | string (uri) | yes | The hosted checkout page. |
| `productId` | string \| null | no | The product the session was started from. |
| `invoiceId` | string \| null | no | The invoice the session pays. |
| `refundedAmount` | string | no | Sum of completed refunds in base units of the settlement token (`0` when none). (pattern `^\d+$`) |
| `successUrl` | string \| null | no | — |
| `cancelUrl` | string \| null | no | — |
| `expiresAt` | string (date-time) | yes | — |
| `payment` | [CheckoutPayment](#checkoutpayment) \| null | yes | — |
| `reference` | string \| null | no | Only with your API key. |
| `metadata` | object \| null | no | Only with your API key. |
| `branding` | boolean | no | Only when the operator enabled plans: false when the merchant's plan includes white-label, and the hosted page then hides "Secured by LayerHop". |
| `transferAvailable` | boolean | no | The payer can be shown a "Send to address" QR (`POST /v1/checkout/sessions/{id}/transfer`). |
| `transfer` | [CheckoutTransfer](#checkouttransfer) \| null | no | Scan-to-pay state once the payer asked for a QR. |
| `embedOrigins` | string[] | no | Sites allowed to embed this checkout (`embedOrigins` at creation, or the product's `allowedOrigins`). Empty: any site. |
| `bitcoinAvailable` | boolean | no | Only where the operator enabled Bitcoin checkout (D-067): the payer can be shown a Bitcoin deposit address (`POST /v1/checkout/sessions/{id}/bitcoin`). |
| `bitcoin` | [CheckoutBitcoin](#checkoutbitcoin) \| null | no | Only where Bitcoin checkout is enabled: the Bitcoin payment once the payer asked for it. |
| `createdAt` | string (date-time) | yes | — |
| `updatedAt` | string (date-time) | yes | — |

### CheckoutTransfer

Scan-to-pay state ("Send to address", D-064).

| Field | Type | Required | Description |
|---|---|---|---|
| `kind` | `"evm_transfer"` \| `"solana_pay"` \| `"evm_splitter"` | yes | — |
| `chainId` | integer | yes | — |
| `token` | string | yes | The settlement token. |
| `symbol` | string | yes | — |
| `decimals` | integer | yes | — |
| `address` | string | yes | Where to send: the session's recipient, or its own deposit address (`evm_splitter`). |
| `amount` | string | yes | What to send now, base units. EVM: the exact tagged amount (after a short payment, the tagged rest). Solana: the merchant's part (the fee is added in the transaction). (pattern `^\d+$`) |
| `amountDue` | string | yes | (pattern `^\d+$`) |
| `fee` | object \| null | yes | LayerHop's fee on top: paid inside the Solana Pay transaction, or (`evm_splitter`) the part of `amount` the deposit contract sends to LayerHop. |
| `fee.bps` | integer | no | — |
| `fee.amount` | string | no | — |
| `uri` | string | yes | QR payload: EIP-681 transfer request (EVM) or Solana Pay transaction request (Solana). |
| `transferUri` | string \| null | yes | Solana Pay transfer request (plain transfer with the reference); only where the operator enabled it. |
| `reference` | string \| null | yes | Solana Pay reference key. |
| `received` | string | yes | Confirmed amount received so far. (pattern `^\d+$`) |
| `seen` | string | yes | Seen on chain but still waiting for confirmations. (pattern `^\d+$`) |
| `state` | `"waiting"` \| `"partial"` \| `"paid"` \| `"overpaid"` | yes | — |
| `txs` | object[] | yes | — |
| `startedAt` | string (date-time) | yes | — |
| `sweepTxHash` | string \| null | no | `evm_splitter` only: the sweep that paid the deposit out to the merchant (null until swept). |

### Plan

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Stable plan id (`free`, `pro`, `scale`). |
| `name` | string | yes | — |
| `tagline` | string | yes | — |
| `priceUsdc` | string | yes | Monthly price as a decimal string ("49"). |
| `price` | object | yes | — |
| `price.amount` | string | yes | Monthly price in base units of the billing token. (pattern `^\d+$`) |
| `price.symbol` | string | yes | — |
| `price.decimals` | integer | yes | — |
| `price.chainId` | integer | yes | Chain the invoices settle on. |
| `price.interval` | `"month"` | yes | — |
| `rateLimitRpm` | integer | yes | Requests per minute per API key (a higher limit set on the key wins). |
| `monthlyRequests` | integer \| null | yes | Live requests per account per calendar month (UTC); null = no quota. |
| `webhookEndpoints` | integer | yes | — |
| `maxPartnerFeeBps` | integer | yes | Highest partner fee the account's partner profile may charge. |
| `whiteLabel` | boolean | yes | Hide LayerHop branding in the widget and on hosted checkout. |
| `prioritySupport` | boolean | yes | — |
| `marketRpm` | integer | no | Market data requests per minute per API key (0 = no market data). Present only while the market data API is enabled. |
| `marketMonthlyCalls` | integer \| null | no | Market data calls per account per calendar month (UTC), live and test keys together; null = no cap. Present only while the market data API is enabled. |

### MarketWindowNumbers

One figure over the last 5 minutes, 1 hour, 6 hours and 24 hours (`d7`: 7 days, on the 7-day window and token detail). Null when unknown.

| Field | Type | Required | Description |
|---|---|---|---|
| `m5` | number \| null | no | — |
| `h1` | number \| null | no | — |
| `h6` | number \| null | no | — |
| `h24` | number \| null | no | — |
| `d7` | number \| null | no | — |

### MarketChainInfo

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `slug` | `"berachain"` \| `"robinhood"` | yes | — |
| `name` | string | yes | — |
| `dexes` | string[] | yes | Exchanges the indexer reads. |
| `intervals` | string[] | yes | Candle intervals. |
| `available` | boolean | yes | false when this deployment has no indexer for the chain. |

### MarketChainList

| Field | Type | Required | Description |
|---|---|---|---|
| `chains` | [MarketChainInfo](#marketchaininfo)[] | yes | — |

### MarketToken

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | Lower-case token address. |
| `symbol` | string \| null | yes | — |
| `name` | string \| null | yes | From LayerHop's token registry; null when unknown. |
| `decimals` | integer \| null | yes | — |
| `priceUsd` | number \| null | yes | Last trade price in USD in its main pool. |
| `change` | [MarketWindowNumbers](#marketwindownumbers) | yes | Price change in percent. |
| `volumeUsd` | [MarketWindowNumbers](#marketwindownumbers) | yes | — |
| `trades` | [MarketWindowNumbers](#marketwindownumbers) | yes | Trade counts. |
| `pool` | string \| null | yes | The main (most traded) pool. |
| `poolCount` | integer \| null | yes | Pools with a trade in the window. |
| `quoteSymbol` | string \| null | yes | The other side of the main pool. |
| `createdAt` | integer \| null | yes | When the token's first pool was created (unix ms), when known. |

### MarketTokenList

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `window` | `"24h"` \| `"7d"` | yes | — |
| `sort` | `"trending"` \| `"top"` \| `"new"` \| `"gainers"` | yes | — |
| `asOf` | integer \| null | yes | Unix seconds of the indexer's summary. |
| `count` | integer | yes | Matching tokens (before `limit`). |
| `tokens` | [MarketToken](#markettoken)[] | yes | — |

### MarketTokenDetail

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `asOf` | integer \| null | yes | — |
| `token` | [MarketToken](#markettoken) | yes | — |

### MarketHolders

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `token` | string | yes | — |
| `status` | `"ready"` \| `"syncing"` \| `"waiting_for_rpc"` \| `"failed"` \| `"too_large"` | yes | `ready`, or still counting (`syncing`, `waiting_for_rpc`), or not available (`failed`, `too_large`). |
| `holdersCount` | integer \| null | yes | Addresses with a balance above zero (the zero address excluded). |
| `totalSupply` | string \| null | yes | Base units. |
| `decimals` | integer \| null | yes | — |
| `syncedBlock` | integer \| null | yes | Balances are as of this block. |
| `partial` | boolean | yes | true while counting; the list covers the history up to `syncedBlock`. |
| `progress` | number | no | While counting: 0–1. |
| `holders` | object[] | yes | — |

### MarketPoolList

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `window` | `"24h"` \| `"7d"` | yes | — |
| `asOf` | integer \| null | yes | — |
| `count` | integer | yes | — |
| `pools` | object[] | yes | — |

### MarketCandles

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `pool` | string | yes | — |
| `token` | string \| null | yes | The side asked for; null = the pool's priced token. |
| `interval` | string | yes | — |
| `indexed` | boolean | yes | false when LayerHop does not index this pool. |
| `candles` | object[] | yes | — |

### MarketTrades

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `pool` | string | yes | — |
| `token` | string \| null | yes | — |
| `indexed` | boolean | yes | — |
| `trades` | object[] | yes | — |
| `next` | string \| null | yes | Pass as `before` for older trades; null at the end. |
| `partial` | boolean | yes | true when older history could not be read right now. |

### MarketTraders

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `pool` | string | yes | — |
| `token` | string \| null | yes | — |
| `indexed` | boolean | yes | — |
| `asOf` | integer \| null | yes | Unix seconds. |
| `decimals` | integer \| null | yes | — |
| `priceUsd` | number \| null | yes | — |
| `coverage` | object | yes | — |
| `coverage.trades` | integer | yes | — |
| `coverage.withWallet` | integer | yes | — |
| `coverage.complete` | boolean | yes | — |
| `traders` | object[] | yes | — |

### PlanList

| Field | Type | Required | Description |
|---|---|---|---|
| `plans` | [Plan](#plan)[] | yes | — |

### PlanStatus

`free`; `active` (paid, renewing); `past_due` (the renewal invoice is overdue); `canceling`
(paid until `periodEnd`, not renewing); `grace` (period over, renewal unpaid: the plan stays until `expiresAt`).

`string`, one of:

- `free`
- `active`
- `past_due`
- `canceling`
- `grace`

### PlanUsage

| Field | Type | Required | Description |
|---|---|---|---|
| `requests` | integer | yes | Live API requests this calendar month (UTC). |
| `monthlyRequests` | integer \| null | yes | — |
| `resetsAt` | string (date-time) | yes | — |
| `rateLimitRpm` | integer | yes | — |
| `webhookEndpoints` | object | yes | — |
| `webhookEndpoints.used` | integer | yes | — |
| `webhookEndpoints.limit` | integer | yes | — |
| `marketCalls` | object | no | Market data calls this calendar month (UTC). Present only while the market data API is enabled. |
| `marketCalls.used` | integer | yes | — |
| `marketCalls.limit` | integer \| null | yes | — |
| `marketCalls.rateLimitRpm` | integer | yes | — |

### AccountPlan

| Field | Type | Required | Description |
|---|---|---|---|
| `plan` | [Plan](#plan) | yes | — |
| `status` | [PlanStatus](#planstatus) | yes | — |
| `periodEnd` | string \| null | yes | End of the paid period. |
| `expiresAt` | string \| null | yes | When the plan falls back to Free unless renewed (period end + grace). |
| `usage` | [PlanUsage](#planusage) | yes | — |

### EmbedBranding

| Field | Type | Required | Description |
|---|---|---|---|
| `integrator` | string | yes | — |
| `whiteLabel` | boolean | yes | — |

### BillingInvoice

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |
| `number` | string | yes | — |
| `status` | `"draft"` \| `"open"` \| `"paid"` \| `"void"` | yes | — |
| `plan` | string \| null | yes | — |
| `amount` | string | yes | (pattern `^\d+$`) |
| `settlement` | [CheckoutSettlement](#checkoutsettlement) | yes | — |
| `description` | string \| null | yes | — |
| `createdAt` | string (date-time) | yes | — |
| `dueAt` | string \| null | yes | — |
| `paidAt` | string \| null | yes | — |
| `url` | string (uri) | yes | Hosted invoice page (pay here). |
| `receiptUrl` | string \| null | yes | — |

### BillingSubscription

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |
| `plan` | string \| null | yes | — |
| `status` | `"active"` \| `"past_due"` \| `"paused"` | yes | — |
| `startsAt` | string \| null | yes | Set while the subscription starts in the future. |
| `currentPeriodEnd` | string \| null | yes | — |
| `nextInvoiceAt` | string \| null | yes | — |

### Billing

| Field | Type | Required | Description |
|---|---|---|---|
| `plan` | [Plan](#plan) | yes | — |
| `status` | [PlanStatus](#planstatus) | yes | — |
| `periodEnd` | string \| null | yes | — |
| `expiresAt` | string \| null | yes | — |
| `subscription` | [BillingSubscription](#billingsubscription) \| null | yes | — |
| `pendingInvoice` | [BillingInvoice](#billinginvoice) \| null | yes | — |
| `usage` | [PlanUsage](#planusage) | yes | — |
| `plans` | [Plan](#plan)[] | yes | — |
| `invoices` | [BillingInvoice](#billinginvoice)[] | yes | — |

### BillingSubscribeRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `plan` | string | yes | A paid plan id (`pro`, `scale`). |
| `email` | string (email) | no | Required when the account has no email yet. |

### BillingSubscribeResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `subscription` | object | yes | — |
| `subscription.id` | string | yes | — |
| `subscription.plan` | string \| null | yes | — |
| `subscription.status` | string | yes | — |
| `subscription.startsAt` | string (date-time) | yes | — |
| `invoice` | [BillingInvoice](#billinginvoice) \| null | yes | The invoice to pay now (null when the plan starts later). |
| `billing` | [Billing](#billing) | yes | — |

### CheckoutSessionList

| Field | Type | Required | Description |
|---|---|---|---|
| `sessions` | [CheckoutSession](#checkoutsession)[] | yes | — |
| `nextCursor` | string \| null | yes | — |

### CheckoutQuoteRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `srcChain` | string | yes | The chain the payer pays from (id or slug); `tron` where the API runs with Tron enabled. |
| `srcToken` | string | yes | Token address / mint, curated symbol or native symbol. |
| `sender` | string | yes | The payer's address on `srcChain` (a base58 T-address on Tron). |
| `slippageBps` | integer | no | (default `50`) (1–500) |

### CheckoutQuote

| Field | Type | Required | Description |
|---|---|---|---|
| `quoteId` | string | yes | Pass to `POST /v1/orders`. |
| `provider` | [ProviderId](#providerid) | yes | — |
| `srcAmount` | string | yes | What the payer sends, base units of `srcToken`. (pattern `^\d+$`) |
| `dstAmount` | string | yes | (pattern `^\d+$`) |
| `dstAmountMin` | string | yes | Guaranteed delivery to the recipient; always >= the amount due. (pattern `^\d+$`) |
| `estimatedSeconds` | integer | yes | — |
| `fees` | [FeeBreakdown](#feebreakdown) | yes | — |
| `expiresAt` | integer | yes | — |

### CheckoutQuoteResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `sessionId` | string | yes | — |
| `livemode` | boolean | yes | — |
| `amountDue` | string | yes | (pattern `^\d+$`) |
| `best` | [CheckoutQuote](#checkoutquote) | yes | — |
| `quotes` | [CheckoutQuote](#checkoutquote)[] | yes | — |
| `errors` | [ProviderError](#providererror)[] | yes | — |
| `screening` | [ScreeningAnnotation](#screeningannotation) | no | — |

### CheckoutProductCreateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | — |
| `description` | string \| null | no | — |
| `merchantName` | string \| null | no | — |
| `amount` | string | yes | Price in base units of the settlement token. (pattern `^\d+$`) |
| `settleChain` | string | yes | — |
| `settleToken` | string | yes | `USDC` or `USDT` (or its address). |
| `recipient` | string | yes | Your payout address on the settlement chain. |
| `successUrl` | string \| null | no | — |
| `cancelUrl` | string \| null | no | — |
| `expiresInMinutes` | integer | no | Lifetime of each session started from the product. (default `60`) (5–10080) |
| `allowedOrigins` | string[] | no | https origins allowed to start sessions from a browser; empty = any. |
| `active` | boolean | no | (default `true`) |

### CheckoutProduct

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^prod_`) |
| `object` | `"checkout.product"` | yes | — |
| `livemode` | boolean | yes | — |
| `active` | boolean | yes | — |
| `name` | string | yes | — |
| `description` | string \| null | no | — |
| `merchantName` | string \| null | no | — |
| `amount` | string | yes | (pattern `^\d+$`) |
| `settlement` | [CheckoutSettlement](#checkoutsettlement) | yes | — |
| `url` | string (uri) | yes | `https://layerhop.com/buy/{id}`: starts a session and opens the payment page. |
| `recipient` | string | no | Owner only. |
| `successUrl` | string \| null | no | Owner only. |
| `cancelUrl` | string \| null | no | Owner only. |
| `expiresInMinutes` | integer | no | Owner only. |
| `allowedOrigins` | string[] | no | Owner only. |
| `createdAt` | string (date-time) | no | — |
| `updatedAt` | string (date-time) | no | — |

### InvoiceStatus

`draft` (editable, invisible to the customer), `open` (sent, waiting for payment), `paid`
(its checkout session was paid), `void` (cancelled).

`string`, one of:

- `draft`
- `open`
- `paid`
- `void`

### InvoiceLineItem

| Field | Type | Required | Description |
|---|---|---|---|
| `description` | string | yes | (min length 1) |
| `quantity` | integer | yes | (1–10000) |
| `unitAmount` | string | yes | Price of one unit in base units of the settlement token. (pattern `^\d+$`) |

### InvoiceCreateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `customerEmail` | string \| null | no | Where the invoice and the receipt are emailed. Without it, share the hosted `url` yourself. |
| `customerName` | string \| null | no | — |
| `merchantName` | string \| null | no | Shown on the invoice and in emails. |
| `memo` | string \| null | no | A note to the customer. |
| `lineItems` | [InvoiceLineItem](#invoicelineitem)[] | yes | (min items 1) |
| `settleChain` | string | yes | Settlement chain id or slug: ethereum, arbitrum, base, optimism, bsc, polygon or solana. |
| `settleToken` | string | yes | `USDC` or `USDT` (or its address) on that chain. |
| `recipient` | string | yes | Your payout address on the settlement chain. |
| `dueAt` | string \| null | no | Due date: `YYYY-MM-DD` (end of that day, UTC) or an ISO 8601 timestamp. Informational; the invoice stays payable. |
| `send` | boolean | no | Finalize and email it right away (as `POST /v1/invoices/{id}/send`). (default `false`) |

### InvoiceUpdateRequest

Any `InvoiceCreateRequest` field except `send`; all optional. Drafts only.

| Field | Type | Required | Description |
|---|---|---|---|
| `customerEmail` | string \| null | no | — |
| `customerName` | string \| null | no | — |
| `merchantName` | string \| null | no | — |
| `memo` | string \| null | no | — |
| `lineItems` | [InvoiceLineItem](#invoicelineitem)[] | no | — |
| `settleChain` | string | no | — |
| `settleToken` | string | no | — |
| `recipient` | string | no | — |
| `dueAt` | string \| null | no | — |

### PublicInvoice

The customer's view of an invoice.

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^inv_`) |
| `object` | `"invoice"` | yes | — |
| `livemode` | boolean | yes | — |
| `number` | string | yes | Sequential per account and mode: `INV-0001`, `INV-0002`, … |
| `status` | [InvoiceStatus](#invoicestatus) | yes | — |
| `merchantName` | string \| null | no | — |
| `customerName` | string \| null | no | — |
| `memo` | string \| null | no | — |
| `lineItems` | [InvoiceLineItem](#invoicelineitem)[] | yes | — |
| `amount` | string | yes | Total: the sum of `quantity × unitAmount`, in base units of the settlement token. (pattern `^\d+$`) |
| `settlement` | [CheckoutSettlement](#checkoutsettlement) | yes | — |
| `dueAt` | string \| null | no | — |
| `paidAt` | string \| null | no | — |
| `url` | string (uri) | yes | The hosted invoice page, `https://layerhop.com/invoice/{id}`. |
| `receiptUrl` | string \| null | no | The PDF receipt once `paid`. |
| `createdAt` | string (date-time) | yes | — |

### Invoice

An invoice as its owner sees it.

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^inv_`) |
| `object` | `"invoice"` | yes | — |
| `livemode` | boolean | yes | — |
| `number` | string | yes | Sequential per account and mode: `INV-0001`, `INV-0002`, … |
| `status` | [InvoiceStatus](#invoicestatus) | yes | — |
| `merchantName` | string \| null | no | — |
| `customerName` | string \| null | no | — |
| `memo` | string \| null | no | — |
| `lineItems` | [InvoiceLineItem](#invoicelineitem)[] | yes | — |
| `amount` | string | yes | Total: the sum of `quantity × unitAmount`, in base units of the settlement token. (pattern `^\d+$`) |
| `settlement` | [CheckoutSettlement](#checkoutsettlement) | yes | — |
| `dueAt` | string \| null | no | — |
| `paidAt` | string \| null | no | — |
| `url` | string (uri) | yes | The hosted invoice page, `https://layerhop.com/invoice/{id}`. |
| `receiptUrl` | string \| null | no | The PDF receipt once `paid`. |
| `createdAt` | string (date-time) | yes | — |
| `customerEmail` | string \| null | no | — |
| `recipient` | string | yes | Your payout address. |
| `sessionId` | string \| null | no | The latest checkout session started to pay it. |
| `subscriptionId` | string \| null | no | The subscription it bills a period of. |
| `sentAt` | string \| null | no | — |
| `receiptSentAt` | string \| null | no | — |
| `voidedAt` | string \| null | no | — |
| `updatedAt` | string (date-time) | yes | — |

### InvoiceList

| Field | Type | Required | Description |
|---|---|---|---|
| `invoices` | [Invoice](#invoice)[] | yes | — |
| `nextCursor` | string \| null | yes | — |

### InvoicePayResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `sessionId` | string | yes | — |
| `url` | string (uri) | yes | The hosted checkout page. |

### SubscriptionStatus

`active` (billing each period), `past_due` (an invoice is unpaid past its due date; reminders
are being sent and renewals wait), `paused` (no invoices or reminders), `canceled` (for good:
by you, or after 7 days past due).

`string`, one of:

- `active`
- `past_due`
- `canceled`
- `paused`

### SubscriptionInterval

The billing period unit. Months and years keep the start's day of month (clamped to short months).

`string`, one of:

- `day`
- `week`
- `month`
- `year`

### SubscriptionCreateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `customerEmail` | string (email) | yes | Where each period's invoice and the reminders are emailed. |
| `customerName` | string \| null | no | — |
| `merchantName` | string \| null | no | Shown on invoices and in emails (default: the product's). |
| `description` | string | no | The invoice line item, e.g. `Pro plan`; each invoice adds the period's dates. Required without `productId` (default: the product's name). (min length 1) |
| `memo` | string \| null | no | A note on every invoice. |
| `productId` | string | no | Bill this product's price, settlement token and payout address. Not with `amount`, `settleChain`, `settleToken` or `recipient`. |
| `amount` | string | no | Price per period in base units of the settlement token. (pattern `^\d+$`) |
| `settleChain` | string | no | Settlement chain id or slug: ethereum, arbitrum, base, optimism, bsc, polygon or solana. |
| `settleToken` | string | no | `USDC` or `USDT` (or its address) on that chain. |
| `recipient` | string | no | Your payout address on the settlement chain. |
| `interval` | [SubscriptionInterval](#subscriptioninterval) | yes | — |
| `intervalCount` | integer | no | Bill every `intervalCount` intervals (e.g. 3 + `month` = quarterly). (default `1`) (1–365) |
| `daysUntilDue` | integer | no | Days after an invoice is issued that it is due. (default `3`) (0–60) |
| `startAt` | string (date-time) | no | When the first period starts and its invoice is issued (default: now; at most 366 days ahead). |
| `metadata` | object \| null | no | Up to 20 keys, returned in the API and webhooks. |

### SubscriptionUpdateRequest

All optional; changes apply from the next invoice. `null` clears an optional field.

| Field | Type | Required | Description |
|---|---|---|---|
| `customerEmail` | string (email) | no | — |
| `customerName` | string \| null | no | — |
| `merchantName` | string \| null | no | — |
| `description` | string | no | — |
| `memo` | string \| null | no | — |
| `amount` | string | no | (pattern `^\d+$`) |
| `daysUntilDue` | integer | no | (0–60) |
| `metadata` | object \| null | no | — |
| `cancelAtPeriodEnd` | boolean | no | `true` schedules a cancel at the end of the current period; `false` undoes it. |

### SubscriptionCancelRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `atPeriodEnd` | boolean | no | Cancel at the end of the current period instead of now. (default `false`) |

### Subscription

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^sub_`) |
| `object` | `"subscription"` | yes | — |
| `livemode` | boolean | yes | — |
| `status` | [SubscriptionStatus](#subscriptionstatus) | yes | — |
| `customerEmail` | string | yes | — |
| `customerName` | string \| null | no | — |
| `merchantName` | string \| null | no | — |
| `description` | string | yes | — |
| `memo` | string \| null | no | — |
| `productId` | string \| null | no | — |
| `amount` | string | yes | Price per period in base units of the settlement token. (pattern `^\d+$`) |
| `settlement` | [CheckoutSettlement](#checkoutsettlement) | yes | — |
| `recipient` | string | yes | Your payout address. |
| `interval` | [SubscriptionInterval](#subscriptioninterval) | yes | — |
| `intervalCount` | integer | yes | — |
| `daysUntilDue` | integer | yes | — |
| `currentPeriodStart` | string \| null | no | Start of the period last invoiced (null before the first invoice). |
| `currentPeriodEnd` | string \| null | no | — |
| `nextInvoiceAt` | string \| null | no | When the next invoice is issued (null when paused or canceled). |
| `cancelAt` | string \| null | no | Scheduled cancel (the end of the current period). |
| `cancelAtPeriodEnd` | boolean | yes | — |
| `canceledAt` | string \| null | no | — |
| `cancellationReason` | string \| null | no | `requested` (you canceled) or `unpaid` (past due for 7 days). |
| `pausedAt` | string \| null | no | — |
| `latestInvoiceId` | string \| null | no | The invoice of the current period. |
| `metadata` | object \| null | no | — |
| `createdAt` | string (date-time) | yes | — |
| `updatedAt` | string (date-time) | yes | — |

### SubscriptionList

| Field | Type | Required | Description |
|---|---|---|---|
| `subscriptions` | [Subscription](#subscription)[] | yes | — |
| `nextCursor` | string \| null | yes | — |

### SubscriptionInvoiceList

| Field | Type | Required | Description |
|---|---|---|---|
| `invoices` | [Invoice](#invoice)[] | yes | — |

### SwapDepositCreateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `srcChain` | string | yes | Chain the deposit is sent on (slug or id). |
| `srcToken` | string | yes | Token to send (symbol or address). |
| `dstChain` | string | yes | — |
| `dstToken` | string | yes | — |
| `amount` | string | yes | Exact amount of `srcToken` to send, in base units. (pattern `^[1-9]\d*$`) |
| `recipient` | string | yes | Address on `dstChain` that receives `dstToken`. |
| `refundTo` | string | yes | Address on `srcChain` that gets the deposit back if the swap can't complete. |

### SwapDeposit

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |
| `object` | `"swap_deposit"` | yes | — |
| `state` | `"waiting"` \| `"received"` \| `"filled"` \| `"refunded"` \| `"failed"` \| `"expired"` | yes | — |
| `address` | string | yes | The one-time address to send `amount` of `token` to, on `chainId`. |
| `chainId` | integer | yes | — |
| `token` | string | yes | — |
| `amount` | string | yes | — |
| `dstChainId` | integer | yes | — |
| `dstToken` | string | yes | — |
| `recipient` | string | yes | — |
| `refundTo` | string | yes | — |
| `feeBps` | integer | yes | — |
| `srcTxHash` | string \| null | yes | — |
| `dstTxHash` | string \| null | yes | — |
| `createdAt` | string (date-time) | yes | — |
| `expiresAt` | string (date-time) | yes | — |

### SwapDepositCreated

Type: object

### DepositAddressStatus

`active`: deposits are detected and become orders. `disabled`: no longer tracked.

`string`, one of:

- `active`
- `disabled`

### DepositAddressCreateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `srcChain` | string | yes | Chain id or slug your user deposits on. |
| `srcToken` | string | yes | The token to deposit: address / mint, curated symbol or native symbol. Other tokens sent to the address may be unrecoverable. |
| `dstChain` | string | yes | Chain id or slug to deliver on. |
| `dstToken` | string | yes | The token to deliver. |
| `recipient` | string | yes | Receives `dstToken` on `dstChain`. |
| `refundTo` | string | yes | Your user's address on `srcChain` for refunds. Never an exchange (CEX) deposit address. |
| `reusable` | boolean | no | true: reusable for this route with any amount (each deposit is a separate order). false: one-time, exactly `amount`. (default `true`) |
| `amount` | string | no | Base units of `srcToken`. Required when `reusable` is false; otherwise only sizes the `estimate` (default about $100). At least $1. (pattern `^[1-9]\d*$`) |
| `label` | string | no | Your reference (e.g. a user id); filter the list by it. (min length 1) |
| `metadata` | object | no | Up to 20 string key-value pairs. |
| `integrator` | string | no | Partner id whose fee applies, as for `GET /v1/quote`. |
| `integratorFeeBps` | integer | no | Partner fee in bps (capped by the partner's maximum), as for `GET /v1/quote`. (0–10000) |

### DepositAddressFees

| Field | Type | Required | Description |
|---|---|---|---|
| `ourFeeBps` | integer | yes | LayerHop's fee (the API channel fee). |
| `integratorFeeBps` | integer | yes | The partner fee. |
| `integrator` | string \| null | no | The partner the fee is paid to. |

### DepositAddress

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^da_`) |
| `object` | `"deposit_address"` | yes | — |
| `livemode` | boolean | yes | false for a test-mode address (an `lh_test_` key). |
| `status` | [DepositAddressStatus](#depositaddressstatus) | yes | — |
| `provider` | `"relay"` \| `"sandbox"` | yes | Who owns the address: `relay` (live) or `sandbox` (test mode, a fake address). |
| `address` | string | yes | Where your user sends `token` on `chainId`. |
| `chainId` | integer | yes | The source chain. |
| `token` | string | yes | The token to deposit (address or mint). |
| `dstChainId` | integer | yes | — |
| `dstToken` | string | yes | — |
| `recipient` | string | yes | — |
| `refundTo` | string | yes | — |
| `reusable` | boolean | yes | — |
| `amount` | string \| null | no | The exact amount a one-time address expects; null when reusable. (pattern `^\d+$`) |
| `fees` | [DepositAddressFees](#depositaddressfees) | yes | — |
| `label` | string \| null | no | — |
| `metadata` | object \| null | no | — |
| `depositCount` | integer | yes | Deposits detected so far. |
| `lastDepositAt` | string \| null | no | — |
| `createdAt` | string (date-time) | yes | — |

### DepositEstimate

| Field | Type | Required | Description |
|---|---|---|---|
| `amount` | string | yes | The deposit amount the estimate is for. (pattern `^\d+$`) |
| `dstAmount` | string | yes | Expected output in base units of `dstToken`. (pattern `^\d+$`) |
| `dstAmountMin` | string | yes | Minimum output after slippage. (pattern `^\d+$`) |
| `estimatedSeconds` | integer | yes | — |

### DepositAddressCreated

`DepositAddress` plus an `estimate` (create only).

| Field | Type | Required | Description |
|---|---|---|---|
| `estimate` | [DepositEstimate](#depositestimate) | yes | — |

### DepositAddressWithDeposits

`DepositAddress` plus its 20 most recent `deposits` (orders whose `quoteId` starts with `dep_`), newest first.

| Field | Type | Required | Description |
|---|---|---|---|
| `deposits` | [AccountOrder](#accountorder)[] | yes | — |

### DepositAddressList

| Field | Type | Required | Description |
|---|---|---|---|
| `depositAddresses` | [DepositAddress](#depositaddress)[] | yes | — |
| `nextCursor` | string \| null | yes | — |

### SimulateDepositRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `amount` | string | yes | Base units of the address's token. Ends in `4001` → refunded, `4002` → failed, anything else fills. (pattern `^[1-9]\d*$`) |

### LimitOrderStatus

`built` (transaction built, not submitted yet), `open` (live on chain, may be partly filled),
`filled` (fully filled), `cancelled` (cancelled by the wallet; unfilled input returned),
`expired` (reached `expiresAt`), `failed` (the order transaction never showed up on chain).

`string`, one of:

- `built`
- `open`
- `filled`
- `cancelled`
- `expired`
- `failed`

### LimitOrderCreateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `chain` | string | no | `solana` (or `7565164`), or an EVM chain with CoW Protocol: `ethereum`, `arbitrum`, `base`, `bsc`, `polygon`, `avalanche`, `gnosis`, `linea`, `plasma`, `ink` (slug or id). (default `"solana"`) |
| `wallet` | string | yes | The maker wallet (base58 on Solana, 0x on EVM). It signs the order and receives the output. |
| `srcToken` | string | yes | Token to sell: address / mint or curated symbol (`USDC`, `SOL`). EVM: an ERC-20 (not the native coin). |
| `dstToken` | string | yes | Token to buy. Solana: the fee applies when it is SOL, USDC or USDT. EVM: any token, the native coin included. |
| `amount` | string | yes | Base units of `srcToken` to sell (worth at least $5). (pattern `^[1-9]\d*$`) |
| `dstAmount` | string | yes | Minimum base units of `dstToken` for the whole `amount`; sets the limit price. (pattern `^[1-9]\d*$`) |
| `expiresAt` | integer | no | Unix seconds, at least 60 s from now. Solana: omit for good-till-cancelled. EVM: at most 365 days ahead, default 90 days. |
| `channel` | [FeeChannel](#feechannel) | no | — |
| `metadata` | object | no | Up to 20 string key-value pairs. |
| `integrator` | string | no | Partner id whose fee applies, as for `GET /v1/quote`. |
| `integratorFeeBps` | integer | no | Partner fee in bps (capped by the partner's maximum), as for `GET /v1/quote`. (0–10000) |

### LimitOrderFees

| Field | Type | Required | Description |
|---|---|---|---|
| `ourFeeBps` | integer | yes | LayerHop's fee written into the order (Solana: 0 when `dstToken` has no fee account). |
| `integratorFeeBps` | integer | yes | The partner fee written into the order. |
| `integrator` | string \| null | no | The partner the fee is paid to. |

### RecurringOrderCreateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `chain` | string | no | Only `solana` (the default). |
| `wallet` | string | yes | The Solana wallet that funds, signs and owns the order. |
| `srcToken` | string | no | Token spent: mint or symbol. Default `USDC`. |
| `dstToken` | string | yes | Token bought: mint or symbol. |
| `amount` | string | yes | The whole budget in base units of `srcToken`, deposited when the order opens. (pattern `^[1-9]\d*$`) |
| `orders` | integer | yes | Number of buys; each spends `amount / orders`. (2–1000) |
| `intervalSeconds` | integer | yes | Seconds between buys (86400 = daily, 604800 = weekly). (60–31536000) |

### RecurringOrderBuild

| Field | Type | Required | Description |
|---|---|---|---|
| `object` | `"recurring_order_build"` | yes | — |
| `livemode` | boolean | yes | — |
| `provider` | `"jupiter"` \| `"sandbox"` | yes | — |
| `chainId` | integer | yes | Always `7565164` (Solana). |
| `wallet` | string | yes | — |
| `srcToken` | string | yes | Mint spent. |
| `dstToken` | string | yes | Mint bought. |
| `amount` | string | yes | Budget in base units. (pattern `^\d+$`) |
| `amountPerOrder` | string | yes | Spent per buy (`amount / orders`, rounded down). (pattern `^\d+$`) |
| `orders` | integer | yes | — |
| `intervalSeconds` | integer | yes | — |
| `fees` | object | yes | Always 0: Jupiter Recurring lets integrators charge no fee. |
| `fees.ourFeeBps` | `0` | yes | — |
| `fees.integratorFeeBps` | `0` | yes | — |
| `requestId` | string | yes | Send it back with the signed transaction. |
| `tx` | [SvmTx](#svmtx) | yes | — |

### RecurringOrderFill

| Field | Type | Required | Description |
|---|---|---|---|
| `txHash` | string | yes | — |
| `amount` | string | yes | Spent in this buy, base units. (pattern `^\d+$`) |
| `dstAmount` | string | yes | Bought, base units. (pattern `^\d+$`) |
| `feeAmount` | string | yes | Jupiter's fee, base units of `feeToken`. (pattern `^\d+$`) |
| `feeToken` | string \| null | yes | — |
| `filledAt` | string \| null | yes | — |

### RecurringOrder

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | The order account. |
| `object` | `"recurring_order"` | yes | — |
| `provider` | `"jupiter"` | yes | — |
| `chainId` | integer | yes | — |
| `status` | `"active"` \| `"completed"` \| `"cancelled"` | yes | — |
| `wallet` | string | yes | — |
| `srcToken` | string | yes | — |
| `dstToken` | string | yes | — |
| `amount` | string | yes | Budget deposited, base units. (pattern `^\d+$`) |
| `amountPerOrder` | string | yes | (pattern `^\d+$`) |
| `orders` | integer | yes | Number of buys the budget covers. |
| `ordersFilled` | integer | yes | — |
| `intervalSeconds` | integer | yes | — |
| `spentAmount` | string | yes | Budget spent on buys so far. (pattern `^\d+$`) |
| `withdrawnAmount` | string | yes | Budget returned to the wallet (cancel). (pattern `^\d+$`) |
| `receivedAmount` | string | yes | Bought so far, base units of `dstToken`. (pattern `^\d+$`) |
| `openTxHash` | string \| null | yes | — |
| `closeTxHash` | string \| null | yes | — |
| `createdAt` | string \| null | yes | — |
| `fills` | [RecurringOrderFill](#recurringorderfill)[] | yes | Up to 50 most recent buys. |

### RecurringOrderList

| Field | Type | Required | Description |
|---|---|---|---|
| `recurringOrders` | [RecurringOrder](#recurringorder)[] | yes | — |
| `page` | integer | yes | — |
| `totalPages` | integer | yes | — |

### RecurringOrderSubmitRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `requestId` | string | yes | — |
| `signedTransaction` | string | yes | The wallet-signed transaction, base64. |

### RecurringOrderSubmitResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `txHash` | string | yes | — |
| `order` | string \| null | yes | The order account (create). |

### RecurringOrderCancelRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `wallet` | string | yes | The wallet that owns the order. |

### RecurringOrderCancelResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `requestId` | string | yes | — |
| `tx` | [SvmTx](#svmtx) | yes | — |

### LimitOrder

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^lo_`) |
| `object` | `"limit_order"` | yes | — |
| `livemode` | boolean | yes | false for a test-mode order (an `lh_test_` key). |
| `status` | [LimitOrderStatus](#limitorderstatus) | yes | — |
| `statusDetail` | string \| null | no | — |
| `provider` | `"jupiter"` \| `"cow"` \| `"sandbox"` | yes | `jupiter` (Solana), `cow` (EVM, CoW Protocol) or `sandbox` (test mode). |
| `chainId` | integer | yes | `7565164` (Solana) or the EVM chain id. |
| `wallet` | string | yes | The maker wallet (EVM addresses lower-case). |
| `srcToken` | string | yes | Token sold (mint or address). |
| `dstToken` | string | yes | Token bought (mint or address; the EVM native coin is the zero address). |
| `amount` | string | yes | Input in base units. (pattern `^\d+$`) |
| `dstAmount` | string | yes | Minimum output for the whole order in base units. (pattern `^\d+$`) |
| `expiresAt` | string \| null | no | — |
| `fees` | [LimitOrderFees](#limitorderfees) | yes | — |
| `providerOrderId` | string | yes | The provider's order id (Jupiter: the order account; CoW: the 56-byte order UID, known before signing). |
| `filledAmount` | string | yes | Input filled so far. (pattern `^\d+$`) |
| `filledDstAmount` | string | yes | Output received so far. (pattern `^\d+$`) |
| `fillCount` | integer | yes | — |
| `openTxHash` | string \| null | no | The transaction that opened the order (Solana; EVM orders are off chain: null). |
| `cancelTxHash` | string \| null | no | Solana: the cancel transaction, once submitted (the order turns `cancelled` once confirmed). EVM: always null; a sent cancellation shows as `statusDetail: "cancel requested"`. |
| `channel` | [FeeChannel](#feechannel) | yes | — |
| `metadata` | object \| null | no | — |
| `createdAt` | string (date-time) | yes | — |
| `updatedAt` | string (date-time) | yes | — |

### LimitOrderCreated

`LimitOrder` plus what the wallet signs (create only): `tx` on Solana; `typedData`, `appData` and `approval` on EVM.

| Field | Type | Required | Description |
|---|---|---|---|
| `tx` | [SvmTx](#svmtx) \| null | yes | Solana: the unsigned create transaction. EVM: null (sign `typedData`). |
| `typedData` | [Eip712TypedData](#eip712typeddata) | no | EVM only: the CoW Protocol order as EIP-712 typed data (domain `Gnosis Protocol` v2, verifying contract GPv2Settlement `0x9008D19f58AAbD9eD0D60971565AA8510560ab41`). Sign it unchanged with `eth_signTypedData_v4`. |
| `appData` | string | no | EVM only: the order's full appData JSON; `typedData.message.appData` is its keccak256. Carries `metadata.partnerFee` = `{ recipient, volumeBps }` (LayerHop's fee recipient and `fees.ourFeeBps + fees.integratorFeeBps`) and nothing else of value. |
| `approval` | object | no | EVM only: the ERC-20 allowance the order needs, to CoW's vault relayer (`0xC92E8bdf79f0507f65a392b0ab4667716BFE0110`) only. Approve this exact amount plus the unfilled amounts of the wallet's other open orders of the same token, if the allowance is short. |
| `approval.token` | string | yes | — |
| `approval.spender` | string | yes | — |
| `approval.amount` | string | yes | (pattern `^\d+$`) |
| `sandbox` | `true` | no | EVM test mode: the order is never sent to CoW Protocol. |

### LimitOrderWithFills

`LimitOrder` plus its `fills` (orders whose `quoteId` starts with `lof_`), newest first.

| Field | Type | Required | Description |
|---|---|---|---|
| `fills` | [OrderSummary](#ordersummary)[] | yes | — |

### LimitOrderList

| Field | Type | Required | Description |
|---|---|---|---|
| `limitOrders` | [LimitOrder](#limitorder)[] | yes | — |
| `nextCursor` | string \| null | yes | — |

### LimitOrderSubmitRequest

`signedTransaction` for Solana orders, `signature` for EVM orders.

| Field | Type | Required | Description |
|---|---|---|---|
| `signedTransaction` | string | no | Solana: the wallet-signed transaction (base64). (base64) |
| `signature` | string | no | EVM: the wallet's 65-byte `eth_signTypedData_v4` signature of the order's (or cancellation's) `typedData`. (pattern `^0x[0-9a-fA-F]{130}$`) |

### LimitOrderSubmitResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `limitOrder` | [LimitOrder](#limitorder) | yes | — |
| `txHash` | string \| null | yes | Solana: the landed transaction's signature. EVM: null (orders and cancellations are off chain). |

### LimitOrderCancelResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `limitOrder` | [LimitOrder](#limitorder) | yes | — |
| `tx` | [SvmTx](#svmtx) \| null | yes | Solana: the unsigned cancel transaction (`submitViaApi: true`). Null for EVM orders and when a `built` order was cancelled directly. |
| `typedData` | [Eip712TypedData](#eip712typeddata) | no | EVM `open` orders only: the off-chain cancellation (`OrderCancellations` with exactly this order's UID) to sign and submit as `signature`. |

### LimitOrderSimulateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `outcome` | `"fill"` \| `"partial_fill"` \| `"expire"` | yes | `fill` the rest · `partial_fill` half of the rest · `expire`. |

### RefundStatus

`pending` (created; waiting for you to sign and report the transaction), `submitted` (reported,
being tracked), `completed` (delivered to the payer; added to the session's `refundedAmount`),
`failed` (the transfer failed; nothing was refunded).

`string`, one of:

- `pending`
- `submitted`
- `completed`
- `failed`

### RefundCreateRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `amount` | string | no | Base units of the settlement token. Default: everything not yet refunded. (pattern `^\d+$`) |
| `reason` | string | no | For your records; included in the webhook. |
| `from` | string | no | The wallet that sends the refund. Default: the session's payout address. |
| `to` | `"original"` \| `"settlement"` | no | `original`: the payer's original chain and token. `settlement`: the settlement token on the settlement chain (same chain family only). (default `"original"`) |

### Refund

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^re_`) |
| `object` | `"refund"` | yes | — |
| `sessionId` | string | yes | — |
| `livemode` | boolean | yes | — |
| `status` | [RefundStatus](#refundstatus) | yes | — |
| `statusDetail` | string \| null | no | — |
| `amount` | string | yes | Base units of the settlement token. (pattern `^\d+$`) |
| `reason` | string \| null | no | — |
| `quoteId` | string \| null | no | The refund's order: build and report it through `POST /v1/orders`. |
| `to` | object | yes | — |
| `to.chainId` | integer | yes | — |
| `to.token` | string | yes | — |
| `to.address` | string | yes | The payer's address. |
| `txHash` | string \| null | no | The refund transaction once reported. |
| `createdAt` | string (date-time) | yes | — |
| `updatedAt` | string (date-time) | yes | — |

### RefundCreateResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `refund` | [Refund](#refund) | yes | — |
| `quote` | object | yes | — |
| `quote.quoteId` | string | yes | Pass to `POST /v1/orders`, then `POST /v1/orders/{quoteId}/submitted`. |
| `quote.provider` | [ProviderId](#providerid) | yes | — |
| `quote.srcAmount` | string | yes | What you send (settlement token). (pattern `^\d+$`) |
| `quote.dstAmount` | string | yes | What the payer is quoted to receive. (pattern `^\d+$`) |
| `quote.dstAmountMin` | string | yes | (pattern `^\d+$`) |
| `quote.estimatedSeconds` | integer | yes | — |
| `quote.expiresAt` | integer | yes | Unix seconds. |
| `quote.from` | string | yes | The wallet that must sign. |
| `next` | string | yes | The remaining steps. |

### RefundList

| Field | Type | Required | Description |
|---|---|---|---|
| `refunds` | [Refund](#refund)[] | yes | — |

### CheckoutAnalytics

| Field | Type | Required | Description |
|---|---|---|---|
| `livemode` | boolean | yes | — |
| `from` | string (date-time) | yes | — |
| `to` | string (date-time) | yes | — |
| `totals` | object | yes | — |
| `totals.sessions` | integer | yes | Sessions created in the range. |
| `totals.payments` | integer | yes | Of those, `paid`. |
| `totals.grossUsd` | number | yes | — |
| `totals.refundedUsd` | number | yes | — |
| `totals.netUsd` | number | yes | Gross minus refunded. |
| `totals.averageUsd` | number | yes | Average payment. |
| `totals.conversionRate` | number \| null | no | Percent of sessions paid (one decimal). |
| `totals.medianSecondsToPay` | integer \| null | no | From session creation to payment. |
| `totals.averageSecondsToPay` | integer \| null | no | — |
| `byDay` | object[] | yes | Every UTC day of the range. |
| `byPaidWith` | object[] | yes | What customers paid with, highest revenue first. |
| `bySettlement` | object[] | yes | What you received, highest revenue first. |

### ComponentStatus

`operational`, `degraded` (the latest probe failed) or `down` (an open incident).

`string`, one of:

- `operational`
- `degraded`
- `down`

### StatusComponent

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | `api`, `web`, `worker`, `checkout`, `dashboard`, `docs`, `mcp`, `bot` or `provider:{id}`. |
| `name` | string | yes | — |
| `group` | string | yes | `Core`, `Payments`, `Developer tools` or `Liquidity providers`. |
| `status` | [ComponentStatus](#componentstatus) | yes | — |
| `latencyMs` | integer \| null | yes | Latest probe (last 15 minutes). |
| `uptime90d` | number \| null | yes | Percent of successful probes over 90 days. |
| `days` | object[] | yes | The last 90 UTC days, oldest first. |

### StatusIncident

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |
| `componentId` | string | yes | — |
| `component` | string | yes | — |
| `title` | string | yes | — |
| `startedAt` | string (date-time) | yes | — |
| `resolvedAt` | string \| null | yes | — |

### StatusResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `status` | `"operational"` \| `"degraded"` \| `"outage"` | yes | — |
| `updatedAt` | string (date-time) | yes | — |
| `components` | [StatusComponent](#statuscomponent)[] | yes | — |
| `incidents` | [StatusIncident](#statusincident)[] | yes | Incidents started in the last 14 days, newest first. |
| `url` | string (uri) | yes | The status page. |

### RecoverChain

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | The L2 the withdrawal starts on. |
| `slug` | string | no | — |
| `name` | string | yes | — |
| `bridge` | `"arbitrum"` \| `"op-stack"` | yes | — |
| `bridgeName` | string | yes | Bridge UI that can also finish withdrawals (Arbitrum Bridge, Superbridge). |
| `bridgeUrl` | string (uri) | yes | — |
| `challengeSeconds` | number | yes | Usual wait before the claim (seconds). |
| `history` | `"full"` \| `"recent"` | yes | `recent`: an address scan reaches only about two days back. |
| `steps` | string[] | yes | — |

### StuckWithdrawal

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | `<l2ChainId>:<l2TxHash>:<n>`; n is the withdrawal's index in that transaction (`index` of `GET /v1/recover/claim`). |
| `bridge` | `"arbitrum"` \| `"op-stack"` | yes | — |
| `chainId` | integer | yes | — |
| `l2TxHash` | string | yes | — |
| `initiatedAt` | integer | no | Unix seconds. |
| `from` | string | no | — |
| `to` | string | yes | Who receives the funds on Ethereum. |
| `token` | object | yes | — |
| `token.address` | string | yes | Token on Ethereum; `0x0000…0000` for ETH. |
| `token.symbol` | string | no | — |
| `token.decimals` | integer | no | — |
| `amount` | string | yes | Base units. (pattern `^\d+$`) |
| `state` | `"waiting"` \| `"ready_to_prove"` \| `"ready"` \| `"prove_elsewhere"` \| `"claimed"` \| `"unknown"` | yes | `ready`: the final step can be sent now (`step`). `ready_to_prove`: OP Stack step 1 of 2. `waiting`: inside the challenge / proof window (`readyAt`). `prove_elsewhere`: needs a proof we don't build for this chain (super-root games); prove on `bridgeUrl`, finalize here later. `claimed`: done. `unknown`: couldn't read its state right now. |
| `step` | `"execute"` \| `"prove"` \| `"finalize"` | no | — |
| `readyAt` | integer | no | `waiting`: unix seconds when the next step opens. |
| `readyAtEstimated` | boolean | no | — |
| `bridgeName` | string | yes | — |
| `bridgeUrl` | string (uri) | yes | — |
| `note` | string | no | Plain-language detail for the user. |

### RecoverCoverage

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `name` | string | yes | — |
| `complete` | boolean | yes | false when only part of the history was scanned or the scan failed. |
| `fromBlock` | integer | no | First L2 block scanned. |
| `source` | `"rpc"` \| `"indexer"` | yes | — |
| `note` | string | no | — |
| `error` | boolean | no | The chain couldn't be scanned right now. |

### RecoverScan

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | — |
| `withdrawals` | [StuckWithdrawal](#stuckwithdrawal)[] | yes | — |
| `coverage` | [RecoverCoverage](#recovercoverage)[] | yes | — |
| `scannedAt` | integer | yes | — |

### RecoverClaim

| Field | Type | Required | Description |
|---|---|---|---|
| `withdrawal` | [StuckWithdrawal](#stuckwithdrawal) | yes | — |
| `step` | `"execute"` \| `"prove"` \| `"finalize"` | no | — |
| `tx` | [EvmTx](#evmtx) | no | — |
| `simulation` | object | no | — |
| `simulation.ok` | boolean | yes | — |
| `simulation.error` | string | no | — |

### TrackResult

| Field | Type | Required | Description |
|---|---|---|---|
| `txHash` | string | yes | — |
| `chainId` | integer | no | Source chain. |
| `source` | `"success"` \| `"reverted"` | no | The source transaction itself; `reverted` means nothing left the wallet. |
| `protocol` | object | no | — |
| `protocol.id` | `"layerhop"` \| `"relay"` \| `"lifi"` \| `"across"` \| `"debridge"` \| `"mayan"` \| `"layerzero"` \| `"cctp"` \| `"wormhole"` \| `"gaszip"` \| `"arbitrum-native"` \| `"op-native"` | yes | — |
| `protocol.name` | string | yes | — |
| `protocol.via` | string | no | The bridge an aggregator used, or the LayerZero app (`across`, `USD.AI`, `OFT`…). |
| `protocol.explorerUrl` | string (uri) | no | — |
| `protocol.supportUrl` | string (uri) | yes | — |
| `status` | `"pending"` \| `"filled"` \| `"refunded"` \| `"failed"` \| `"needs_claim"` \| `"unknown"` | yes | — |
| `dstChainId` | integer | no | — |
| `dstTxHash` | string | no | — |
| `refundTxHash` | string | no | — |
| `startedAt` | integer | no | Unix seconds. |
| `claimableAt` | integer | no | Native withdrawals waiting for their challenge window (unix seconds). |
| `typicalSeconds` | integer | no | — |
| `next` | object | yes | — |
| `next.kind` | `"done"` \| `"wait"` \| `"late"` \| `"claim"` \| `"refunded"` \| `"support"` \| `"source_failed"` \| `"not_found"` \| `"unrecognized"` | yes | — |
| `next.message` | string | yes | — |
| `next.url` | string (uri) | no | — |
| `next.label` | string | no | — |
| `layerhopProvider` | string | no | Set for LayerHop orders. |
| `sources` | string[] | yes | Status APIs that answered. |
| `checkedAt` | integer | yes | — |

### GasStationChain

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `name` | string | yes | — |
| `symbol` | string | yes | — |
| `decimals` | integer | yes | — |
| `inbound` | boolean | yes | Can pay from this chain. |
| `outbound` | boolean | yes | Can refuel this chain. |
| `minUsd` | number | yes | — |
| `maxUsd` | number | yes | — |
| `minDepositUsd` | number | no | — |
| `maxDepositUsd` | number | no | — |

### GasStationQuoteInput

| Field | Type | Required | Description |
|---|---|---|---|
| `srcChain` | string \| integer | yes | Chain to pay from (its native token). |
| `srcToken` | string | no | Optional; must be the native token. |
| `sender` | string | yes | The paying wallet. |
| `recipient` | string | no | Who receives the gas (default the sender). |
| `destinations` | object[] | yes | (min items 1) |

### GasStationQuote

| Field | Type | Required | Description |
|---|---|---|---|
| `provider` | `"gaszip"` | yes | — |
| `srcChainId` | integer | yes | — |
| `sender` | string | yes | — |
| `recipient` | string | yes | — |
| `depositWei` | string | yes | What the sender pays. (pattern `^\d+$`) |
| `depositUsd` | number | yes | — |
| `destinations` | object[] | yes | — |
| `fees` | object | yes | — |
| `fees.ourFeeBps` | integer | yes | — |
| `fees.providerFeeUsd` | number | yes | — |
| `tx` | [EvmTx](#evmtx) | yes | — |
| `simulation` | object | yes | — |
| `simulation.ok` | boolean | yes | — |
| `simulation.error` | string | no | — |
| `expiresAt` | integer | yes | — |

### GasRefuelStatus

| Field | Type | Required | Description |
|---|---|---|---|
| `status` | `"pending"` \| `"filled"` \| `"refunded"` \| `"failed"` \| `"unknown"` | yes | — |
| `outbound` | object[] | yes | — |

### FillStats

Live orders that reached an outcome in the window, with their sample size.

| Field | Type | Required | Description |
|---|---|---|---|
| `n` | integer | yes | Orders filled, refunded or failed. |
| `filled` | integer | yes | — |
| `successRate` | number \| null | yes | filled / n. |
| `medianFillSeconds` | integer \| null | yes | From building the transaction to the fill (includes signing time). |
| `p90FillSeconds` | integer \| null | yes | — |

### RouteState

`string`, one of:

- `ok`
- `failing`
- `unknown`

### BridgeStatus

| Field | Type | Required | Description |
|---|---|---|---|
| `status` | `"operational"` \| `"degraded"` \| `"outage"` \| `"unknown"` | yes | `unknown` when route checks are missing or stale. |
| `title` | string | yes | — |
| `generatedAt` | string (date-time) | yes | — |
| `windowDays` | integer | yes | — |
| `smallSample` | integer | yes | Below this many orders a figure is a small sample. |
| `routeHealth` | object | yes | — |
| `routeHealth.lastRunAt` | string \| null | yes | — |
| `routeHealth.intervalMinutes` | integer | yes | — |
| `routeHealth.stale` | boolean | yes | — |
| `counts` | object | yes | Chains per route health status. |
| `overall` | [FillStats](#fillstats) | yes | — |
| `allTime` | object | yes | All-time totals. Swaps are filled live orders through LayerHop; relayer fills are cross-chain orders that LayerHop's own relayer filled on-chain. |
| `allTime.since` | string \| null | yes | Time of the first counted transaction. |
| `allTime.swaps` | integer | yes | — |
| `allTime.swapVolumeUsd` | integer | yes | USD value of the filled swaps at quote time. |
| `allTime.relayerFills` | integer | yes | — |
| `allTime.relayerVolumeUsd` | integer | yes | USD value the relayer paid out in its fills. |
| `allTime.transactions` | integer | yes | `swaps` plus `relayerFills`. |
| `allTime.volumeUsd` | integer | yes | `swapVolumeUsd` plus `relayerVolumeUsd`. |
| `chains` | object[] | yes | — |
| `pairs` | object[] | yes | — |
| `providers` | object[] | yes | — |
| `incidents` | object[] | yes | — |

### NewChainsReport

| Field | Type | Required | Description |
|---|---|---|---|
| `days` | `30` \| `90` | yes | — |
| `generatedAt` | string (date-time) | yes | — |
| `trackingSince` | string \| null | yes | — |
| `chains` | object[] | yes | — |

### PriceGapPrice

| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | integer | yes | — |
| `slug` | string | yes | — |
| `chain` | string | yes | — |
| `address` | string | yes | — |
| `symbol` | string | yes | — |
| `decimals` | integer | yes | — |
| `priceUsd` | number | yes | — |
| `liquidityUsd` | number | yes | Liquidity of the pool the price comes from. |
| `pool` | string \| null | yes | — |

### PriceGapReport

| Field | Type | Required | Description |
|---|---|---|---|
| `generatedAt` | string \| null | yes | — |
| `refreshSeconds` | integer | yes | — |
| `sizesUsd` | number[] | yes | — |
| `minLiquidityUsd` | number | yes | — |
| `quotedGaps` | integer | yes | — |
| `chains` | string[] | yes | — |
| `rows` | object[] | yes | — |

### Airdrop

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | — |
| `name` | string | yes | — |
| `token` | string | yes | — |
| `chainId` | integer | yes | — |
| `status` | `"live"` \| `"ended"` | yes | — |
| `deadline` | string \| null | yes | — |
| `claimUrl` | string | yes | Official claim site. |
| `contract` | string | yes | — |
| `coverage` | string | yes | — |

### ClaimItem

| Field | Type | Required | Description |
|---|---|---|---|
| `amount` | string | yes | Base units. |
| `symbol` | string | yes | — |
| `decimals` | integer | yes | — |
| `chainId` | integer | yes | — |
| `token` | string | yes | — |

### ClaimsScan

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | — |
| `checkedAt` | integer | yes | — |
| `results` | object[] | yes | — |

### CheckoutBitcoin

"Pay with Bitcoin" (D-067): a Relay deposit address bound to this payment.

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | string | yes | Bitcoin deposit address. |
| `amountSats` | string | yes | Exact amount to send, in satoshis. (pattern `^\d+$`) |
| `amountBtc` | string | yes | The same amount in BTC. |
| `uri` | string | yes | BIP21 payment request (`bitcoin:<address>?amount=<btc>`) for the QR. |
| `amountOut` | string | yes | What the merchant receives, settlement-token base units. (pattern `^\d+$`) |
| `expiresAt` | string (date-time) | yes | The BTC price holds until then; afterwards ask for a fresh quote. |
| `expired` | boolean | yes | — |
| `status` | `"waiting"` \| `"depositing"` \| `"pending"` \| `"submitted"` \| `"success"` \| `"failure"` \| `"refund"` | yes | Relay's status of this quote. |
| `seenSats` | string | yes | Satoshis seen at the address (mempool included). (pattern `^\d+$`) |
| `requestId` | string | yes | Relay request id. |
| `feeBps` | integer | yes | LayerHop's fee (Relay app fee, bps of the BTC amount). |
| `refundAddress` | string \| null | yes | — |
| `quotes` | object[] | yes | Every address shown for this session (all are watched). |

### X402RequirementsV2

x402 v2 `PaymentRequirements` (scheme `exact`).

| Field | Type | Required | Description |
|---|---|---|---|
| `scheme` | `"exact"` | yes | — |
| `network` | string | yes | CAIP-2 network id, e.g. `eip155:8453`. |
| `amount` | string | yes | USDC base units the payer signs (price + LayerHop fee). (pattern `^\d+$`) |
| `asset` | string | yes | USDC contract. |
| `payTo` | string | yes | Your fee-splitting deposit address. |
| `maxTimeoutSeconds` | integer | yes | — |
| `extra` | object | no | EIP-712 domain of the asset (`name`, `version`). |

### X402RequirementsRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `network` | string | no | `base` (default), `optimism`, `arbitrum`, `polygon`, or a CAIP-2 id. (default `"base"`) |
| `amount` | string | yes | The price you net per request, USDC base units (`10000` = 0.01 USDC; at least 0.01 USDC by default). (pattern `^\d+$`) |
| `payTo` | string | yes | Your payout address on that network. |
| `resource` | string | yes | The resource URL (query and fragment ignored for the deposit address) or any stable id. |
| `description` | string | no | — |
| `mimeType` | string | no | — |
| `maxTimeoutSeconds` | integer | no | (default `60`) (10–3600) |

### X402RequirementsResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `payee` | object | yes | — |
| `payee.id` | string | yes | (pattern `^x4p_`) |
| `payee.network` | string | yes | — |
| `payee.chainId` | integer | yes | — |
| `payee.asset` | string | yes | — |
| `payee.depositAddress` | string | yes | — |
| `payee.merchant` | string | yes | — |
| `payee.resource` | string | yes | — |
| `payee.feeBps` | integer | yes | — |
| `payee.factory` | string | yes | — |
| `payee.lastSweepTx` | string \| null | no | — |
| `payee.lastSweptAt` | string \| null | no | — |
| `price` | string | yes | (pattern `^\d+$`) |
| `amount` | string | yes | What the payer signs (price + fee). (pattern `^\d+$`) |
| `fee` | object | yes | — |
| `fee.bps` | integer | yes | — |
| `fee.amount` | string | yes | (pattern `^\d+$`) |
| `accepts` | [X402RequirementsV2](#x402requirementsv2)[] | yes | — |
| `acceptsV1` | object[] | yes | The same requirements in x402 v1 form (`network` name, `maxAmountRequired`). |
| `paymentRequired` | object | yes | x402 v2 `PaymentRequired` (for the `PAYMENT-REQUIRED` header). |

### X402FacilitatorRequest

| Field | Type | Required | Description |
|---|---|---|---|
| `x402Version` | `1` \| `2` | no | — |
| `paymentPayload` | object | yes | The decoded `X-PAYMENT` (v1) or `PAYMENT-SIGNATURE` (v2) header: `payload.signature` + `payload.authorization` (EIP-3009). |
| `paymentRequirements` | object | yes | The requirements you answered the 402 with (v1 or v2 form). |

### X402VerifyResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `isValid` | boolean | yes | — |
| `invalidReason` | string | no | x402 reason, e.g. `insufficient_funds`, `invalid_exact_evm_payload_signature`, `invalid_exact_evm_payload_authorization_nonce_used`. |
| `payer` | string | no | — |
| `message` | string | no | Human-readable detail. |

### X402SettleResponse

| Field | Type | Required | Description |
|---|---|---|---|
| `success` | boolean | yes | — |
| `errorReason` | string | no | x402 reason; `settlement_pending` = sent, receipt not in yet. |
| `payer` | string | no | — |
| `transaction` | string | yes | Transaction hash (empty when nothing was sent). |
| `network` | string | yes | — |
| `message` | string | no | — |

### X402Payment

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^x402_`) |
| `object` | `"x402.payment"` | yes | — |
| `status` | `"submitted"` \| `"settled"` \| `"failed"` | yes | — |
| `statusDetail` | string \| null | no | — |
| `network` | string | yes | — |
| `chainId` | integer | yes | — |
| `asset` | string | yes | — |
| `payer` | string | yes | — |
| `payTo` | string | yes | The deposit address paid. |
| `amount` | string | yes | What the payer paid (USDC base units). (pattern `^\d+$`) |
| `merchantAmount` | string | yes | What you net after the deposit contract's fee. (pattern `^\d+$`) |
| `feeBps` | integer | yes | — |
| `resource` | string \| null | no | — |
| `transaction` | string \| null | no | — |
| `sweepTx` | string \| null | no | The sweep that paid it out to you. |
| `settledAt` | string \| null | no | — |
| `createdAt` | string (date-time) | yes | — |
| `updatedAt` | string (date-time) | no | — |

### X402SettledWindow

| Field | Type | Required | Description |
|---|---|---|---|
| `count` | integer | yes | Settled payments in the window. |
| `amount` | string | yes | What payers paid (USDC base units). (pattern `^\d+$`) |
| `merchantAmount` | string | yes | What you net after the deposit contract's fee (USDC base units). (pattern `^\d+$`) |

### X402Payee

One of your x402 deposit addresses (the requirements' `payTo`), one per network, payout address and resource.

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | (pattern `^x4p_`) |
| `network` | string | yes | CAIP-2 id. |
| `chainId` | integer | yes | — |
| `asset` | string | yes | — |
| `depositAddress` | string | yes | — |
| `merchant` | string | yes | Your payout address. |
| `resource` | string | yes | — |
| `feeBps` | integer | yes | — |
| `factory` | string | yes | — |
| `lastSweepTx` | string \| null | yes | — |
| `lastSweptAt` | string \| null | yes | — |

### X402Summary

| Field | Type | Required | Description |
|---|---|---|---|
| `settle` | boolean | yes | Whether `POST /v1/x402/settle` is enabled on this API (false: x402 is in preview, settle answers `FORBIDDEN`). |
| `networks` | object[] | yes | — |
| `settled` | object | yes | — |
| `settled.24h` | [X402SettledWindow](#x402settledwindow) | yes | — |
| `settled.7d` | [X402SettledWindow](#x402settledwindow) | yes | — |
| `payees` | [X402Payee](#x402payee)[] | yes | Newest first, at most 100. |

### X402PaymentList

| Field | Type | Required | Description |
|---|---|---|---|
| `payments` | [X402Payment](#x402payment)[] | yes | — |
| `nextCursor` | string \| null | yes | — |
