Skip to main content

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.

POST/api/ordersAuth: Required

Request Body​

member_idnumberRequired

The member the operation is for.

marketstringRequired

Market code.

sidestringRequired

Either buy or sell.

ord_typestringRequired

Either limit or market.

client_order_idstring

Your own id for this order.

pricestring | number

Limit price — send it on a limit order. Accepted as a string or a number.

volumestring | number

Base-asset quantity. Must be at least the market's min_volume — see List Markets. Accepted as a string or a number.

amountstring | number

Quote-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.

idnumberRequired

The order id.

client_order_idstring | nullRequired

The id you sent on creation, echoed back. null if you sent none.

market_idstringRequired

The market the order is on.

sidestringRequired

buy or sell.

ord_typestringRequired

market or limit.

volumestring | nullRequired

Base-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 | nullRequired

Base-asset volume the order was placed for. Never changes. null on an order placed by amount.

amountstring | nullRequired

Quote-asset amount, on an order that was placed by amount rather than by volume.

pricestring | nullRequired

The limit price. null on a market order.

avg_pricestring | nullRequired

Volume-weighted average fill price. null until the first fill.

statestringRequired

wait, done, fail or cancel — see Statuses.

member_idnumberRequired

The member the order belongs to.

lockedstringRequired

Funds still held for this order. Counts down to "0.0" as it fills or is cancelled.

origin_lockedstringRequired

Funds held when the order was placed. Never changes.

updated_atstringRequired

When the record last changed.

created_atstringRequired

When the record was created.

Errors​

Beyond the shared errors:

CodeMeaning
1001member_id is invalid or not yours, or client_order_id has already been used
2024The market does not exist or is inactive
2002The core refused the order — not enough money, an invalid volume, amount or price, or a trading limit. The reason is in the message