> For the complete documentation index, see [llms.txt](https://docs.swapkit.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.swapkit.dev/api-reference/v3-limit-place-and-manage-limit-orders.md). Agents can also search and read this documentation through its [MCP server](https://docs.swapkit.dev/~gitbook/mcp).

# /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.

{% hint style="warning" %}
**Pre-release.** Request and response schemas may still change before GA. Orders route real liquidity through our providers, so test with small amounts — funds committed are genuinely at risk.
{% endhint %}

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](https://docs.swapkit.dev/api-reference/v3-limit-place-an-order.md) and [Manage and cancel orders](https://docs.swapkit.dev/api-reference/v3-limit-manage-and-cancel-orders.md).

<figure><picture><source srcset="https://1967725871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl88kbsjWGhgdARxzgqCE%2Fuploads%2Fgit-blob-e43c1f927db0cdfe8097a8204351339c19a09b87%2Flimit-order-flow-dark.svg?alt=media" media="(prefers-color-scheme: dark)"><img src="https://1967725871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl88kbsjWGhgdARxzgqCE%2Fuploads%2Fgit-blob-58f7ecdb6be965ab01486355dbc8657ed355bf22%2Flimit-order-flow.svg?alt=media" alt="Placing a limit order. 1: POST /v3/limit/quote. 2: POST /v3/limit/build, which returns either typedData for the wallet to sign or tx for the wallet to broadcast; if isApproved is false, broadcast approvalTx first. 3: POST /v3/limit/submit with the signature or the depositTxHash. The order then rests until it is filled, cancelled or expires. Steps 4 to 7 read and cancel orders."></picture><figcaption><p>Three calls place an order. What the wallet does depends on which field <code>/v3/limit/build</code> returns.</p></figcaption></figure>

***

### 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:

<table><thead><tr><th width="130">Model</th><th width="240">Build response</th><th>What the wallet does</th></tr></thead><tbody><tr><td><strong>Signed intent</strong></td><td><code>typedData</code> populated, <code>tx</code> and <code>txMeta</code> <code>null</code></td><td>Signs an off-chain payload. <strong>The funds stay in the wallet</strong> until a filler matches the order and pulls the sell amount.</td></tr><tr><td><strong>Deposit</strong></td><td><code>tx</code> and <code>txMeta</code> populated, <code>typedData</code> <code>null</code></td><td>Signs and broadcasts a transaction that <strong>is</strong> the order; its hash is the receipt. <strong>The funds leave the wallet</strong> on broadcast, before anything is matched.</td></tr></tbody></table>

{% hint style="info" %}
**Branch on the artifact, not the provider.** Check `typedData !== null`, not `provider` — one provider can return either: 1inch sends `typedData` for a token sell and a `tx` for a native gas-asset sell.
{% endhint %}

### Providers

<table><thead><tr><th width="100">Provider</th><th width="240">Signing model</th><th width="190">Coverage</th><th>Chains</th></tr></thead><tbody><tr><td><strong>1inch</strong></td><td>Signed intent; deposit on native sells, except on HOOD and Arc</td><td>Same-chain EVM swaps</td><td>ETH, ARB, AVAX, BASE, BSC, Polygon, OP, HOOD, Arc</td></tr><tr><td><strong>Harbor</strong></td><td>Deposit</td><td>BTC ↔ ETH.ETH and BTC ↔ ETH.USDT</td><td>BTC, ETH (+ USDT)</td></tr><tr><td><strong>NEAR</strong></td><td>Deposit</td><td>Cross-chain via NEAR Intents</td><td>Most of the chains NEAR Intents serves — see below</td></tr></tbody></table>

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`](#the-tokens-response) rather than from this page.

***

### Endpoint index

<table><thead><tr><th width="90">Method</th><th width="250">Endpoint</th><th>Description</th></tr></thead><tbody><tr><td><code>GET</code></td><td><code>/v3/limit/tokens</code></td><td>Supported assets per provider. <a href="#the-tokens-response">See below</a>.</td></tr><tr><td><code>POST</code></td><td><code>/v3/limit/quote</code></td><td>Price the pair, reserve a <code>routeId</code>. <a href="https://docs.swapkit.dev/pages/nuWCZ5bFhbgZC3jpPgn9#id-1.-price-the-pair">Place an order</a>.</td></tr><tr><td><code>POST</code></td><td><code>/v3/limit/build</code></td><td>Persist the order and produce the signing artifact. <a href="https://docs.swapkit.dev/pages/nuWCZ5bFhbgZC3jpPgn9#id-2.-build-the-signing-artifact">Place an order</a>.</td></tr><tr><td><code>POST</code></td><td><code>/v3/limit/submit</code></td><td>Relay the wallet signature or deposit tx hash. <a href="https://docs.swapkit.dev/pages/nuWCZ5bFhbgZC3jpPgn9#id-3.-submit-the-signed-artifact">Place an order</a>.</td></tr><tr><td><code>GET</code></td><td><code>/v3/limit/orders/:orderId</code></td><td>Single order detail, refreshed from the provider. <a href="https://docs.swapkit.dev/pages/ay3izb9bQs0vCD5YRuzQ#id-4.-single-order-detail">Manage and cancel orders</a>.</td></tr><tr><td><code>GET</code></td><td><code>/v3/limit/orders</code></td><td>Paginated list scoped to the API key. <a href="https://docs.swapkit.dev/pages/ay3izb9bQs0vCD5YRuzQ#id-5.-paginated-order-list">Manage and cancel orders</a>.</td></tr><tr><td><code>POST</code></td><td><code>/v3/limit/cancel/build</code></td><td>Get what the wallet signs or broadcasts to cancel. <a href="https://docs.swapkit.dev/pages/ay3izb9bQs0vCD5YRuzQ#id-6.-cancel-an-order">Manage and cancel orders</a>.</td></tr><tr><td><code>POST</code></td><td><code>/v3/limit/cancel/submit</code></td><td>Cancel the order. <a href="https://docs.swapkit.dev/pages/ay3izb9bQs0vCD5YRuzQ#id-7.-submit-the-cancellation">Manage and cancel orders</a>.</td></tr><tr><td><code>POST</code></td><td><code>/v3/limit/webhook/retry</code></td><td>Re-send an order's current state to your webhook, for testing your handler. <a href="#redelivering-an-event">Webhooks</a>.</td></tr></tbody></table>

#### 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.

<table><thead><tr><th width="130">Field</th><th width="260">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>singleChain</code></td><td><code>{ provider, chainId, assets[] }[]</code></td><td>Same-chain providers (1inch). Any two of <code>assets</code> on <code>chainId</code> form a pair.</td></tr><tr><td><code>crossChain</code></td><td><code>{ provider, chainIds[], assets[] }[]</code></td><td>The other providers (Harbor, NEAR), with every asset they can trade across <code>chainIds</code>. Not every combination routes, so let <code>/v3/limit/quote</code> confirm a pair.</td></tr></tbody></table>

`assets` are SwapKit asset identifiers; `chainId` / `chainIds` use the same values as the order object's `chainId`.

***

## Order status lifecycle

<figure><picture><source srcset="https://1967725871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl88kbsjWGhgdARxzgqCE%2Fuploads%2Fgit-blob-977575b4198f0f5a0b813c651292ad0796ce672c%2Flimit-order-status-dark.svg?alt=media" media="(prefers-color-scheme: dark)"><img src="https://1967725871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl88kbsjWGhgdARxzgqCE%2Fuploads%2Fgit-blob-1b7c050aec037f156acf472df79573cf10f927d2%2Flimit-order-status.svg?alt=media" alt="Order status lifecycle: PENDING, then SUBMITTED, OPEN and PARTIAL, ending in one of FILLED, CANCELLED, EXPIRED or FAILED. A Harbor or NEAR order funded before /submit skips from PENDING to OPEN or FILLED. Harbor can regress an order from OPEN to SUBMITTED. An order never submitted goes from PENDING to EXPIRED with no webhook. Webhooks fire on transitions into PARTIAL and into each terminal state."></picture><figcaption><p><code>PENDING</code> → <code>SUBMITTED</code> → <code>OPEN</code> → <code>PARTIAL</code> → <code>FILLED</code> / <code>CANCELLED</code> / <code>EXPIRED</code> / <code>FAILED</code></p></figcaption></figure>

Status 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](#which-events-are-delivered).

<table><thead><tr><th width="130">Status</th><th width="220">Means</th><th>Watch for</th></tr></thead><tbody><tr><td><code>PENDING</code></td><td>Built; <code>/v3/limit/submit</code> not called yet.</td><td>On Harbor and NEAR the deposit address is live from build, so a <code>PENDING</code> order may already be funded. The poller then moves it straight on to <code>OPEN</code>, <code>PARTIAL</code> or <code>FILLED</code>.</td></tr><tr><td><code>SUBMITTED</code></td><td><code>/v3/limit/submit</code> attached the signature or the deposit tx hash.</td><td>Not yet proof the order is resting — that's <code>OPEN</code>. 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.</td></tr><tr><td><code>OPEN</code></td><td>The provider confirmed the order is resting.</td><td><strong>Not monotonic on Harbor</strong>: if Harbor briefly has no record of the order, sync moves it back to <code>SUBMITTED</code> until it reappears. An order that fills before a sync sees it resting skips <code>OPEN</code>.</td></tr><tr><td><code>PARTIAL</code></td><td>Partly filled.</td><td>Only on providers that support partial fills; the others go straight to <code>FILLED</code>.</td></tr><tr><td><code>FILLED</code></td><td>Terminal: the order filled completely.</td><td>On 1inch, also an order whose unfilled remainder is too small to execute. Its <code>filledSellAmount</code> / <code>filledBuyAmount</code> are what actually moved, so they can fall just short of the order amounts.</td></tr><tr><td><code>CANCELLED</code></td><td>Terminal: the order was cancelled. Anything filled before that is kept.</td><td>On NEAR Intents, <a href="https://docs.swapkit.dev/pages/ay3izb9bQs0vCD5YRuzQ#id-7.-submit-the-cancellation"><code>/v3/limit/cancel/submit</code></a> only requests the cancel. The order turns <code>CANCELLED</code> once a sync — the 30-minute poller, or a <code>GET /v3/limit/orders/:orderId</code> — sees NEAR confirm it, and that is the change your webhook receives.</td></tr><tr><td><code>EXPIRED</code></td><td>Terminal: <code>expiresAt</code> passed before the order filled completely.</td><td>Set by whichever happens first: SwapKit's sync sees that <code>expiresAt</code> is in the past, or the provider reports the order expired.</td></tr><tr><td><code>FAILED</code></td><td>Terminal: the order could not be funded or signed.</td><td>—</td></tr></tbody></table>

A terminal status is final: sync never revisits or overwrites it.

{% hint style="warning" %}
**Unsubmitted orders expire** — an hour after `/v3/limit/build`, or at `expiresAt` if that comes first; deposit orders wait for `expiresAt`. The expiry lands on the next 30-minute poll and is **not** sent to your webhook.
{% endhint %}

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](https://docs.swapkit.dev/get-started/partnership.md); there's no self-serve setting yet. SwapKit then POSTs an event whenever an order fills or reaches a terminal state.

### Verifying a request

Ask us for a key pair and we send you its public key (PEM) and key id. No secret is exchanged.

`x-swapkit-signature` is a base64 ECDSA P-256 signature, DER-encoded, over `{x-swapkit-timestamp}.{raw body}`. Verify it over the raw body, as received and before parsing. Reject a timestamp more than a few minutes old to stop a captured request being replayed. A new `x-swapkit-key-id` means the key was rotated.

```javascript
import crypto from "node:crypto";

// rawBody: the request body as a Buffer, exactly as received
const signed = Buffer.concat([Buffer.from(`${headers["x-swapkit-timestamp"]}.`), rawBody]);
const valid = crypto.verify(
  "sha256",
  signed,
  publicKeyPem,
  Buffer.from(headers["x-swapkit-signature"], "base64"),
);
```

### Which events are delivered

| Delivered                                                                                                       | Not 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](#order-status-lifecycle) |

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](https://docs.swapkit.dev/pages/ay3izb9bQs0vCD5YRuzQ#id-5.-paginated-order-list).

<details>

<summary>Why can the same fill arrive twice?</summary>

`eventId` identifies one delivery, not one transition. A retry of an event reuses its `eventId`, but a background poll and your own read of the order can each report the same fill, as two events with different `eventId`s. Re-reading the order on every event handles both.

</details>

### Headers

<table><thead><tr><th width="260">Header</th><th>Description</th></tr></thead><tbody><tr><td><code>x-swapkit-signature</code></td><td>The signature. See <a href="#verifying-a-request">Verifying a request</a>.</td></tr><tr><td><code>x-swapkit-signature-alg</code></td><td><code>ES256</code>.</td></tr><tr><td><code>x-swapkit-timestamp</code></td><td>Unix seconds when this attempt was signed. A retry gets a new one.</td></tr><tr><td><code>x-swapkit-key-id</code></td><td>Identifies the key pair that signed the request.</td></tr><tr><td><code>content-type</code></td><td>Always <code>application/json</code>.</td></tr><tr><td><code>x-swapkit-event-id</code></td><td>Matches <code>eventId</code> in the body. Dedupe on it.</td></tr><tr><td><code>x-swapkit-delivery-attempt</code></td><td>1-based delivery attempt number for this event, at most <code>5</code>.</td></tr></tbody></table>

### Body schema

<table><thead><tr><th width="200">Field</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>string</code></td><td>Always <code>"limitOrder.statusChanged"</code>.</td></tr><tr><td><code>eventId</code></td><td><code>string</code></td><td>Id of this event. Dedupe on it.</td></tr><tr><td><code>orderId</code></td><td><code>string</code></td><td>UUID of the order.</td></tr><tr><td><code>orderHash</code></td><td><code>string</code></td><td>Same as the order's <code>orderHash</code>.</td></tr><tr><td><code>apiKeyId</code></td><td><code>number</code></td><td>Id of the API key that owns the order.</td></tr><tr><td><code>provider</code></td><td><code>string</code></td><td>Provider that routed the order.</td></tr><tr><td><code>chainId</code></td><td><code>string</code></td><td>Sell-asset chain.</td></tr><tr><td><code>maker</code></td><td><code>string</code></td><td>Address that owns the order.</td></tr><tr><td><code>sellAsset</code>, <code>buyAsset</code></td><td><code>string</code></td><td>Asset identifiers.</td></tr><tr><td><code>sellAmount</code>, <code>buyAmount</code></td><td><code>decimal string</code></td><td>Order amounts, human-readable.</td></tr><tr><td><code>limitPrice</code></td><td><code>decimal string</code></td><td><code>buyAsset</code> per 1 <code>sellAsset</code>.</td></tr><tr><td><code>previousStatus</code></td><td><code>enum</code></td><td>Status before this event. Equals <code>status</code> for more fill on a <code>PARTIAL</code> order, or a provider-side change.</td></tr><tr><td><code>status</code></td><td><code>enum</code></td><td>The new <a href="#order-status-lifecycle">status</a>.</td></tr><tr><td><code>previousFilledSellAmount</code>, <code>previousFilledBuyAmount</code></td><td><code>decimal string</code></td><td>Filled amounts before this event.</td></tr><tr><td><code>filledSellAmount</code>, <code>filledBuyAmount</code></td><td><code>decimal string</code></td><td>Filled amounts after it.</td></tr><tr><td><code>integratorFeeBps</code></td><td><code>number</code> or <code>null</code></td><td>Your fee on the order.</td></tr><tr><td><code>createdAt</code></td><td><code>ISO 8601 string</code></td><td>When SwapKit published the event, not when the order was created. Unchanged across retries.</td></tr></tbody></table>

### 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:

<table><thead><tr><th width="200">Field</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>orderId</code></td><td><code>string</code></td><td>The order that was re-sent.</td></tr><tr><td><code>eventId</code></td><td><code>string</code></td><td>The new event's id.</td></tr><tr><td><code>webhookUrl</code></td><td><code>string</code></td><td>The URL the event was sent to.</td></tr><tr><td><code>delivered</code></td><td><code>boolean</code></td><td><code>true</code> when your endpoint returned <code>2xx</code>.</td></tr><tr><td><code>integratorResponse</code></td><td><code>object</code></td><td>What your endpoint did: <code>{ kind: "ok" | "client_rejected" | "server_error", status, body }</code>, or <code>{ kind: "network_error", error }</code> if it never answered.</td></tr></tbody></table>

<table><thead><tr><th width="80">Status</th><th width="270">Error code</th><th>Scenario</th></tr></thead><tbody><tr><td>404</td><td><code>limitOrderNotFound</code></td><td>Unknown <code>orderId</code>.</td></tr><tr><td>401</td><td><code>unauthorized</code></td><td>The order belongs to another API key.</td></tr><tr><td>409</td><td><code>limitOrderInvalidState</code></td><td>No webhook URL is attached to your key.</td></tr></tbody></table>

***

## Integrator checklist

{% stepper %}
{% step %}

### 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](https://docs.swapkit.dev/get-started/monetization.md).
{% endstep %}

{% step %}

### Quote the pair

Call [`/v3/limit/quote`](https://docs.swapkit.dev/pages/nuWCZ5bFhbgZC3jpPgn9#id-1.-price-the-pair). Pass the pair plus **any two** of `sellAmount` / `buyAmount` / `limitPrice`. Optionally pre-send `sourceAddress` / `destinationAddress` for early screening.
{% endstep %}

{% step %}

### Inspect the route

`spotPriceDeviationBps` shows the user how far their limit is from spot; `minExpirationSeconds` / `maxExpirationSeconds` bound the `expiresAt` you can pass to `/v3/limit/build`.
{% endstep %}

{% step %}

### Build the order

Call [`/v3/limit/build`](https://docs.swapkit.dev/pages/nuWCZ5bFhbgZC3jpPgn9#id-2.-build-the-signing-artifact) with `routeId`, `sourceAddress`, `destinationAddress`, and `expiresAt`.
{% endstep %}

{% step %}

### Handle the token approval

Check [`isApproved`](https://docs.swapkit.dev/api-reference/v3-limit-place-an-order.md#the-isapproved-field) and broadcast the accompanying [`approvalTx`](https://docs.swapkit.dev/api-reference/v3-limit-place-an-order.md#the-approvaltx-object) first if it's `false`.
{% endstep %}

{% step %}

### Sign or broadcast, then submit

Follow the [signing model](#signing-models):

* **`typedData` non-null** — the wallet signs it and you post `{ orderId, signature }` to [`/v3/limit/submit`](https://docs.swapkit.dev/pages/nuWCZ5bFhbgZC3jpPgn9#id-3.-submit-the-signed-artifact).
* **`tx` non-null** — the wallet signs and broadcasts it, using `txMeta.txType` to 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`](https://docs.swapkit.dev/api-reference/v3-limit-place-an-order.md#the-deposit-fields) — 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.
{% endstep %}

{% step %}

### Track state

Poll [`GET /v3/limit/orders/:orderId`](https://docs.swapkit.dev/pages/ay3izb9bQs0vCD5YRuzQ#id-4.-single-order-detail) (which also refreshes from the provider) or paginate via [`GET /v3/limit/orders`](https://docs.swapkit.dev/pages/ay3izb9bQs0vCD5YRuzQ#id-5.-paginated-order-list). Treat `OPEN` as [non-monotonic](#order-status-lifecycle).
{% endstep %}

{% step %}

### Cancel when needed

[`POST /v3/limit/cancel/build`](https://docs.swapkit.dev/pages/ay3izb9bQs0vCD5YRuzQ#id-6.-cancel-an-order) → the wallet signs or broadcasts whichever artifact came back, or does nothing if none did → [`POST /v3/limit/cancel/submit`](https://docs.swapkit.dev/pages/ay3izb9bQs0vCD5YRuzQ#id-7.-submit-the-cancellation). **Both calls are always required**, and a non-`CANCELLED` response carrying `cancelRequestedAt` means the cancel is in flight, not that it failed.
{% endstep %}

{% step %}

### Optional: webhooks

[Ask us to attach a webhook URL](#webhooks) to your API key and we'll POST fills and terminal transitions to it — see [which events are delivered](#which-events-are-delivered). Keep reconciling with `GET /v3/limit/orders` as well.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
**Staying forward-compatible.**

* Switch on `txMeta.txType`, not on the chain, so an unrecognised value fails loudly instead of being signed with the wrong codec.
* Treat `txMeta.txType`, `provider`, `warnings[].code` and `fees[].type` as open enums with an explicit fallback.
* Read `fees[]` off each order rather than hard-coding today's values.
  {% endhint %}
