LayerHop Payouts API
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.
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.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/layerhop-com:layerhop-com-payouts-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Layerhop Com Payouts API
version: 0.1.0
contact:
name: LayerHop
url: https://docs.layerhop.com
description: 'Operations tagged Payouts across 2 of this provider''s published API definitions: layerhop-com-openapi.yaml, openapi.yaml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.layerhop.com
description: Hosted API (production)
- url: http://localhost:8787
description: Local API (`pnpm --filter @layerhop/api dev`)
security:
- {}
- ApiKey: []
tags:
- name: Payouts
description: '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.'
paths:
/v1/payouts/plan:
post:
tags:
- Payouts
operationId: planPayouts
summary: Check and group payout rows
description: '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.'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PayoutPlanRequest'
example:
srcChain: base
srcToken: USDC
sender: '0xAbC0000000000000000000000000000000000001'
csv: 'recipient,amount,token,chain,label
alice.eth,250,USDC,base,March design
7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU,40,USDC,solana'
responses:
'200':
description: Every row checked, and the valid ones grouped.
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/PayoutPlan'
'400':
$ref: '#/components/responses/BadRequest'
'429':
$ref: '#/components/responses/TooManyRequests'
servers:
- url: https://api.layerhop.com
description: Hosted API (production)
- url: http://localhost:8787
description: Local API (`pnpm --filter @layerhop/api dev`)
/v1/payouts/transfers:
post:
tags:
- Payouts
operationId: buildPayoutTransfers
summary: Build a transfer batch
description: '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.'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PayoutTransfersRequest'
example:
chain: base
token: USDC
sender: '0xAbC0000000000000000000000000000000000001'
transfers:
- recipient: '0x3333333333333333333333333333333333333333'
amount: '250000000'
responses:
'200':
description: The calls (EVM) or the unsigned transaction (Solana).
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/PayoutTransfers'
example:
vm: evm
chainId: 8453
token:
chainId: 8453
address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
symbol: USDC
decimals: 6
calls:
- to: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
data: '0xa9059cbb00000000000000000000000033333333333333333333333333333333333333330000000000000000000000000000000000000000000000000000000000ee6b280'
value: '0'
'400':
$ref: '#/components/responses/BadRequest'
'429':
$ref: '#/components/responses/TooManyRequests'
servers:
- url: https://api.layerhop.com
description: Hosted API (production)
- url: http://localhost:8787
description: Local API (`pnpm --filter @layerhop/api dev`)
components:
schemas:
PayoutTransfers:
type: object
required:
- vm
- chainId
- token
properties:
vm:
type: string
enum:
- evm
- svm
chainId:
type: integer
token:
$ref: '#/components/schemas/PayoutToken'
calls:
type: array
description: EVM only, one per transfer, in order.
items:
type: object
required:
- to
- data
- value
properties:
to:
type: string
data:
type: string
value:
type: string
description: Wei.
serializedTx:
type: string
description: 'Solana only: base64 unsigned legacy transaction (one signature slot, the sender''s).'
PayoutPlanRow:
type: object
required:
- index
- line
- input
- ok
properties:
index:
type: integer
description: Row number from 0 (header excluded).
line:
type: integer
description: 1-based line of the CSV text (0 for JSON rows).
input:
$ref: '#/components/schemas/PayoutRowInput'
ok:
type: boolean
error:
type: object
required:
- code
- message
properties:
code:
type: string
description: INVALID_PARAMS, UNSUPPORTED_CHAIN, UNSUPPORTED_TOKEN, NOT_FOUND or PROVIDER_ERROR.
message:
type: string
recipient:
type: object
required:
- address
- name
properties:
address:
type: string
name:
type:
- string
- 'null'
chainId:
type: integer
chain:
type: string
token:
$ref: '#/components/schemas/PayoutToken'
amount:
type: string
description: Base units of `token`.
kind:
type: string
enum:
- transfer
- route
PayoutToken:
type: object
required:
- chainId
- address
- symbol
- decimals
properties:
chainId:
type: integer
address:
type: string
symbol:
type: string
decimals:
type: integer
usd:
type: number
description: USD price when known.
Error:
type: object
description: Every non-2xx response has this body.
required:
- error
properties:
error:
type: object
required:
- code
- message
- requestId
- docsUrl
properties:
code:
$ref: '#/components/schemas/ErrorCode'
message:
type: string
description: Human-readable detail. Do not parse it.
requestId:
type: string
format: uuid
description: Same value as the `x-request-id` header.
docsUrl:
type: string
format: uri
description: Error catalog page, `https://docs.layerhop.com/errors/{code}`.
details:
type: object
description: '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).
'
properties:
errors:
type: array
items:
$ref: '#/components/schemas/ProviderError'
suggestions:
type: array
maxItems: 4
description: '`NO_ROUTE` / `UNSUPPORTED_CHAIN` on a live quote: alternatives that quoted, best first (D-053).'
items:
$ref: '#/components/schemas/RouteSuggestion'
minAmount:
type: string
pattern: ^\d+$
description: '`AMOUNT_TOO_SMALL`: smallest input known to quote on this route, base units of `srcToken`.'
minAmountUsd:
type: number
description: '`AMOUNT_TOO_SMALL`: `minAmount` in USD, when the token has a price.'
minAmountApprox:
type: boolean
description: '`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.'
ErrorCode:
type: string
description: Stable error code. Each has a page at `https://docs.layerhop.com/errors/{code}`.
enum:
- INVALID_PARAMS
- UNSUPPORTED_CHAIN
- UNSUPPORTED_TOKEN
- AMOUNT_TOO_SMALL
- AMOUNT_TOO_LARGE
- CALLS_REVERTED
- LAUNCH_IMAGE_INVALID
- NO_ROUTE
- ROUTE_EXCLUDED
- QUOTE_NOT_FOUND
- QUOTE_EXPIRED
- ORDER_NOT_FOUND
- PROVIDER_ERROR
- PROVIDER_TIMEOUT
- RATE_LIMITED
- QUOTA_EXCEEDED
- UNAUTHORIZED
- FORBIDDEN
- ADDRESS_SANCTIONED
- NOT_FOUND
- CONFLICT
- GASLESS_PENDING
- GASLESS_FAILED
- MARKET_UNAVAILABLE
- LIMIT_ORDER_REJECTED
- INTERNAL
ProviderError:
type: object
description: A provider that failed while the request as a whole succeeded.
required:
- provider
- code
- message
properties:
provider:
$ref: '#/components/schemas/ProviderId'
code:
$ref: '#/components/schemas/ErrorCode'
message:
type: string
PayoutTransfersRequest:
type: object
required:
- chain
- token
- sender
- transfers
additionalProperties: false
properties:
chain:
oneOf:
- type: string
- type: integer
token:
type: string
sender:
type: string
transfers:
type: array
minItems: 1
maxItems: 20
description: At most 20 on EVM chains and 8 on Solana.
items:
type: object
required:
- recipient
- amount
properties:
recipient:
type: string
description: An address (resolve names with the plan first).
amount:
type: string
pattern: ^\d+$
description: Base units.
PayoutPlan:
type: object
required:
- source
- rows
- transfers
- routes
- transferTotal
- totals
- valid
- invalid
- warnings
properties:
source:
type: object
required:
- chainId
- chain
- sender
- token
properties:
chainId:
type: integer
chain:
type: string
sender:
type: string
token:
$ref: '#/components/schemas/PayoutToken'
rows:
type: array
items:
$ref: '#/components/schemas/PayoutPlanRow'
transfers:
type: array
description: Transfer batches (row indices in input order).
items:
type: object
required:
- chainId
- token
- rows
- total
properties:
chainId:
type: integer
token:
type: string
rows:
type: array
items:
type: integer
total:
type: string
description: Base units of the payer's token.
routes:
type: array
description: Routed rows by destination chain (one quote and one signature per row).
items:
type: object
required:
- chainId
- rows
properties:
chainId:
type: integer
rows:
type: array
items:
type: integer
transferTotal:
type: string
description: Base units of the payer's token sent as transfers.
totals:
type: array
description: What each destination token adds up to.
items:
type: object
required:
- chainId
- token
- symbol
- decimals
- amount
- formatted
- rows
properties:
chainId:
type: integer
token:
type: string
symbol:
type: string
decimals:
type: integer
amount:
type: string
formatted:
type: string
rows:
type: integer
valid:
type: integer
invalid:
type: integer
warnings:
type: array
items:
type: string
RouteSuggestion:
description: '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.
'
allOf:
- $ref: '#/components/schemas/RouteLeg'
- type: object
required:
- kind
- message
properties:
kind:
type: string
enum:
- dst_token
- src_token
- via_hub
message:
type: string
description: Short text for a button, e.g. "Receive USDC on Ethereum instead".
symbol:
type: string
description: 'The token that changed: the new source or destination token, or the hub token.'
hub:
type: object
description: '`via_hub` only: the token between the two steps.'
required:
- chainId
- token
- symbol
- decimals
properties:
chainId:
type: integer
token:
type: string
symbol:
type: string
decimals:
type: integer
steps:
type: array
description: '`via_hub` only: the two legs in order.'
minItems: 2
maxItems: 2
items:
$ref: '#/components/schemas/RouteLeg'
ProviderId:
type: string
description: '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.
'
enum:
- 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
RouteLeg:
type: object
description: One quotable leg, in the same terms as a quote request. Amounts are base units.
required:
- srcChain
- srcToken
- amount
- dstChain
- dstToken
properties:
srcChain:
type: integer
description: Source chain id.
srcToken:
type: string
description: 'Source token address or mint (native coin: the zero address; SOL: the system program id).'
amount:
type: string
pattern: ^\d+$
description: Input in base units of `srcToken`.
dstChain:
type: integer
description: Destination chain id.
dstToken:
type: string
dstAmount:
type: string
pattern: ^\d+$
description: Estimated output in base units of `dstToken` (from the check quote; scaled when served from cache).
PayoutPlanRequest:
type: object
required:
- srcChain
- srcToken
- sender
additionalProperties: false
description: Send `rows` or `csv`.
properties:
srcChain:
oneOf:
- type: string
- type: integer
description: The chain the payer pays from.
srcToken:
type: string
description: The token the payer pays with (listed).
sender:
type: string
description: The payer's address on `srcChain`.
rows:
type: array
maxItems: 100
items:
$ref: '#/components/schemas/PayoutRowInput'
csv:
type: string
maxLength: 100000
description: '`recipient,amount,token,chain[,label]` lines, header optional.'
PayoutRowInput:
type: object
required:
- recipient
- amount
- token
- chain
properties:
recipient:
type: string
description: Address, ENS name or .sol name.
amount:
oneOf:
- type: string
- type: number
description: Human units of `token` ("25", "0.5"); a dot for decimals, no thousands separators.
token:
type: string
description: Symbol or address.
chain:
oneOf:
- type: string
- type: integer
description: Chain slug or id.
label:
type: string
headers:
RequestId:
description: Unique id for this request. Quote it when you report a problem.
schema:
type: string
format: uuid
responses:
BadRequest:
description: 'Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`,
`AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`).
'
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: INVALID_PARAMS
message: 'amount: amount must be an integer string in base units'
requestId: 0d5e1f6a-3b2c-4d1e-8f9a-7b6c5d4e3f21
docsUrl: https://docs.layerhop.com/errors/INVALID_PARAMS
TooManyRequests:
description: 'Over your rate limit (`RATE_LIMITED`): the key''s `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP
without a key. Wait `retry-after` seconds.
'
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
retry-after:
description: Seconds until a request will be accepted.
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: RATE_LIMITED
message: Rate limit of 120 requests/minute exceeded; retry in 1s
requestId: 0d5e1f6a-3b2c-4d1e-8f9a-7b6c5d4e3f21
docsUrl: https://docs.layerhop.com/errors/RATE_LIMITED
securitySchemes:
ApiKey:
type: apiKey
in: header
name: x-api-key
description: '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.
'
Session:
type: apiKey
in: cookie
name: lh_session
description: 'Dashboard session cookie set by `POST /v1/auth/verify` (HttpOnly, Secure, SameSite=Lax,
7 days). Auth and Dashboard routes only.
'
AdminBearer:
type: http
scheme: bearer
description: Operator `ADMIN_TOKEN`. Admin routes only.
AdminSession:
type: apiKey
in: cookie
name: lh_admin
description: Owner sign-in cookie set by `POST /v1/admin/login` (12 hours). Admin routes only.
x-refined-from:
- layerhop-com-openapi.yaml
- openapi.yaml