batch-orders — Batch Place Orders

Restrictions:

  • The symbol must be identical within the same batch
  • At most 10 orders

MARKET Order Combinations:

SideAmountQuantityOrder Basis
BUYYYOrder by amount (includes fee)
BUYYNOrder by amount (includes fee)
BUYNYOrder by quantity
SELLYYOrder by quantity
SELLYNOrder by amount
SELLNYOrder by quantity

In MARKET buy scenarios, amount includes trading fees.

Request:

{
  "id": "3",
  "op": "batch-orders",
  "args": {
    "batchOrders": [
      {
        "symbol": "BTCUSDC",
        "side": "BUY",
        "type": "LIMIT",
        "price": "60000",
        "quantity": "0.01",
        "timeInForce": "GTC",
        "newClientOrderId": "my-order-001"
      }
    ]
  }
}

Fields for each order in batchOrders:

FieldTypeRequiredDescription
symbolstringYesTrading pair
sidestringYesBUY / SELL
typestringYesLIMIT / MARKET
pricestringRequired for LIMITOrder price
quantitystringRequired for LIMITQuantity
amountstringConditionally requiredAmount (available for MARKET orders)
timeInForcestringNoGTC/IOC/FOK/POST_ONLY/GTD; defaults to GTC for LIMIT and IOC for MARKET
newClientOrderIdstringNoClient order ID, format [a-zA-Z0-9-_.], max length 100
selfTradePreventionModestringNoSelf-trade prevention mode
expireTimelongRequired for GTDExpiration timestamp (milliseconds); required when timeInForce is GTD, must be a future time

Success response:

{
  "id": "3",
  "op": "batch-orders",
  "code": 0,
  "data": [
    {
      "category": "SPOT",
      "orderId": "2269150830932668416",
      "clientOrderId": "my-order-001",
      "symbol": "BTCUSDC",
      "type": "LIMIT",
      "timeInForce": "GTC",
      "side": "BUY",
      "origQty": "0.01000000",
      "price": "60000.00000000",
      "executedQty": "0.00000000",
      "status": "NEW",
      "cumQuote": "0.00000000",
      "avgPrice": null,
      "updateTime": "1785239858440"
    }
  ],
  "inTime": 1787060806850,
  "outTime": 1787060806856
}

The corresponding element in data when a single order fails:

{
  "code": -5212,
  "msg": "clientOrderId duplicate",
  "clientOrderId": "my-order-001"
}