Create a new order
Create a new order.
Requires authentication.
In: header
In: header
Order type. Default is LIMIT.
"LIMIT""LIMIT" | "MARKET" | "STOP" | "TWAP"Side of the book to place order on. Either BUY or SELL.
"BUY""BUY" | "SELL"Product to place order on. (BTC-VND, ETH-VND, SOL-VND).
Self-trade prevention flag. Either cancel_taker or cancel_maker.
"CANCEL_TAKER""CANCEL_TAKER" | "CANCEL_MAKER" | "CANCEL_BOTH"The max or min price limit to buy or sell at. For market order or order with exact_quote_size, limit price must be 0.
Amount to buy or sell. Must be 0 if quote size is provided.
MARKET orders using quote_size specifies the amount the user wants to spend (when buying) or receive (when selling) the quote asset; the correct base_size will be determined based on the market liquidity and quote_size. Only available for market order. Must be 0 if base size is provided.
For LIMIT orders, exact_quote_size is the total quote amount the user expects to
spend (when buying) or receive (when selling) base_size amount of base asset, inclusive of all fees.
The limit_price will be calculated from exact_quote_size, base_size, and fees.
Any remaining quote amount after the fill will be charged.
When exact_quote_size is provided, the order must be LIMIT and the time in force must be FOK.
How long the open order should be active for. Either GTC, IOC, or FOK. Default is GTC.
For market order, time in force must be IOC.
"GTC""GTC" | "IOC" | "FOK" | "GTT"Post-only flag. If true, order will be rejected if it would take liquidity. Optional, default is false. For market order, post only must be false.
Order stop type. Could be NONE, TAKE_PROFIT or STOP_LOSS. Default is STOP_NONE.
"STOP_NONE""STOP_NONE" | "STOP_LOSS" | "TAKE_PROFIT"The last traded price at which the stop order will be triggered.
A unique id among open orders. It can contain alphanumeric characters and some symbols (:, -, _). Case-insensitive. Optional.
Order expiry time in nanosecond for time in force GTT, mandatory when time_in_force set to GTT.
int64Order scheduled time in nanosecond.
int64If this is true, the response will be sent only after the order is properly processed (instead of return immediately as "pending" as before) by the matching engine". The order status in the response will be "open", "done" or "accepted". Note that the http status code is still 200 OK when order is (created then) rejected by matching engine, the client should use order status field to know what happened with the order (put on book, partially filled, fully filled, etc).
Response Body
application/json
application/json
curl -X POST "https://api.moonbase.vn/api/v1/orders" \ -H "Content-Type: application/json" \ -d '{ "side": "BUY", "product_id": "string", "limit_price": "string", "base_size": "string" }'{
"order": {
"order_id": "string",
"client_order_id": "string",
"user_id": "string",
"status": "SUBMITTED",
"done_reason": "string",
"product_id": "string",
"side": "BUY",
"type": "LIMIT",
"time_in_force": "GTC",
"post_only": "false",
"stp": "CANCEL_TAKER",
"limit_price": "string",
"base_size": "string",
"quote_size": "string",
"exact_quote_size": "string",
"average_fill_price": "string",
"filled_base_size": "string",
"filled_quote_size": "string",
"maker_fee_rate": "string",
"taker_fee_rate": "string",
"fee_asset_id": "string",
"created_at": "string",
"updated_at": "string",
"cancel_requested_at": "string",
"expired_at": "string",
"scheduled_at": "string",
"trades": [
{
"id": "string",
"price": "string",
"size": "string",
"liquidity_indicator": "MAKER",
"time": "string",
"fee_asset": "string",
"fee_amount": "string"
}
]
}
}{
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}