Place & Cancel Orders
Build order calldata
POST /api/v1/orders/calldatastockAddress
string
Yes
Stock token address (EVM).
side
string
Yes
Buy or Sell.
type
string
Yes
Market or Limit.
quantity
string / number
Conditional
Limit orders; market sells.
notional
string / number
Conditional
Market buys.
price
string / number
Conditional
Limit orders.
deadline
number
Yes
Tx deadline (Unix seconds).
deferred
boolean
No
Deferred sell (sell-before-holding, debt-creating). Only valid with side: Sell and requires a whitelisted address. Routes to deferredLimitSell/deferredMarketSell. See deferred-sell.md. Defaults to false.
Market buy
{
"stockAddress": "0x0000000000000000000000000000000000000001",
"side": "Buy",
"type": "Market",
"notional": "10",
"deadline": 1893456000
}Limit sell
Limit buy
Limit orders (buy and sell) use
quantity+price;notionalis only for market buys. Production limit orders accept onlytimeInForce: "DAY"— other values revert on-chain. Market orders are accepted only during the regular US trading session. Pre-market, after-hours, overnight and closed sessions reject withmarket order is only supported during the regular trading session (current: <session>). This is enforced when building calldata, so it applies to both/calldata(self-submit) and/send(One Click). Use limit orders outside regular hours.
Response data:
chainId
number
Chain ID.
productType
string
Product type.
toAddress
string
Router address.
value
string
Native value ("0").
callData
string
Encoded calldata.
method
string
placeMarketOrder or placeLimitOrder.
Submit toAddress + callData on-chain, then record via order-status-and-history.md.
One Click place order
Same body as /calldata, plus optional gasLimit (set a buffer — the API broadcasts through OneClickRouter and pays gas). Requires One Click enabled and API key userAddress configured.
The response is the order-tx mapping, not calldata: { id, chainId, productType, operationType, orderId, txHash, status, ... }. orderId is null until the indexer backfills it — poll GET /orders/tx/{txHash} or GET /orders/{orderId} (once populated).
Build Order-With-Deposit Calldata
Use this endpoint when the order transaction should also use StockRouter as the approved spender before placing the order. For buys, StockRouter transfers the cash token to Cashier; for sells, it transfers the stock token to Stock.
stockAddress
string
Yes
Stock token address.
depositAmount
string / number
Yes
Human-readable deposit amount. For buys, this is cash token amount. For sells, this is stock token amount.
depositTokenAddress
string
Conditional
Cash token address. Required for buy orders.
side
string
Yes
Buy or Sell.
type
string
Yes
Market or Limit.
quantity
string / number
Conditional
Limit orders; market sells.
notional
string / number
Conditional
Market buys.
price
string / number
Conditional
Limit orders.
timeInForce
string
Conditional
Limit orders.
deadline
number
Yes
Tx deadline (Unix seconds).
For buy orders, the cash token must be approved for StockRouter, and the cash deposit must be eligible for instant deposit; otherwise the combined transaction reverts. For sell orders, the wallet stock token must be approved for StockRouter.
Market buy with deposit
Market sell with stock deposit
One Click Order With Deposit
Same body as /with-deposit/calldata, plus optional gasLimit. Requires One Click enabled and API key userAddress configured.
Cancel limit order
Self-submit cancel calldata
Use the
orderIdexactly as returned by the API — a0x-prefixed 32-byte hex string (66 characters), e.g.0x00000000000049fb0001000049d0d92daa26b7f121276e7034af17aed9e4c71e. Put it in the path as-is:DELETE /api/v1/orders/0x00000000000049fb0001000049d0d92daa26b7f121276e7034af17aed9e4c71e/calldata?deadline=1893456000
One Click cancel
Returns uuid and txHash.
Cancel rules
Order belongs to current API key
Order is open
Limit orders only
No pending cancel in flight
API key
userAddressmatches order user
Last updated

