Skip to main content
Limit Orders let wallets and apps rest a swap at a price the user sets, through the 1Click Swap API.
Limit orders run as confidential 1Click swaps. They are not Perpetuals on near.com. See Confidential Swaps and the 1Click Terms of Service.

Place a limit order

Sell 1 NEAR for Ethereum USDC at 5 USDC per NEAR. The user pays on NEAR; filled USDC goes to their Ethereum address. Partial fills are allowed.
  1. Look up both assetIds with GET /v0/tokens.
  2. Create the order with POST /v0/orders.
  3. Send the amount on swapView to depositAddress, then poll GET /v0/orders/{orderId}.
You send quantity, side, and price. quantity is the base in smallest units. price is quote per one base — "5" is 5 USDC per 1 NEAR. This page uses NEAR (24 decimals) and Ethereum USDC (6 decimals): The quote-side amount is quantity × price × 10^quoteDecimals / 10^baseDecimals, rounded up to a whole smallest unit. After create, send the amount on swapView.

Tokens

Look up both sides of the pair by symbol (or other fields you care about) and use the returned assetId as baseAsset and quoteAsset. Take decimals from the same object. For the examples on this page: baseAsset is nep141:wrap.near. quoteAsset is nep141:eth-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.omft.near. Treat those assetId strings as snapshots; take current IDs from /v0/tokens before you ship. See Asset support.

Authorization

Send a partner JWT as X-API-Key for your app. If the user is signing in, send their User-Session as Authorization: Bearer. Use that same identity on create, get, list, and cancel so you can keep managing the order.

Create

The user pays on the origin chain and receives filled output on a destination-chain address.
Send swapView.amountIn on a SELL, or swapView.maxAmountIn on a BUY, to depositAddress. You can optionally notify 1Click with POST /v0/deposit/submit.
swapView.swapType is EXACT_INPUT on a SELL and EXACT_OUTPUT on a BUY. See Swap types.
The order stays open until it fills, you cancel it, or deadline (default 7 days). timeInForce is GTC.

Watch the order

Poll until isPayoutStatusFinal is true. That’s when filled output has been withdrawn and any unfilled amount refunded (COMPLETED or FAILED).
While you wait, fillStatus is the matching state: When payout is final, payouts has the withdrawal and refund legs (txHash on completed legs). partialFills are fills that already executed. depositedAmount is how much was funded. Once the order is in flight, extra deposits are not applied to it. They come back separately from the unfilled refund (payouts.refund).

Cancel

Cancel is asynchronous. Matching stops; filled output is still withdrawn and the unfilled remainder is refunded. A last slice can still fill, so the order may end FILLED instead of CANCELED.

List

GET /v0/orders returns your orders, newest first. Page with page[after] and page[size] (1–50, default 50). links.next is null on the last page.

If the user already holds an Intents balance

Use this when the payment already sits in Intents or Confidential Intents — an in-app balance, for example near.com. On create, set depositType, refundType, and recipientType to INTENTS or CONFIDENTIAL_INTENTS. Then fund the order with signed intent execution: generate an intent against the order’s depositAddress, have the user sign it, and submit it.
Each generate call covers the remaining unfunded amount.

Fees

1Click platform fees apply as for other flows (Fee configuration, Fees). Optional appFees on create are deducted from input.

If it fails

Errors come back as errors[] with a stable code. Use code when you handle them. Include meta.correlationId if you report a problem.

Making a request

Quote, deposit, and status for 1Click swaps

Confidential Swaps

confidentiality and CONFIDENTIAL_INTENTS

Signed Intent Execution

Fund Intents deposits without an on-chain transfer

Fee configuration

appFees on create