> For the complete documentation index, see [llms.txt](https://docs.kyberswap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kyberswap.com/developer-guide/limit-order-api/api-reference/maker-api.md).

# Maker API

Maker API endpoints for creating, querying, and cancelling limit orders.

## Maker

Maker endpoints handle the full lifecycle of a limit order from the Maker's perspective: creating orders gaslessly, querying their status, and cancelling them either gaslessly or on-chain.

For step-by-step integration guides, see:

* [Place a Limit Order](https://docs.kyberswap.com/developer-guide/limit-order-api/how-to-guides/place-a-limit-order.md)
* [Cancel an Order — Gasless](https://docs.kyberswap.com/developer-guide/limit-order-api/how-to-guides/cancel-an-order-gasless.md)
* [Cancel an Order — Hard Cancel](https://docs.kyberswap.com/developer-guide/limit-order-api/how-to-guides/cancel-an-order-hard-cancel.md)

***

### Get Unsigned Create Order Message <a href="#get-unsigned-create-order-message" id="get-unsigned-create-order-message"></a>

`POST /write/api/v1/orders/sign-message`

Returns an unsigned EIP-712 typed data object that the Maker must sign before submitting an order. The `domain`, `types`, and `message` fields are passed directly to `signTypedData`.

## Get Unsigned Create Order Message

> Get EIP712 create order message to be signed. The response of this API will need to be signed with \[Sign Typed Data v4]\(<https://docs.metamask.io/guide/signing-data.html#sign-typed-data-v4>) before submitting create order request to KyberSwap via \`/write/api/v1/orders\`.\
> \
> The server computes the fee (\`makerTokenFeePercent\`) and the fee recipient (\`feeRecipient\`) and packs both into the signed \`feeConfig\`. The fee recipient depends on the \`X-Client-Id\` header and the \`referral\` field.\
> \
> You must send the same \`X-Client-Id\`, \`referral\` and \`nativeOutput\` values, and the returned \`message.salt\`, to \`/write/api/v1/orders\`. Otherwise the order hash differs and signature verification fails.

```json
{"openapi":"3.0.3","info":{"title":"KyberSwap Limit Order APIs","version":"1.3.0"},"servers":[{"url":"https://limit-order.kyberswap.com"}],"paths":{"/write/api/v1/orders/sign-message":{"post":{"summary":"Get Unsigned Create Order Message","tags":["Maker"],"operationId":"post-write-api-v1-orders-sign-message","description":"Get EIP712 create order message to be signed. The response of this API will need to be signed with [Sign Typed Data v4](https://docs.metamask.io/guide/signing-data.html#sign-typed-data-v4) before submitting create order request to KyberSwap via `/write/api/v1/orders`.\n\nThe server computes the fee (`makerTokenFeePercent`) and the fee recipient (`feeRecipient`) and packs both into the signed `feeConfig`. The fee recipient depends on the `X-Client-Id` header and the `referral` field.\n\nYou must send the same `X-Client-Id`, `referral` and `nativeOutput` values, and the returned `message.salt`, to `/write/api/v1/orders`. Otherwise the order hash differs and signature verification fails.","parameters":[{"$ref":"#/components/parameters/XClientId"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["chainId","makerAsset","takerAsset","maker","makingAmount","takingAmount","expiredAt"],"properties":{"chainId":{"type":"string","description":"The chainId on which the order is being created. Only supports EVM chains."},"makerAsset":{"type":"string","description":"The token address of the asset which the Maker is selling."},"takerAsset":{"type":"string","description":"The token address of the asset which the Maker expects in return."},"maker":{"type":"string","description":"The address of the Maker."},"receiver":{"type":"string","description":"Defines who will receive the takerAsset when the order is filled.\nDefault: `maker`."},"allowedSenders":{"type":"array","maxItems":1,"description":"Defines the addresses who are allowed to fill the order.","items":{"type":"string"}},"makingAmount":{"type":"string","description":"The amount of `makerAsset` in wei. String representation of uint256 value."},"takingAmount":{"type":"string","description":"The amount of `takerAsset` in wei. String representation of uint256 value."},"referral":{"type":"string","description":"Optional referral identifier. It is part of the fee recipient selection, so the same value must be sent when creating the order."},"nativeOutput":{"type":"boolean","default":false,"description":"When `true`, the Maker receives the native token (e.g. ETH) instead of the wrapped native token.\n\nOnly allowed when `takerAsset` is the chain's wrapped native token and the chain supports unwrapping; otherwise the request fails with 400/`4001`. The server then sets the order's `receiver` to the unwrapper contract and encodes the real receiver in `interaction`."},"expiredAt":{"type":"integer","description":"The unix timestamp (seconds) upon which the order will automatically lapse (i.e. expire). Must be at least a few seconds in the future."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","description":"The response code."},"message":{"type":"string","description":"Server response message."},"data":{"type":"object","required":["types","domain","primaryType","message"],"properties":{"types":{"type":"object","required":["EIP712Domain","Order"],"properties":{"EIP712Domain":{"type":"array","items":{"$ref":"#/components/schemas/OrderSignMessageDefinition"}},"Order":{"type":"array","items":{"$ref":"#/components/schemas/OrderSignMessageDefinition"}}}},"domain":{"type":"object","required":["name","version","chainId","verifyingContract"],"properties":{"name":{"type":"string","description":"The user readable name of signing domain, i.e. the name of the DApp or the protocol."},"version":{"type":"string","description":"The current major version of the signing domain. Signatures from different versions are not compatible."},"chainId":{"type":"integer","description":"The EIP-155 chain id. The user-agent should refuse signing if it does not match the currently active chain."},"verifyingContract":{"type":"string","description":"the address of the contract that will verify the signature. The user-agent may do contract specific phishing prevention."}}},"primaryType":{"type":"string","description":"The top-level type of the object in the EIP712 message but does not have to correspond to any of the types in the message."},"message":{"type":"object","required":["salt","makerAsset","takerAsset","maker","receiver","allowedSender","makingAmount","takingAmount","feeConfig","makerAssetData","takerAssetData","getMakerAmount","getTakerAmount","predicate","interaction"],"properties":{"salt":{"type":"string","description":"The randomized data fed as an additional input to the hashing function."},"makerAsset":{"type":"string","description":"The token address of the asset which the Maker is selling."},"takerAsset":{"type":"string","description":"The token address of the asset which the Maker expects in return."},"maker":{"type":"string","description":"The address of the Maker."},"receiver":{"type":"string","description":"The receiver of the takerAsset when order is filled."},"allowedSender":{"type":"string","description":"Defines the addresses who are allowed to fill the order. Deafults to `0x000...` if none specified."},"makingAmount":{"type":"string","description":"The amount of `makerAsset` in wei."},"takingAmount":{"type":"string","description":"The amount of `takerAsset` in wei."},"feeConfig":{"type":"string","description":"Decimal uint256 that packs the server-computed fee configuration:\n- bit 192: `isTakerAssetFee` (1 means the fee is charged in `takerAsset`)\n- bits 160-191: fee rate in units of 1/100000 (i.e. `makerTokenFeePercent` × 10)\n- bits 0-159: `feeRecipient` address"},"makerAssetData":{"type":"string","description":"ABIv2 encoded data that can be decoded by a specified proxy contract when transferring makerAsset."},"takerAssetData":{"type":"string","description":"ABIv2 encoded data that can be decoded by a specified proxy contract when transferring takerAsset."},"getMakerAmount":{"type":"string","description":"The hexstring representing the `makerAsset` amount."},"getTakerAmount":{"type":"string","description":"The hexstring representing the `takerAsset` amount."},"predicate":{"type":"string","description":"Call data that indicates the validity of the orders logic."},"interaction":{"type":"string","description":"Call data that is sent to an intermediate contract when the order is filled."}}}}}}}}}},"400":{"description":"Bad Request\n- `4000`: Missing required fields\n- `4001`: chainId is not supported; `nativeOutput` is not supported for this takerAsset/chain\n- `4002`: makingAmount, takingAmount are not uint256 or are less than or equal to 0; expiredAt is not in the future; more than one `allowedSenders` entry\n- `4003`: makerAsset, takerAsset, maker, receiver, allowedSenders are not valid addresses\n- `4004`: makerAsset or takerAsset is the native token (use the wrapped token); `X-Client-Id` is longer than 256 characters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"XClientId":{"in":"header","name":"X-Client-Id","required":false,"schema":{"type":"string","maxLength":256},"description":"Your client/integrator identifier. It selects the fee recipient that is packed into the signed `feeConfig`, and it is stored with the order for attribution.\n\nSend the **same** value to `/write/api/v1/orders/sign-message` and `/write/api/v1/orders`, otherwise the signature check fails. Longer than 256 characters returns 400/`4004`."}},"schemas":{"OrderSignMessageDefinition":{"title":"OrderSignMessageDefinition","type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]},"ErrorResponse":{"title":"ErrorResponse","type":"object","properties":{"code":{"type":"integer","description":"Error code. See the error code table in the API description."},"message":{"type":"string","description":"Error message"},"errorEntities":{"type":"array","description":"The fields or entities the error refers to.","items":{"type":"string"}},"details":{"type":"array","description":"Additional error details. Includes an object with the `requestId` of the call, useful when reporting issues.","items":{"type":"object","properties":{"requestId":{"type":"string"}}}}},"required":["code","message","errorEntities"]}}}}
```

***

### Create Order <a href="#create-order" id="create-order"></a>

`POST /write/api/v1/orders`

Submits a signed limit order to the KyberSwap orderbook. The request body is the unsigned order body extended with `salt` (from the sign-message response) and `signature` (from the Maker's wallet).

## Create New Order

> API for Makers to create new orders by sending in order params which includes the signed EIP712 message returned in \`/write/api/v1/orders/sign-message\`.\
> \
> Send the same \`X-Client-Id\` header, \`referral\` and \`nativeOutput\` values, and the \`salt\` returned by \`/write/api/v1/orders/sign-message\`. These determine the order hash and the server-computed fee recipient, so any difference makes the signature invalid.\
> \
> The fee (\`makerTokenFeePercent\`) and fee recipient are computed by the server and cannot be set by the client.

```json
{"openapi":"3.0.3","info":{"title":"KyberSwap Limit Order APIs","version":"1.3.0"},"servers":[{"url":"https://limit-order.kyberswap.com"}],"paths":{"/write/api/v1/orders":{"post":{"summary":"Create New Order","tags":["Maker"],"operationId":"post-write-api-v1-orders","description":"API for Makers to create new orders by sending in order params which includes the signed EIP712 message returned in `/write/api/v1/orders/sign-message`.\n\nSend the same `X-Client-Id` header, `referral` and `nativeOutput` values, and the `salt` returned by `/write/api/v1/orders/sign-message`. These determine the order hash and the server-computed fee recipient, so any difference makes the signature invalid.\n\nThe fee (`makerTokenFeePercent`) and fee recipient are computed by the server and cannot be set by the client.","parameters":[{"$ref":"#/components/parameters/XClientId"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["chainId","makerAsset","takerAsset","maker","makingAmount","takingAmount","expiredAt","salt","signature"],"properties":{"chainId":{"type":"string","description":"The chainId on which the order is being created. Only supports EVM chains."},"makerAsset":{"type":"string","description":"The token address of the asset which the Maker is selling."},"takerAsset":{"type":"string","description":"The token address of the asset which the Maker expects in return."},"maker":{"type":"string","description":"The address of the Maker."},"receiver":{"type":"string","description":"Defines who will receive the takerAsset when the order is filled.\nDefault: `maker`."},"allowedSenders":{"type":"array","maxItems":1,"description":"Defines the addresses who are allowed to fill the order.","items":{"type":"string"}},"makingAmount":{"type":"string","description":"The amount of `makerAsset` in wei. String representation of uint256 value."},"takingAmount":{"type":"string","description":"The amount of `takerAsset` in wei. String representation of uint256 value."},"referral":{"type":"string","description":"Optional referral identifier. It is part of the fee recipient selection, so the same value must be sent when creating the order."},"nativeOutput":{"type":"boolean","default":false,"description":"When `true`, the Maker receives the native token (e.g. ETH) instead of the wrapped native token.\n\nOnly allowed when `takerAsset` is the chain's wrapped native token and the chain supports unwrapping; otherwise the request fails with 400/`4001`. The server then sets the order's `receiver` to the unwrapper contract and encodes the real receiver in `interaction`."},"expiredAt":{"type":"integer","description":"The unix timestamp (seconds) upon which the order will automatically lapse (i.e. expire). Must be at least a few seconds in the future."},"salt":{"type":"string","description":"The randomized data fed as an additional input to the hashing function. Returned in `/write/api/v1/orders/sign-message`."},"signature":{"type":"string","description":"The Maker's signature (signTypedData v4) over the EIP712 message returned by `/write/api/v1/orders/sign-message`, as a hex string. EOA (ECDSA), ERC-1271 and ERC-6492 smart-wallet signatures are accepted."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","description":"The response code."},"message":{"type":"string","description":"Server response message."},"data":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","description":"ID of the successfully created order."}}}}}}}},"400":{"description":"Bad Request\n- `4000`: Missing required fields\n- `4001`: chainId is not supported; maker is blacklisted; `nativeOutput` is not supported for this takerAsset/chain\n- `4002`: makingAmount, takingAmount, salt are not uint256, or makingAmount/takingAmount are less than or equal to 0; expiredAt is not in the future; more than one `allowedSenders` entry\n- `4002` (`makingAmount`): insufficient balance or allowance. The Maker's balance must cover this order plus the remaining amounts of the Maker's active orders on the same pair. The allowance to the limit order contract must cover this order plus the remaining amounts of all the Maker's active orders selling the same `makerAsset`.\n- `4003`: makerAsset, takerAsset, maker, receiver, allowedSenders are not valid addresses; signature has an invalid format\n- `4004`: signature is incorrect; maker is invalid; makerAsset or takerAsset is the native token; `X-Client-Id` is longer than 256 characters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict\n- `4090`: makerAsset is equal to takerAsset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"XClientId":{"in":"header","name":"X-Client-Id","required":false,"schema":{"type":"string","maxLength":256},"description":"Your client/integrator identifier. It selects the fee recipient that is packed into the signed `feeConfig`, and it is stored with the order for attribution.\n\nSend the **same** value to `/write/api/v1/orders/sign-message` and `/write/api/v1/orders`, otherwise the signature check fails. Longer than 256 characters returns 400/`4004`."}},"schemas":{"ErrorResponse":{"title":"ErrorResponse","type":"object","properties":{"code":{"type":"integer","description":"Error code. See the error code table in the API description."},"message":{"type":"string","description":"Error message"},"errorEntities":{"type":"array","description":"The fields or entities the error refers to.","items":{"type":"string"}},"details":{"type":"array","description":"Additional error details. Includes an object with the `requestId` of the call, useful when reporting issues.","items":{"type":"object","properties":{"requestId":{"type":"string"}}}}},"required":["code","message","errorEntities"]}}}}
```

***

### Get Maker Orders <a href="#get-maker-orders" id="get-maker-orders"></a>

`GET /read-ks/api/v1/orders`

Returns all orders for a Maker address, filterable by status (`active`, `open`, `cancelled`, `filled`, `expired`).

## Get List Of Orders By Maker

> Get all orders created by a Maker address filtered by the order status, sorted by creation time (newest first by default).\
> \
> \*\*Paging closed orders.\*\* For \`closed\`, \`filled\`, \`cancelled\` and \`expired\`, page/pageSize paging only reaches a limited depth of the Maker's history (the first 1000 orders at the time of writing). Deeper pages return 400/\`4002\` (\`page\`), and \`totalItems\` is capped just above that depth.\
> \
> To walk the history, prefer cursor paging: request the first page without \`cursor\`, then pass the returned \`pagination.nextCursor\` as \`cursor\` while \`pagination.hasMore\` is \`true\`.

```json
{"openapi":"3.0.3","info":{"title":"KyberSwap Limit Order APIs","version":"1.3.0"},"servers":[{"url":"https://limit-order.kyberswap.com"}],"paths":{"/read-ks/api/v1/orders":{"get":{"summary":"Get List Of Orders By Maker","tags":["Maker"],"operationId":"get-read-ks-api-v1-orders","description":"Get all orders created by a Maker address filtered by the order status, sorted by creation time (newest first by default).\n\n**Paging closed orders.** For `closed`, `filled`, `cancelled` and `expired`, page/pageSize paging only reaches a limited depth of the Maker's history (the first 1000 orders at the time of writing). Deeper pages return 400/`4002` (`page`), and `totalItems` is capped just above that depth.\n\nTo walk the history, prefer cursor paging: request the first page without `cursor`, then pass the returned `pagination.nextCursor` as `cursor` while `pagination.hasMore` is `true`.","parameters":[{"schema":{"type":"string"},"in":"query","name":"chainId","required":false,"description":"Optional. The chainId to filter on. When both `chainId` and `chainIds` are omitted, orders across all chains are returned."},{"schema":{"type":"array","maxItems":100,"items":{"type":"string"}},"in":"query","name":"chainIds","required":false,"style":"form","explode":true,"description":"Optional multi-chain filter, sent as repeated keys (e.g. `chainIds=1&chainIds=137`), at most 100 entries. When non-empty it takes precedence over `chainId`."},{"schema":{"type":"string"},"in":"query","name":"maker","required":true,"description":"The address of the Maker."},{"schema":{"type":"string","enum":["active","open","partially_filled","cancelling","closed","filled","cancelled","expired"]},"in":"query","name":"status","required":true,"description":"The status of the order to filter for:\n  - `active`: Order is active (both open and has been partially filled). Also includes `cancelling` orders.\n  - `open`: Order is open and has yet to be filled.\n  - `partially_filled`: Order has been partially filled.\n  - `cancelling`: A gasless cancellation was requested and is waiting for the outstanding operator signature to expire (see `/write/api/v1/orders/cancel`).\n  - `closed`: Order has been closed and can no longer be filled (`filled`, `cancelled` or `expired`).\n  - `filled`: Order has been filled with no remaining assets to be filled.\n  - `cancelled`: Order was cancelled by the Maker and can no longer be filled.\n  - `expired`: Order can no longer be filled as the expiry set by the Maker is in the past."},{"schema":{"type":"string"},"in":"query","name":"query","description":"Token symbol or token address, matched against either side of the order. A symbol matches by prefix; an address matches exactly. A pair such as `WETH/USDT`, `WETH-USDT` or `WETH USDT` matches either direction."},{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","description":"Page number to return. Minimum and default is set at `1`. Ignored when `cursor` is set; combining `cursor` with `page > 1` returns 400/`4001`."},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"in":"query","name":"pageSize","description":"Number of results to display per page. Minimum is `1` and maximum is `100`. Default is `10`."},{"schema":{"type":"string","default":"createdAt:desc"},"in":"query","name":"sort","description":"Sort order as `createdAt:asc` or `createdAt:desc` (default). `createdAt` is the only supported field. Cursor paging supports only the default order."},{"schema":{"type":"string"},"in":"query","name":"cursor","description":"Opaque keyset-paging token taken from `pagination.nextCursor` of the previous response. Only valid for closed statuses (`closed`, `filled`, `cancelled`, `expired`); sending it with an active status returns 400/`4001`. Send it with the same filters as the request that produced it."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","description":"The response code."},"message":{"type":"string","description":"Server response message."},"data":{"type":"object","required":["orders","pagination"],"properties":{"orders":{"type":"array","items":{"type":"object","required":["id","chainId","nonce","makerAsset","takerAsset","makerAssetDecimals","takerAssetDecimals","makingAmount","takingAmount","status","createdAt","expiredAt"],"properties":{"id":{"type":"integer","description":"The limit order ID."},"chainId":{"type":"string","description":"The chainId on which the order was created."},"nonce":{"type":"integer","description":"The nonce generated by KyberSwap to enable hard cancellation of all orders. See `/read-ks/api/v1/encode/increase-nonce`."},"makerAsset":{"type":"string","description":"The token address of the asset which the Maker is selling."},"takerAsset":{"type":"string","description":"The token address of the asset which the Maker expects in return."},"contractAddress":{"type":"string","description":"The address of the limit order contract the order was created on."},"orderHash":{"type":"string","description":"The EIP712 hash of the order (hex, without `0x` prefix)."},"makerAssetSymbol":{"type":"string","description":"The ERC20 token symbol for the `makerAsset`."},"takerAssetSymbol":{"type":"string","description":"The ERC20 token symbol for the `takerAsset`. For `nativeOutput` orders, the leading `W` is removed (e.g. `ETH` instead of `WETH`)."},"makerAssetDecimals":{"type":"integer","description":"The number of decimals supported by the ERC20 `makerAsset` token."},"takerAssetDecimals":{"type":"integer","description":"The number of decimals supported by the ERC20 `takerAsset` token."},"makerAssetLogoURL":{"type":"string","description":"A URL which hosts the logo of the `makerAsset`."},"takerAssetLogoURL":{"type":"string","description":"A URL which hosts the logo of the `takerAsset`."},"makingAmount":{"type":"string","description":"The amount of `makerAsset` in wei."},"takingAmount":{"type":"string","description":"The amount of `takerAsset` in wei."},"filledMakingAmount":{"type":"string","description":"The amount of `makerAsset` which has been filled for this order."},"filledTakingAmount":{"type":"string","description":"The amount of `takerAsset` which has been filled for this order."},"status":{"type":"string","enum":["open","partially_filled","cancelling","filled","cancelled","expired"],"description":"The current status of the order (`active` and `closed` are filters only and are never returned):\n- `open`: Order is open and has yet to be filled.\n- `partially_filled`: Order has been partially filled and can still be filled.\n- `cancelling`: A gasless cancellation is pending until the outstanding operator signature expires.\n- `filled`: Order has been filled with no remaining assets to be filled.\n- `cancelled`: Order was cancelled by the Maker and can no longer be filled.\n- `expired`: Order can no longer be filled as the expiry set by the Maker is in the past."},"createdAt":{"type":"integer","description":"Unix timestamp (seconds) at which the Maker order was created."},"expiredAt":{"type":"integer","description":"The unix timestamp upon which the order will automatically lapse (i.e. expire)."},"operatorSignatureExpiredAt":{"type":"integer","description":"Unix timestamp (seconds) after which a pending gasless cancellation completes. `0` if no operator signature was issued."},"clientId":{"type":"string","description":"The client identifier the order was created with (`X-Client-Id`), or the receiver address when none was sent."},"isTakerAssetFee":{"type":"boolean","description":"`true` if the fee is charged in `takerAsset`, `false` if it is charged in `makerAsset`."},"referral":{"type":"string","description":"The referral the order was created with. Omitted when empty."},"nativeOutput":{"type":"boolean","description":"`true` if the Maker receives the native token instead of the wrapped native token. Omitted when `false`."},"transactions":{"type":"array","description":"The fill transactions related to this order.","items":{"type":"object","required":["id","txHash","txTime","makingAmount","takingAmount"],"properties":{"id":{"type":"integer","description":"The order ID."},"txHash":{"type":"string","description":"The on-chain tx hash which filled the order."},"txTime":{"type":"integer","description":"The fill order tx timestamp."},"makingAmount":{"type":"string","description":"The amount of `makerAsset` filled by this order."},"takingAmount":{"type":"string","description":"The amount of `takerAsset` filled by this order."},"makingAmountUSD":{"type":"string","description":"USD value of `makingAmount` at fill time (decimal string, display only)."},"takingAmountUSD":{"type":"string","description":"USD value of `takingAmount` at fill time (decimal string, display only)."}}}}}}},"pagination":{"type":"object","required":["totalItems","hasMore"],"properties":{"totalItems":{"type":"integer","description":"The total number of Maker orders matching the filter. For closed statuses it is capped just above the paging depth limit."},"hasMore":{"type":"boolean","description":"Whether more results exist after this page."},"nextCursor":{"type":"string","description":"Opaque token to pass as `cursor` for the next page (closed statuses only). Omitted when `hasMore` is `false`."}}}}}}}}}},"400":{"description":"Bad Request\n- `4000`: Missing required fields (`maker`)\n- `4001`: status is not part of accepted values; `cursor` is invalid or combined with `page > 1`, a non-default `sort` or an active status\n- `4002`: page, pageSize are outside their min/max values, or the page is beyond the closed-history paging depth; more than 100 `chainIds`\n- `4003`: page, pageSize are in invalid formats\n- `4004`: sort is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"title":"ErrorResponse","type":"object","properties":{"code":{"type":"integer","description":"Error code. See the error code table in the API description."},"message":{"type":"string","description":"Error message"},"errorEntities":{"type":"array","description":"The fields or entities the error refers to.","items":{"type":"string"}},"details":{"type":"array","description":"Additional error details. Includes an object with the `requestId` of the call, useful when reporting issues.","items":{"type":"object","properties":{"requestId":{"type":"string"}}}}},"required":["code","message","errorEntities"]}}}}
```

***

### Get Active Making Amount <a href="#get-active-making-amount" id="get-active-making-amount"></a>

`GET /read-ks/api/v1/orders/active-making-amount`

Returns the total `makingAmount` currently committed across all open orders for a Maker and token. Use this before creating a new order to determine the total allowance required.

## Get Maker Active Making Amount

> Get the Maker's total remaining making amount for a specified token: the sum of \`makingAmount - filledMakingAmount\` over the Maker's \`open\` and \`partially\_filled\` orders selling \`makerAsset\`. Optionally scope it to one \`takerAsset\`.\
> \
> Also served as \`/read-partner/api/v1/orders/active-making-amount\`.

```json
{"openapi":"3.0.3","info":{"title":"KyberSwap Limit Order APIs","version":"1.3.0"},"servers":[{"url":"https://limit-order.kyberswap.com"}],"paths":{"/read-ks/api/v1/orders/active-making-amount":{"get":{"summary":"Get Maker Active Making Amount","tags":["Maker"],"operationId":"get-read-ks-api-v1-orders-active-making-amount","description":"Get the Maker's total remaining making amount for a specified token: the sum of `makingAmount - filledMakingAmount` over the Maker's `open` and `partially_filled` orders selling `makerAsset`. Optionally scope it to one `takerAsset`.\n\nAlso served as `/read-partner/api/v1/orders/active-making-amount`.","parameters":[{"schema":{"type":"string"},"in":"query","name":"chainId","required":true,"description":"The chainId on which the order is being created. Only supports EVM chains."},{"schema":{"type":"string"},"in":"query","name":"makerAsset","required":true,"description":"The token address of the asset which the Maker is selling."},{"schema":{"type":"string"},"in":"query","name":"maker","description":"The address of the Maker.","required":true},{"schema":{"type":"string"},"in":"query","name":"takerAsset","required":false,"description":"Optional. When set, only orders for the `makerAsset` -> `takerAsset` pair are counted."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","description":"The response code."},"message":{"type":"string","description":"Server response message."},"data":{"type":"object","required":["activeMakingAmount"],"properties":{"activeMakingAmount":{"type":"string","description":"The total making amount for the specified token (in wei). String representation of uint256 amount."}}}}}}}},"400":{"description":"Bad Request\n- Missing required fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"title":"ErrorResponse","type":"object","properties":{"code":{"type":"integer","description":"Error code. See the error code table in the API description."},"message":{"type":"string","description":"Error message"},"errorEntities":{"type":"array","description":"The fields or entities the error refers to.","items":{"type":"string"}},"details":{"type":"array","description":"Additional error details. Includes an object with the `requestId` of the call, useful when reporting issues.","items":{"type":"object","properties":{"requestId":{"type":"string"}}}}},"required":["code","message","errorEntities"]}}}}
```

***

### Get Unsigned Cancel Message <a href="#get-unsigned-cancel-message" id="get-unsigned-cancel-message"></a>

`POST /write/api/v1/orders/cancel-sign`

Returns an unsigned EIP-712 cancel message for one or more `orderIds`. Sign the returned message and pass it to `POST /write/api/v1/orders/cancel`.

## Get Unsigned Cancel Order(s) Message

> Get EIP712 cancel order message to be signed (i.e. 'Gasless Cancel'). The response of this API will need to be signed with \[Sign Typed Data v4]\(<https://docs.metamask.io/guide/signing-data.html#sign-typed-data-v4>) before submitting the cancel request to KyberSwap via \`/write/api/v1/orders/cancel\`.\
> \
> This endpoint only builds the message. It does not check that the orders exist or belong to the Maker; that is checked by \`/write/api/v1/orders/cancel\`.

```json
{"openapi":"3.0.3","info":{"title":"KyberSwap Limit Order APIs","version":"1.3.0"},"servers":[{"url":"https://limit-order.kyberswap.com"}],"paths":{"/write/api/v1/orders/cancel-sign":{"post":{"summary":"Get Unsigned Cancel Order(s) Message","tags":["Maker"],"operationId":"post-write-api-v1-orders-cancel-sign","description":"Get EIP712 cancel order message to be signed (i.e. 'Gasless Cancel'). The response of this API will need to be signed with [Sign Typed Data v4](https://docs.metamask.io/guide/signing-data.html#sign-typed-data-v4) before submitting the cancel request to KyberSwap via `/write/api/v1/orders/cancel`.\n\nThis endpoint only builds the message. It does not check that the orders exist or belong to the Maker; that is checked by `/write/api/v1/orders/cancel`.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["chainId","maker","orderIds"],"properties":{"chainId":{"type":"string","description":"The chainId on which the order is being created. Only supports EVM chains."},"maker":{"type":"string","description":"The address of the Maker that created the order."},"orderIds":{"type":"array","items":{"type":"integer","description":"The order IDs to be cancelled gaslessly."}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","description":"The response code."},"message":{"type":"string","description":"Server response message."},"data":{"type":"object","required":["types","domain","primaryType","message"],"properties":{"types":{"type":"object","required":["EIP712Domain","CancelOrder"],"properties":{"EIP712Domain":{"type":"array","items":{"$ref":"#/components/schemas/OrderSignMessageDefinition"}},"CancelOrder":{"type":"array","items":{"$ref":"#/components/schemas/OrderSignMessageDefinition"}}}},"domain":{"type":"object","required":["name","version","chainId"],"properties":{"name":{"type":"string","description":"The user readable name of signing domain, i.e. the name of the DApp or the protocol."},"version":{"type":"string","description":"The current major version of the signing domain. Signatures from different versions are not compatible."},"chainId":{"type":"string","description":"The EIP-155 chain id. The user-agent should refuse signing if it does not match the currently active chain."}}},"primaryType":{"type":"string","description":"The top-level type of the object in the EIP712 message but does not have to correspond to any of the types in the message."},"message":{"type":"object","required":["chainId","maker","orderIds"],"properties":{"chainId":{"type":"string","description":"The chainId on which the order is being created."},"maker":{"type":"string","description":"The address of the Maker that created the order."},"orderIds":{"type":"array","items":{"type":"integer","description":"The order IDs to be cancelled gaslessly."}}}}}}}}}}},"400":{"description":"Bad Request\n- `4000`: Missing required fields\n- `4001`: chainId is not supported\n- `4002`: orderIds is empty\n- `4003`: maker is not a valid address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict\n- `4090`: Duplicate orderId in request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"OrderSignMessageDefinition":{"title":"OrderSignMessageDefinition","type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]},"ErrorResponse":{"title":"ErrorResponse","type":"object","properties":{"code":{"type":"integer","description":"Error code. See the error code table in the API description."},"message":{"type":"string","description":"Error message"},"errorEntities":{"type":"array","description":"The fields or entities the error refers to.","items":{"type":"string"}},"details":{"type":"array","description":"Additional error details. Includes an object with the `requestId` of the call, useful when reporting issues.","items":{"type":"object","properties":{"requestId":{"type":"string"}}}}},"required":["code","message","errorEntities"]}}}}
```

***

### Gasless Cancel Order <a href="#gasless-cancel-order" id="gasless-cancel-order"></a>

`POST /write/api/v1/orders/cancel`

Submits a signed gasless cancel request. The KyberSwap Operator will stop co-signing the specified orders. If the Operator recently signed an order, cancellation may take up to 5 minutes.

Requires the `Origin` header to be set.

## Submit Gasless Cancel Order(s)

> API for Makers to gaslessly cancel orders by sending in order params which includes the signed EIP712 message returned in \`/write/api/v1/orders/cancel-sign\`.\
> \
> All \`orderIds\` must be active orders of \`maker\` on \`chainId\`.\
> \- If an order has no operator signature that is still valid (\`operatorSignatureExpiredAt\` in the past, or \`0\`), it is cancelled immediately.\
> \- Otherwise its status becomes \`cancelling\` until \`operatorSignatureExpiredAt\`, because a Taker may still fill it with the operator signature already issued. After that time the cancellation completes automatically.\
> \
> Gasless cancellation never stops a fill that is already in flight. For an immediate, guaranteed cancellation, cancel on-chain (see \`/read-ks/api/v1/encode/cancel-batch-orders\`).

```json
{"openapi":"3.0.3","info":{"title":"KyberSwap Limit Order APIs","version":"1.3.0"},"servers":[{"url":"https://limit-order.kyberswap.com"}],"paths":{"/write/api/v1/orders/cancel":{"post":{"summary":"Submit Gasless Cancel Order(s)","tags":["Maker"],"operationId":"post-write-api-v1-orders-cancel","description":"API for Makers to gaslessly cancel orders by sending in order params which includes the signed EIP712 message returned in `/write/api/v1/orders/cancel-sign`.\n\nAll `orderIds` must be active orders of `maker` on `chainId`.\n- If an order has no operator signature that is still valid (`operatorSignatureExpiredAt` in the past, or `0`), it is cancelled immediately.\n- Otherwise its status becomes `cancelling` until `operatorSignatureExpiredAt`, because a Taker may still fill it with the operator signature already issued. After that time the cancellation completes automatically.\n\nGasless cancellation never stops a fill that is already in flight. For an immediate, guaranteed cancellation, cancel on-chain (see `/read-ks/api/v1/encode/cancel-batch-orders`).","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["chainId","maker","orderIds","signature"],"properties":{"chainId":{"type":"string","description":"The chainId on which the order is being cancelled. Only supports EVM chains."},"maker":{"type":"string","description":"The address of the Maker that created the order."},"orderIds":{"type":"array","items":{"type":"integer"},"description":"The order IDs to be cancelled gaslessly."},"signature":{"type":"string","description":"The Maker's signature (signTypedData v4) over the EIP712 message returned by `/write/api/v1/orders/cancel-sign`, as a hex string. EOA, ERC-1271 and ERC-6492 signatures are accepted."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","description":"The response code."},"message":{"type":"string","description":"Server response message."},"data":{"type":"object","required":["orders"],"properties":{"orders":{"type":"array","items":{"type":"object","required":["id","chainId","operatorSignatureExpiredAt"],"properties":{"id":{"type":"integer","description":"ID of the cancelled order."},"chainId":{"type":"string","description":"The chainId on which the order was cancelled."},"operatorSignatureExpiredAt":{"type":"integer","description":"The unix timestamp (seconds) at which the outstanding Operator signature expires. If it is in the past (or `0`), the order is already cancelled; otherwise the order is `cancelling` until then."}}}}}}}}}}},"400":{"description":"Bad Request\n- `4000`: Missing required fields\n- `4001`: chainId is not supported\n- `4002`: orderIds is empty\n- `4003`: maker is not a valid address; signature has an invalid format\n- `4004`: signature is incorrect (not signed by `maker`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found\n- `4040`: An orderId is not an active order of `maker` on `chainId`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict\n- `4090`: Duplicate orderId in request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"title":"ErrorResponse","type":"object","properties":{"code":{"type":"integer","description":"Error code. See the error code table in the API description."},"message":{"type":"string","description":"Error message"},"errorEntities":{"type":"array","description":"The fields or entities the error refers to.","items":{"type":"string"}},"details":{"type":"array","description":"Additional error details. Includes an object with the `requestId` of the call, useful when reporting issues.","items":{"type":"object","properties":{"requestId":{"type":"string"}}}}},"required":["code","message","errorEntities"]}}}}
```

***

### Encode Hard Cancel <a href="#encode-hard-cancel" id="encode-hard-cancel"></a>

`POST /read-ks/api/v1/encode/cancel-batch-orders`

Returns encoded calldata to cancel one or more specific orders on-chain. Multiple `orderIds` can be batched into a single transaction. The caller pays gas but the cancellation is immediate.

## Generate Encoded Data For Batch Cancellation

> Request for the cancellation encoded data from KyberSwap. This data can then be executed on-chain from the Maker's wallet.\
> \
> Send the transaction to the orders' \`contractAddress\` (returned by the order query APIs) on the orders' chain. The response does not include the target address.\
> \
> All orders must be active (\`open\`, \`partially\_filled\` or \`cancelling\`) and share the same Maker, chain and contract.\
> \
> Also served as \`/read-partner/api/v1/encode/cancel-batch-orders\`.

```json
{"openapi":"3.0.3","info":{"title":"KyberSwap Limit Order APIs","version":"1.3.0"},"servers":[{"url":"https://limit-order.kyberswap.com"}],"paths":{"/read-ks/api/v1/encode/cancel-batch-orders":{"post":{"summary":"Generate Encoded Data For Batch Cancellation","tags":["Maker"],"operationId":"post-read-ks-api-v1-encode-cancel-batch-orders","description":"Request for the cancellation encoded data from KyberSwap. This data can then be executed on-chain from the Maker's wallet.\n\nSend the transaction to the orders' `contractAddress` (returned by the order query APIs) on the orders' chain. The response does not include the target address.\n\nAll orders must be active (`open`, `partially_filled` or `cancelling`) and share the same Maker, chain and contract.\n\nAlso served as `/read-partner/api/v1/encode/cancel-batch-orders`.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["orderIds"],"properties":{"orderIds":{"type":"array","description":"The order IDs to be cancelled on-chain. Must be unique.","minItems":1,"items":{"type":"integer"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","description":"The response code."},"message":{"type":"string","description":"Server response message."},"data":{"type":"object","required":["encodedData"],"properties":{"encodedData":{"type":"string","description":"The batch cancellation encoded data to be used as the on-chain tx call data."}}}}}}}},"400":{"description":"Bad Request\n- `4000`: Missing required fields\n- `4001`: Orders belong to different contracts (`contractAddress`)\n- `4002`: orderIds is empty\n- `4004`: An orderId does not exist or is not active (`orderId: <id>`)\n- `4004`: Orders don't have the same maker or chainId (`orderIds`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict\n- Duplicate orderId in request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"title":"ErrorResponse","type":"object","properties":{"code":{"type":"integer","description":"Error code. See the error code table in the API description."},"message":{"type":"string","description":"Error message"},"errorEntities":{"type":"array","description":"The fields or entities the error refers to.","items":{"type":"string"}},"details":{"type":"array","description":"Additional error details. Includes an object with the `requestId` of the call, useful when reporting issues.","items":{"type":"object","properties":{"requestId":{"type":"string"}}}}},"required":["code","message","errorEntities"]}}}}
```

***

### Encode Increase Nonce <a href="#encode-increase-nonce" id="encode-increase-nonce"></a>

`POST /read-ks/api/v1/encode/increase-nonce`

Returns encoded calldata to increment the Maker's nonce in the Limit Order contract, which immediately invalidates **all** open orders. Use when you want to cancel everything at once.

## Generate Encoded Data For Cancel All

> Request for the cancel all encoded data from KyberSwap. Increasing the Maker's nonce on a limit order contract invalidates all of the Maker's existing orders on that contract. This data can then be executed on-chain from the Maker's wallet.\
> \
> No request body or chainId is needed; the calldata is the same on every chain. Send the transaction from the Maker's wallet to the limit order contract whose orders should be invalidated: the \`contractAddress\` of the orders, or \`latest\` from \`/read-ks/api/v1/configs/contract-address\`.\
> \
> Also served as \`/read-partner/api/v1/encode/increase-nonce\`.

```json
{"openapi":"3.0.3","info":{"title":"KyberSwap Limit Order APIs","version":"1.3.0"},"servers":[{"url":"https://limit-order.kyberswap.com"}],"paths":{"/read-ks/api/v1/encode/increase-nonce":{"post":{"summary":"Generate Encoded Data For Cancel All","tags":["Maker"],"operationId":"post-read-ks-api-v1-encode-increase-nonce","description":"Request for the cancel all encoded data from KyberSwap. Increasing the Maker's nonce on a limit order contract invalidates all of the Maker's existing orders on that contract. This data can then be executed on-chain from the Maker's wallet.\n\nNo request body or chainId is needed; the calldata is the same on every chain. Send the transaction from the Maker's wallet to the limit order contract whose orders should be invalidated: the `contractAddress` of the orders, or `latest` from `/read-ks/api/v1/configs/contract-address`.\n\nAlso served as `/read-partner/api/v1/encode/increase-nonce`.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","description":"The response code."},"message":{"type":"string","description":"Server response message."},"data":{"type":"object","required":["encodedData"],"properties":{"encodedData":{"type":"string","description":"The cancel all encoded data to be used as the on-chain tx call data."}}}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"title":"ErrorResponse","type":"object","properties":{"code":{"type":"integer","description":"Error code. See the error code table in the API description."},"message":{"type":"string","description":"Error message"},"errorEntities":{"type":"array","description":"The fields or entities the error refers to.","items":{"type":"string"}},"details":{"type":"array","description":"Additional error details. Includes an object with the `requestId` of the call, useful when reporting issues.","items":{"type":"object","properties":{"requestId":{"type":"string"}}}}},"required":["code","message","errorEntities"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kyberswap.com/developer-guide/limit-order-api/api-reference/maker-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
