Skip to main content
An order buys or sells an amount of a market now. You say how much in US dollars (value), and we work out the size, send the order, and report what filled.

Order types

Both types are immediate or cancel: whatever can fill fills at once, and the rest is canceled. Nothing waits on the order book. Orders that rest on the book, and stop-loss and take-profit orders, are planned but not available yet.

Value and size

You size every order by value, in US dollars. We turn it into a size in the asset’s units, such as BTC:
  1. We work out the price limit. For a market order, it is the current price moved 0.5% against you: above it for a buy, below it for a sell. For a limit order, it is your price.
  2. We divide your value by the price limit and round down to the market’s size_increment. A sell is divided by the higher of its price limit and the current price plus 0.5%.
  3. We check the result is worth at least min_value and at most max_value.
Dividing by the price limit means a buy can never cost more than the value you sent, even if every unit fills at the limit. So an order usually fills for slightly less than you asked. The difference is the price band and the rounding, never extra fees taken from the value.
BTC is trading at $84,010 and its size_increment is 0.00001.The order’s summary explains the difference: “You asked for 250.00;theorderwassizedsoitcouldnotcostmoreevenatitspricelimitof250.00; the order was sized so it could not cost more even at its price limit of 84,430.”

Rounding rules

  • A size calculated from your value is always rounded down. We never place a bigger order than you asked for.
  • A limit price you send is rounded to the market’s price precision in your favour: a buy limit down, a sell limit up. The order returns the price it used, with a price_rounded note.
  • An order worth less than $10 after rounding is refused before anything is recorded. The error tells you the smallest value that passes.

Statuses

Placing an order waits for the result, for up to 5 seconds, so the response is almost always final. If it is still pending, read it again with GET /v1/orders/{id} after a second or two. Set the wait yourself with the Prefer header: Prefer: wait=0 returns at once, and Prefer: wait=15 waits up to 15 seconds.
More statuses will be added when orders can rest on the book. Treat a status you don’t recognise as not final.

Why an order was canceled or rejected

status_reason explains every canceled and rejected order with a code and a sentence that includes the numbers involved. A rejected order never traded. Placing it again needs a new client_order_id, because the old one names the rejected order.

Sides, positions and flips

Orders have a side: buy or sell. Positions have a direction: long or short. You hold at most one position per market, and every order moves it:
  • A buy adds to a long, or reduces a short.
  • A sell adds to a short, or reduces a long.
  • An order bigger than the opposite position closes it and opens the other side with the rest. That is a flip.
position_effect on the order says which happened: open, increase, reduce, close or flip. A flip also adds a position_flipped note.

Reduce-only orders

Set reduce_only: true to make sure an order can only shrink a position. It never opens one and never flips. If you have no position, or the order is in the same direction as your position, it is refused before anything is recorded. If it is bigger than the position, it closes the position and stops. To close a position, you can also use POST /v1/positions/{symbol}/close, which works out the side and size for you.

Reading an order

The fields fall into three groups:
  • What you asked for: market, side, type, requested_value (or requested_percent for a close), price, reduce_only, metadata.
  • How we read it: size and price_limit.
  • What happened: status, status_reason, filled_size, average_fill_price, filled_value, fee, position_effect.
fee can arrive a few seconds after the order finishes. It is the total you paid, including the exchange’s fee and ours.

Summary, notes and timeline

  • summary says what happened in one to three sentences, including anything surprising. It is written for people and language models. Don’t parse it: the fields hold the same facts, and the wording may change.
  • notes point out things that did not stop the order but are worth knowing, each with a code and a message: size_rounded, price_rounded, position_flipped and position_closed. A preview can also have available_low, partial_fill_likely and trading_approval_expiring.
  • timeline is the order’s history, one entry per step. Add expand[]=timeline when you read the order:

Metadata

metadata holds up to 20 string values of your own. We store them with the order and return them unchanged, and never act on them. It is a good place to record why an order was placed:

Client order IDs

Every order needs a client_order_id that you choose: 1 to 64 letters, digits, ., _, : or -. It is unique across your account forever, and it makes retries safe. Sending the same request with the same ID never places a second order. See Retries and idempotency.