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β
| Status | Constant | Description | Terminal? |
|---|---|---|---|
-1 | TIMEOUT | Request timed out β the order may or may not have been placed. Query the order to confirm. | No |
2 | ORDER_INSERTED | Order accepted and resting on the orderbook | No |
4 | ORDER_FULLY_TRANSACTED | Order completely filled | Yes |
5 | ORDER_PARTIALLY_TRANSACTED | Order partially filled β remaining size still resting | No |
6 | ORDER_CANCELLED | Order cancelled (by user, system, or expiry) | Yes |
7 | ORDER_REFUNDED | Order refunded | Yes |
8 | INSUFFICIENT_BALANCE | Rejected β not enough funds | Yes |
9 | TRIGGER_INSERTED | Trigger/stop order accepted β waiting for trigger condition | No |
10 | TRIGGER_ACTIVATED | Trigger condition met β order converted to limit/market | No |
15 | ORDER_REJECTED | Order rejected (invalid params, risk limits, etc.) | Yes |
65 | STATUS_ACTIVE | Order is active | No |
85 | STATUS_PROCESSING | Order is being processed | No |
88 | STATUS_INACTIVE | Order is inactive | Yes |
123 | AMEND_ORDER | Order amended successfully | No |
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:
- Place order via REST β save the
orderID - Listen on
notificationApiV3for status updates matching yourorderID - When
statusis4(fully filled) or6(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:
| Code | Type |
|---|---|
76 | Limit |
77 | Market |
80 | Peg / Algo |
81 | OTC |