The spot order management endpoints cover the full order lifecycle: placing single and batch orders, cancelling by ID or in bulk, and querying open orders, historical orders, and trade fills. All endpoints require authentication. Use theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/bitmart-api/llms.txt
Use this file to discover all available pages before exploring further.
submitSpotOrderV2 method for standard spot orders and the V4 query endpoints for the most up-to-date order state.
Setup
All methods on this page require a valid API key with trade permissions enabled. Read-only keys cannot place or cancel orders.
Placing Orders
submitSpotOrderV2(params)
Places a single spot order. This is the primary endpoint for creating buy and sell orders.
Trading pair, e.g.
"BTC_USDT".Order direction:
"buy" or "sell".Order type. One of:
"limit"— execute at a specific price or better"market"— execute immediately at the best available price"limit_maker"— post-only limit order; rejected if it would immediately match"ioc"— immediate-or-cancel; fills what it can, cancels the rest
Order quantity in base asset units. Required for
limit, limit_maker, ioc orders, and market sell orders. For market buy orders, use notional instead.Limit price. Required for
limit, limit_maker, and ioc order types.Quote currency amount. Used for market buy orders (e.g. spend
"100" USDT worth of BTC).Optional user-defined order ID (max 32 characters). Must be unique per account.
Self-trade prevention mode:
"none"(default) — no STP"cancel_maker"— cancel the resting order"cancel_taker"— cancel the incoming order"cancel_both"— cancel both orders
submitMarginOrderV1(params)
Places an order on an isolated margin account. Accepts the same parameters as submitSpotOrderV2.
The margin order endpoint returns
order_id as a number, unlike the spot endpoint which returns it as a string.submitSpotBatchOrdersV4(params)
Places multiple orders for the same symbol in a single API call. Supports up to the exchange batch limit per request.
Trading pair for all orders in the batch, e.g.
"BTC_USDT".Array of order objects. Each supports:
side("buy"|"sell") — requiredtype("limit"|"market"|"limit_maker"|"ioc") — requiredsize— quantity in base assetprice— limit pricenotional— quote amount for market buysclientOrderId— optional custom IDstpmode— self-trade prevention
Request validity window in milliseconds (max 60000, default 5000).
submitSpotBatchOrdersV2(params)
Places a batch of spot orders using the legacy V2 endpoint.
Cancelling Orders
cancelSpotOrderV3(params)
Cancels a single spot order by order ID or client order ID.
Trading pair of the order to cancel.
Exchange-assigned order ID. Required if
client_order_id is not provided.User-defined order ID. Required if
order_id is not provided.cancelSpotBatchOrdersV4(params)
Cancels multiple orders for a symbol by providing arrays of order IDs or client order IDs.
Trading pair for the orders to cancel.
Array of exchange order IDs to cancel.
Array of client order IDs to cancel.
Request validity window in milliseconds (max 60000).
CancelSpotBatchOrdersV4Response fields:
| Field | Type | Description |
|---|---|---|
successIds | string[] | Order IDs successfully cancelled |
failIds | string[] | Order IDs that failed to cancel |
totalCount | number | Total orders attempted |
successCount | number | Number successfully cancelled |
failedCount | number | Number that failed |
cancelAllSpotOrders(params?)
Cancels all open spot orders, optionally filtered by symbol and/or side.
Optional. Cancel all orders for a specific trading pair only.
Optional. Cancel only
"buy" or "sell" orders.cancelSpotOrdersV1(params?)
Querying Orders
getSpotOrderByIdV4(params)
Retrieves the current state of an order by its exchange-assigned order ID.
The exchange-assigned order ID.
Optional hint:
"open" to query open orders only, "history" for filled/cancelled orders. Omit to query both.Request validity window in milliseconds.
SpotOrderV4 key fields:
| Field | Type | Description |
|---|---|---|
orderId | string | Exchange order ID |
clientOrderId | string | Client-assigned order ID |
symbol | string | Trading pair |
side | string | "buy" or "sell" |
type | string | Order type |
price | string | Limit price |
size | string | Requested size |
state | string | Order state (e.g. "new", "partially_filled", "filled", "cancelled") |
priceAvg | string | Average fill price |
filledSize | string | Amount filled so far |
filledNotional | string | Quote value filled |
orderMode | string | "spot" or "iso_margin" |
createTime | number | Creation timestamp (ms) |
updateTime | number | Last update timestamp (ms) |
getSpotOrderByClientOrderIdV4(params)
Retrieves an order using the client-assigned order ID set at submission time.
The client-assigned order ID.
Optional:
"open" or "history".getSpotOpenOrdersV4(params?)
Returns all currently open orders, optionally filtered by mode and time range.
"spot" for spot orders, "iso_margin" for isolated margin orders.Filter by creation time start (ms).
Filter by creation time end (ms).
Number of results, range
[1, 200], default 200.Request validity window in milliseconds.
getSpotHistoricOrdersV4(params?)
Returns order history (filled, cancelled, etc.) with optional filtering.
Optional. Filter to a specific trading pair.
"spot" or "iso_margin".Start of time range (ms).
End of time range (ms).
Number of results, range
[1, 200], default 200.Request validity window in milliseconds.
getSpotAccountTradesV4(params?)
Returns a list of individual trade fills (executions) for your account. Each record corresponds to a partial or full fill event.
Optional. Filter by trading pair.
"spot" or "iso_margin".Start of time range (ms).
End of time range (ms).
Number of results, range
[1, 200].SpotAccountTradeV4 additional fields (extends SpotOrderV4 base):
| Field | Type | Description |
|---|---|---|
tradeId | string | Unique trade execution ID |
fee | string | Fee charged for this fill |
feeCoinName | string | Currency used for fee payment |
tradeRole | 'taker' | 'maker' | Whether order was taker or maker |
getSpotAccountOrderTradesV4(params)
Returns all individual trade fills for a single specific order. Use this to get the complete fill breakdown when an order was partially or fully executed across multiple trades.
The exchange-assigned order ID to retrieve fills for.
Request validity window in milliseconds (max 60000, default 5000).