Create Order
Places an order for a member. member_id, market, side and ord_type are required; price, volume and amount are supplied according to the order type.
/api/ordersAuth: RequiredRequest Body
member_idnumberRequiredThe member the operation is for.
marketstringRequiredMarket code.
sidestringRequiredEither buy or sell.
ord_typestringRequiredEither limit or market.
client_order_idstringYour own id for this order.
pricestring | numberLimit price — send it on a limit order. Accepted as a string or a number.
volumestring | numberBase-asset quantity. Must be at least the market's min_volume — see
List Markets. Accepted as a string or a
number.
amountstring | numberQuote-asset amount. Must be at least the market's min_amount — see
List Markets. Accepted as a string or a
number.
Values are cut to the market's precision before the order is placed — volume
to base_precision, amount to quote_precision, price to price_precision.
Extra decimals are dropped, not rounded, and no error is raised; the response shows
the value actually used. On trxusdt, where base_precision is 1, a volume of
100.55 is placed as 100.5. If cutting leaves zero, the order is refused with
2002.
Response
The order as accepted. A market order comes back in wait with avg_price: null — poll it or subscribe to the order webhook to see it fill.
idnumberRequiredThe order id.
client_order_idstring | nullRequiredThe id you sent on creation, echoed back. null if you sent none.
market_idstringRequiredThe market the order is on.
sidestringRequiredbuy or sell.
ord_typestringRequiredmarket or limit.
volumestring | nullRequiredBase-asset volume still unfilled. Counts down to "0.0" as the order fills.
null on an order placed by amount — a market buy, whose volume is not known
in advance.
origin_volumestring | nullRequiredBase-asset volume the order was placed for. Never changes. null on an order
placed by amount.
amountstring | nullRequiredQuote-asset amount, on an order that was placed by amount rather than by volume.
pricestring | nullRequiredThe limit price. null on a market order.
avg_pricestring | nullRequiredVolume-weighted average fill price. null until the first fill.
statestringRequiredwait, done, fail or cancel — see Statuses.
member_idnumberRequiredThe member the order belongs to.
lockedstringRequiredFunds still held for this order. Counts down to "0.0" as it fills or is cancelled.
origin_lockedstringRequiredFunds held when the order was placed. Never changes.
updated_atstringRequiredWhen the record last changed.
created_atstringRequiredWhen the record was created.
Errors
Beyond the shared errors:
| Code | Meaning |
|---|---|
1001 | member_id is invalid or not yours, or client_order_id has already been used |
2024 | The market does not exist or is inactive |
2002 | The core refused the order — not enough money, an invalid volume, amount or price, or a trading limit. The reason is in the message |