Skip to main content

Order Lifecycle

This page describes the states an order passes through from creation to completion, and maps them to the numeric status codes returned in REST responses and WebSocket notifications.


Order States​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Έβ”‚ INSERTED │──────────────┐
β”‚ β”‚ (status 2) β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β–Ό
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
Place β”‚ β”‚ PARTIALLY β”‚ β”‚ FULLY β”‚
Order β”‚ β”‚ FILLED β”‚ β”‚ TRANSACTED β”‚
β”‚ β”‚ (status 5) β”‚ β”‚ (status 4) β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚
β”‚ β–Ό
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚ CANCELLED β”‚
β”‚ β”‚ (status 6) β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ REJECTED β”‚ β”‚ TIMEOUT β”‚
β”‚ (status 15) β”‚ β”‚ (status -1) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Status Codes​

StatusConstantDescriptionTerminal?
-1TIMEOUTRequest timed out β€” the order may or may not have been placed. Query the order to confirm.No
2ORDER_INSERTEDOrder accepted and resting on the orderbookNo
4ORDER_FULLY_TRANSACTEDOrder completely filledYes
5ORDER_PARTIALLY_TRANSACTEDOrder partially filled β€” remaining size still restingNo
6ORDER_CANCELLEDOrder cancelled (by user, system, or expiry)Yes
7ORDER_REFUNDEDOrder refundedYes
8INSUFFICIENT_BALANCERejected β€” not enough fundsYes
9TRIGGER_INSERTEDTrigger/stop order accepted β€” waiting for trigger conditionNo
10TRIGGER_ACTIVATEDTrigger condition met β€” order converted to limit/marketNo
15ORDER_REJECTEDOrder rejected (invalid params, risk limits, etc.)Yes
65STATUS_ACTIVEOrder is activeNo
85STATUS_PROCESSINGOrder is being processedNo
88STATUS_INACTIVEOrder is inactiveYes
123AMEND_ORDEROrder amended successfullyNo

See Error Codes for the full enum table.


Typical Flows​

Limit order β€” fully filled​

Place order β†’ status 2 (INSERTED) β†’ status 4 (FULLY_TRANSACTED)

Limit order β€” partial fill then cancel​

Place order β†’ status 2 (INSERTED) β†’ status 5 (PARTIALLY_TRANSACTED)
β†’ Cancel request β†’ status 6 (CANCELLED)

Market order β€” immediate fill​

Place order β†’ status 4 (FULLY_TRANSACTED)

Market orders are usually filled immediately. You may not see status 2.

Stop/trigger order​

Place order β†’ status 9 (TRIGGER_INSERTED)
β†’ Price hits trigger β†’ status 10 (TRIGGER_ACTIVATED)
β†’ status 2 (INSERTED) β†’ status 4 or 5 (filled)

Rejected order​

Place order β†’ status 15 (REJECTED) or status 8 (INSUFFICIENT_BALANCE)

Check the message field in the response for the rejection reason.

Timeout​

Place order β†’ status -1 (TIMEOUT)

The order may or may not have been placed. Always query the order by clOrderID or orderID to confirm the actual state.


Tracking Orders in Real-Time​

Use the WebSocket notificationApiV3 topic (Spot) or notificationApiV4 topic (Futures) to receive status updates as they happen:

{
"topic": "notificationApiV3",
"data": {
"symbol": "BTC-USD",
"orderID": "990db9b6-...",
"status": 5,
"filledBaseSize": 0.5,
"totalFilledBaseSize": 0.5,
"remainingBaseSize": 0.5,
"avgFilledPrice": 36000.0
}
}

Recommended approach:

  1. Place order via REST β€” save the orderID
  2. Listen on notificationApiV3 for status updates matching your orderID
  3. When status is 4 (fully filled) or 6 (cancelled), the order is terminal

See WebSocket Guide for connection setup and Quickstart β†’ Step 4 for code examples.


Order Type Codes​

These numeric type codes appear in orderType fields:

CodeType
76Limit
77Market
80Peg / Algo
81OTC