Skip to main content

private/get-order-history

POST 

/private/get-order-history

Gets the order history for a particular instrument.

Users should use user.order to keep track of real-time order updates, and private/get-order-history should primarily be used for recovery; typically when the websocket is disconnected.

Request

Body

required
    id int64required

    Request id (echoed in response)

    method stringrequired

    Must be "private/get-order-history"

    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
    instrument_name string
    start_time int64

    Start time (ms or ns).

    end_time int64

    End time (ms or ns).

    limit int32

    Default value: 100

    Maximum number of orders to retrieve. Default: 100.

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. result.data[] (status REJECTED/CANCELED/FILLED/EXPIRED).
    data object[]
  • Array [
  • account_id string

    Account ID.

    order_id int64

    Order ID.

    client_oid string

    Client Order ID.

    order_type string

    Possible values: [LIMIT, MARKET, STOP, STOP_LIMIT]

    Order type:

    • ➖ LIMIT, MARKET
    • ➖ STOP, STOP_LIMIT: Trigger orders
    time_in_force TimeInForce (string)

    Possible values: [IMMEDIATE_OR_CANCEL]

    Time in force. Only IMMEDIATE_OR_CANCEL (IOC) is accepted for Combo orders.

    side OrderSide (string)

    Possible values: [BUY, SELL]

    BUY or SELL

    exec_inst ExecInstOrderDetail (string)[]

    Possible values: [POST_ONLY, REDUCE_ONLY, SMART_POST_ONLY]

    Execution instructions.

    quantity decimal

    Quantity specified in the order.

    limit_price decimal

    Limit price specified in the order.

    order_value decimal

    Order value.

    avg_price decimal

    Average price.

    cumulative_quantity decimal

    Cumulative executed quantity.

    cumulative_value decimal

    Cumulative executed value.

    cumulative_fee decimal

    Cumulative executed fee.

    status OrderStatus (string)

    Possible values: [PENDING, NEW, ACTIVE, FILLED, CANCELED, REJECTED, EXPIRED]

    Order status

    update_user_id string

    Updated user.

    order_date string

    Order creation date.

    instrument_name string

    E.g. BTCUSD-PERP.

    fee_instrument_name string

    Currency used for the fees.

    create_time int64

    Order creation timestamp (ms), e.g. "1771761038000".

    create_time_ns int64

    Order creation timestamp (nanosecond), e.g. "1771761038000000000".

    update_time int64

    Order update timestamp (ms), e.g. "1771761038000".

    reason string

    Rejection reason code; present for get-order-detail and get-order-history.

    ref_price decimal

    Trigger reference price (trigger legs only).

    ref_price_type string

    Possible values: [MARK_PRICE, INDEX_PRICE, LAST_PRICE]

    Price source used for ref_price: MARK_PRICE, INDEX_PRICE, or LAST_PRICE (trigger legs only).

    transaction_time_ns int64

    Transaction timestamp in nanoseconds.

  • ]
  • message string

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

    original string

    Present when code !== 0.