Skip to main content

private/create-order

REQUEST 

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

private/create-orderPrivate
Creates a new BUY or SELL order.

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

The user.order subscription can be used to check when the order is successfully created.

Request

Body

required
    id int64required

    Request id (echoed in response)

    method stringrequired

    Must be "private/create-order"

    api_key stringrequired

    Your API key (only required for private REST)

    sig stringrequired

    HMAC-SHA256 signature in hex (only required for private REST)

    nonce int64required

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

    params objectrequired
    Base order parameters shared by all create-order variants.
    instrument_name stringrequired

    Instrument symbol, e.g. BTCUSD-PERP

    side OrderSide (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 TimeInForce (string)

    Possible values: [GOOD_TILL_CANCEL, IMMEDIATE_OR_CANCEL, FILL_OR_KILL]

    Time in force

    exec_inst ExecInstCreateOrder (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 StpInst (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 StpScope (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 SpotMargin (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

Success.
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. order_id, client_oid.
    order_id int64

    Newly created order ID

    client_oid string

    Client Order ID from the request, or the request nonce if not provided. Recommend specifying client_oid as nonce can be the same across orders.

    message string

    Present when code !== 0.

    original string

    Present when code !== 0.