Skip to main content

private/batch-order-request

REQUEST 

wss://stream.crypto.com/exchange/v1/user

private/batch-order-requestPrivate
A batched order operation endpoint that allows you to submit multiple cancel and create order operations in a single request for a specific instrument.

Cancels are processed before creates (not atomic by default). Operations are independent (one failure doesn't roll back others) when atomic is false.

Limits:

  • Maximum 10 create orders per batch request
  • At least one of cancels or creates must be non-empty

This call is asynchronous, so the response is simply a confirmation of the request.

The user.order subscription can be used to check when orders are successfully created or canceled.

Request​

Body

required
    id int64required

    Request id (echoed in response)

    method stringrequired

    Must be "private/batch-order-request"

    nonce int64required

    Current timestamp in milliseconds, e.g. "1771761038000".

    params objectrequired
    instrument_name stringrequired

    Target instrument for all operations in this batch request.

    cancels object[]
    Array of orders to cancel (by order_id or client_oid). At least one of cancels or creates must be non-empty.
  • Array [
  • order_id int64

    Order ID to cancel.

    client_oid string

    Client Order ID to cancel.

  • ]
  • creates object[]
    Possible values: <= 1000
    Array of new orders to create. Maximum 1000 orders per batch. At least one of cancels or creates must be non-empty.
  • Array [
  • instrument_name stringrequired

    Instrument symbol, e.g. BTCUSD-PERP

    side WsOrderSide (string)required

    Possible values: [BUY, SELL]

    BUY or SELL

    quantity decimalrequired

    Order quantity. For MARKET BUY can use notional instead.

    client_oid string

    Client order ID (max 36 chars). Recommended for correlation.

    time_in_force WsTimeInForce (string)

    Possible values: [GOOD_TILL_CANCEL, IMMEDIATE_OR_CANCEL, FILL_OR_KILL]

    Time in force

    exec_inst WsExecInstCreateOrder (string)[]

    Possible values: [POST_ONLY, REDUCE_ONLY, SMART_POST_ONLY, ISOLATED_MARGIN, MARGIN_ORDER]

    Optional array of execution instructions. POST_ONLY and SMART_POST_ONLY mutually exclusive.

    fee_instrument_name string

    Fee instrument (e.g. CRO) for fee deduction

    stp_id string

    Self-trade prevention ID (0 to 32767)

    stp_inst WsStpInst (string)

    Possible values: [M, T, B]

    Self-trade prevention instruction. Used in private/change-account-settings (params) and private/get-account-settings (result). Mandatory if stp_scope is set.

    • ➖ M: Cancel Maker
    • ➖ T: Cancel Taker
    • ➖ B: Cancel Both Maker and Taker
    stp_scope WsStpScope (string)

    Possible values: [M, S, D]

    Self-trade prevention scope. Used in private/change-account-settings (params) and private/get-account-settings (result).

    • ➖ M: Matches Master or Sub a/c
    • ➖ S: Matches Sub a/c only
    • ➖ D: reset all STP fields to default (stp_inst and stp_id in same request are ignored).
    type stringrequired

    Possible values: [LIMIT, MARKET]

    Order type: LIMIT or MARKET

    price decimal

    Limit price (required for LIMIT orders)

    notional decimal

    Amount to spend; for MARKET BUY only (alternative to quantity)

    spot_margin WsSpotMargin (string)

    Possible values: [SPOT, MARGIN]

    SPOT or MARGIN (spot/margin mode).

    isolated_margin_amount decimal

    Isolated margin amount

    isolation_id string

    Isolation ID for isolated margin

    leverage decimal

    Leverage for margin/derivatives

  • ]
  • stp_cancel_type string

    Self-trade prevention cancel behavior.

    stp_account_enforce_flag boolean

    Self-trade prevention account enforcement flag.

    stp_group string

    Self-trade prevention group ID.

WebSocket response
Schema
    id int64

    Echoed request id

    method string

    Method invoked

    code int32

    0 = success; non-zero indicates error (reason code).

    result object
    Present when code === 0.
    cancels object[]
    Results for cancel operations.
  • Array [
  • code int32

    0 if success.

    order_id int64

    Order ID that was cancelled.

    client_oid string

    Client Order ID that was cancelled.

    message string

    (Optional) Error or status message.

  • ]
  • creates object[]
    Results for create operations.
  • Array [
  • code int32

    0 if success.

    order_id int64

    Newly created order ID.

    client_oid string

    Client Order ID from the request.

    message string

    (Optional) Error or status message.

  • ]
  • message string

    Response message. Contains additional reason when code !== 0.

    original string

    Present when code !== 0.