/v3/limit - Limit orders
How SwapKit limit orders work: the two signing models, which provider serves which pair, the status lifecycle, and the shape of a full integration.
The SwapKit Limit Order API lets integrators offer their users price-contingent swaps: the order rests until the market reaches the target price, then settles asynchronously. All endpoints sit under /v3/limit/*, every request must carry an x-api-key header, and all payloads are JSON.
This page is the model: the two signing shapes, the providers behind them, the status lifecycle every order moves through, and a checklist of the whole integration. The endpoints themselves are on Place an order and Manage and cancel orders.
/v3/limit/build returns.Signing models
Every order fits one of two signing models. /v3/limit/build tells you which one applies by populating exactly one set of fields:
Signed intent
typedData populated, tx and txMeta null
Signs an off-chain payload. The funds stay in the wallet until a filler matches the order and pulls the sell amount.
Deposit
tx and txMeta populated, typedData null
Signs and broadcasts a transaction that is the order; its hash is the receipt. The funds leave the wallet on broadcast, before anything is matched.
Providers
1inch
Signed intent; deposit on native sells, except on HOOD and Arc
Same-chain EVM swaps
ETH, ARB, AVAX, BASE, BSC, Polygon, OP, HOOD, Arc
Harbor
Deposit
BTC ↔ ETH.ETH and BTC ↔ ETH.USDT
BTC, ETH (+ USDT)
NEAR
Deposit
Cross-chain via NEAR Intents
Most of the chains NEAR Intents serves — see below
New providers are added without a breaking change: the endpoints, the order object, and the status lifecycle stay identical, and the only per-provider variation is which signing model the /build response uses.
Every provider accepts an order lasting up to one year. expiresAt − now may run from 60 seconds (1inch, Harbor) or 5 minutes (NEAR) up to 365 days. Each quote reports the window for its own route as minExpirationSeconds / maxExpirationSeconds — read it from there rather than hard-coding these numbers.
SwapKit picks the provider server-side, in order: a same-chain pair on a 1inch chain goes to 1inch, a BTC ↔ ETH.ETH / ETH.USDT pair to Harbor, and NEAR picks up everything else it can serve — mostly cross-chain. Don't infer the provider from the pair; read provider off the route, and enumerate the live asset set from GET /v3/limit/tokens rather than from this page.
Endpoint index
GET
/v3/limit/orders/:orderId
Single order detail, refreshed from the provider. Manage and cancel orders.
POST
/v3/limit/cancel/build
Get what the wallet signs or broadcasts to cancel. Manage and cancel orders.
POST
/v3/limit/webhook/retry
Re-send an order's current state to your webhook, for testing your handler. Webhooks.
The tokens response
No parameters. Lists the assets each provider can trade right now; a provider whose order creation is switched off is left out.
singleChain
{ provider, chainId, assets[] }[]
Same-chain providers (1inch). Any two of assets on chainId form a pair.
crossChain
{ provider, chainIds[], assets[] }[]
The other providers (Harbor, NEAR), with every asset they can trade across chainIds. Not every combination routes, so let /v3/limit/quote confirm a pair.
assets are SwapKit asset identifiers; chainId / chainIds use the same values as the order object's chainId.
Order status lifecycle
PENDING → SUBMITTED → OPEN → PARTIAL → FILLED / CANCELLED / EXPIRED / FAILEDStatus comes from syncing the order with the provider. A poller does it every 30 minutes for SUBMITTED, OPEN and PARTIAL orders, and for PENDING Harbor and NEAR orders, which can be funded before submit. GET /v3/limit/orders/:orderId and /v3/limit/cancel/build force-sync on every call, so read a single order when you need fresher state. Not every transition reaches your webhook — see which events are delivered.
PENDING
Built; /v3/limit/submit not called yet.
On Harbor and NEAR the deposit address is live from build, so a PENDING order may already be funded. The poller then moves it straight on to OPEN, PARTIAL or FILLED.
SUBMITTED
/v3/limit/submit attached the signature or the deposit tx hash.
Not yet proof the order is resting — that's OPEN. On a signed intent or a 1inch native sell, the orderbook has accepted the order. On a Harbor or NEAR deposit, SwapKit has only recorded your hash; the provider hasn't seen the deposit yet.
OPEN
The provider confirmed the order is resting.
Not monotonic on Harbor: if Harbor briefly has no record of the order, sync moves it back to SUBMITTED until it reappears. An order that fills before a sync sees it resting skips OPEN.
PARTIAL
Partly filled.
Only on providers that support partial fills; the others go straight to FILLED.
FILLED
Terminal: the order filled completely.
—
CANCELLED
Terminal: the order was cancelled. Anything filled before that is kept.
On NEAR Intents, /v3/limit/cancel/submit only requests the cancel. The order turns CANCELLED once a sync — the 30-minute poller, or a GET /v3/limit/orders/:orderId — sees NEAR confirm it, and that is the change your webhook receives.
EXPIRED
Terminal: expiresAt passed before the order filled completely.
Set by whichever happens first: SwapKit's sync sees that expiresAt is in the past, or the provider reports the order expired.
FAILED
Terminal: the order could not be funded or signed.
—
A terminal status is final: sync never revisits or overwrites it.
Deposit orders skip the one-hour cut-off because their deposit address is live from build, so a late deposit still has to be honoured. An expired order stays readable, and reading it is the only way to see an unsubmitted expiry.
Webhooks
Send us an HTTPS endpoint and we'll attach it to your API key — get in touch; there's no self-serve setting yet. SwapKit then POSTs an event whenever an order fills or reaches a terminal state.
Verify each request with x-swapkit-signature: the lowercase hex HMAC-SHA256 of the raw body, keyed to your webhook secret. Compute it over the bytes as received, before parsing. It covers no timestamp, so also dedupe on eventId to stop replays.
Which events are delivered
Any transition into PARTIAL, FILLED, CANCELLED, EXPIRED or FAILED
PENDING → SUBMITTED — that is your own /v3/limit/submit call
More fill on an order that is already PARTIAL
Any transition into OPEN, and Harbor's OPEN → SUBMITTED regression
A provider-side change with no status change, such as a new transaction hash — previousStatus equals status
PENDING → EXPIRED for an order that was never submitted
To follow SUBMITTED and OPEN, read the order. An event whose previousStatus equals status and whose filled amounts haven't moved is a prompt to re-read the order.
Delivery and retries
Respond within 10 seconds. A 5xx, timeout or network error is retried with backoff — up to 5 attempts over roughly 75–150 seconds — then dropped. A 4xx is dropped at once, so return one only for an event you never want again.
Treat each event as a cue to re-read the order, not a change to apply: events are unordered, and the same fill can arrive twice. Events sent while your endpoint is down past the retry window are lost, so also reconcile on a schedule.
Headers
x-swapkit-signature
Lowercase hex HMAC-SHA256 of the raw body, keyed to the webhook secret.
content-type
Always application/json.
x-swapkit-event-id
Matches eventId in the body. Dedupe on it.
x-swapkit-delivery-attempt
1-based delivery attempt number for this event, at most 5.
Body schema
type
string
Always "limitOrder.statusChanged".
eventId
string
Id of this event. Dedupe on it.
orderId
string
UUID of the order.
orderHash
string
Same as the order's orderHash.
apiKeyId
number
Id of the API key that owns the order.
provider
string
Provider that routed the order.
chainId
string
Sell-asset chain.
maker
string
Address that owns the order.
sellAsset, buyAsset
string
Asset identifiers.
sellAmount, buyAmount
decimal string
Order amounts, human-readable.
limitPrice
decimal string
buyAsset per 1 sellAsset.
previousStatus
enum
Status before this event. Equals status for more fill on a PARTIAL order, or a provider-side change.
previousFilledSellAmount, previousFilledBuyAmount
decimal string
Filled amounts before this event.
filledSellAmount, filledBuyAmount
decimal string
Filled amounts after it.
integratorFeeBps
number or null
Your fee on the order.
createdAt
ISO 8601 string
When SwapKit published the event, not when the order was created. Unchanged across retries.
Redelivering an event
Method: POST
URL: https://api.swapkit.dev/v3/limit/webhook/retry
A testing aid: sends the order's current state to your webhook once, right away, so you can test your handler without waiting for a fill. It doesn't recover a dropped event. The event has a fresh eventId, previousStatus equal to status, createdAt set to now, and a single attempt (x-swapkit-delivery-attempt is 1).
Send { "orderId": "<uuid>" } for one of your orders. The response is 200 whether or not your endpoint accepted the event:
orderId
string
The order that was re-sent.
eventId
string
The new event's id.
webhookUrl
string
The URL the event was sent to.
delivered
boolean
true when your endpoint returned 2xx.
integratorResponse
object
What your endpoint did: { kind: "ok" | "client_rejected" | "server_error", status, body }, or { kind: "network_error", error } if it never answered.
404
limitOrderNotFound
Unknown orderId.
401
unauthorized
The order belongs to another API key.
409
limitOrderInvalidState
No webhook URL is attached to your key.
Integrator checklist
Get an API key
Obtain an API key configured for limit orders. The affiliate fee and integrator recipient live on the key's config — see Monetization.
Quote the pair
Call /v3/limit/quote. Pass the pair plus any two of sellAmount / buyAmount / limitPrice. Optionally pre-send sourceAddress / destinationAddress for early screening.
Build the order
Call /v3/limit/build with routeId, sourceAddress, destinationAddress, and expiresAt.
Handle the token approval
Check isApproved and broadcast the accompanying approvalTx first if it's false.
Sign or broadcast, then submit
Follow the signing model:
typedDatanon-null — the wallet signs it and you post{ orderId, signature }to/v3/limit/submit.txnon-null — the wallet signs and broadcasts it, usingtxMeta.txTypeto pick the right codec, and you post{ orderId, depositTxHash }, with the hash exactly as the chain reported it.
Where the response carries depositAddress / depositAmount / depositMemo — Harbor and NEAR, not a 1inch native sell — check tx against them before signing, and call /v3/limit/build again if it has gone stale.
Track state
Poll GET /v3/limit/orders/:orderId (which also refreshes from the provider) or paginate via GET /v3/limit/orders. Treat OPEN as non-monotonic.
Cancel when needed
POST /v3/limit/cancel/build → the wallet signs or broadcasts whichever artifact came back, or does nothing if none did → POST /v3/limit/cancel/submit. Both calls are always required, and a non-CANCELLED response carrying cancelRequestedAt means the cancel is in flight, not that it failed.
Optional: webhooks
Ask us to attach a webhook URL to your API key and we'll POST fills and terminal transitions to it — see which events are delivered. Keep reconciling with GET /v3/limit/orders as well.
Last updated

