Common Enums

View as Markdown

Orders

EnumValues
Order sideBUY / SELL
Position sideBOTH / LONG / SHORT
Normal order typeLIMIT / MARKET
Condition order typeSTOP_MARKET / STOP_LIMIT / TAKE_PROFIT_MARKET / TAKE_PROFIT_LIMIT / TRAILING_STOP
Time in forceGTC / IOC / FOK / GTE_GTC
Trigger price typeMARK_PRICE / CONTRACT_PRICE
Order statusNEW / PENDING / PARTIALLY_FILLED / FILLED / CANCELED / REJECTED / PARTIALLY_FILLED_CANCELED

NEW means the order request has been accepted and returned. PENDING means the order has entered the pending or open-order state.

Positions

EnumValues
Margin mode request value1 cross, 2 isolated
Margin mode stringISOLATED / CROSS
Close trigger mode1 manual, 2 take profit, 3 stop loss, 4 liquidation

Integration rules

  • Treat enum values as case-sensitive wire values.
  • Preserve unknown values in logs and fail safely instead of silently mapping them to a known state.
  • Do not infer that every non-final order state is safe to retry. Query the order or reconcile it with a private WebSocket event.
  • Store both the original API value and the partner-facing display label so new values can be supported without changing historical records.

Order state handling

State groupValuesRecommended handling
Accepted or openNEW, PENDING, PARTIALLY_FILLEDKeep the order active and reconcile with WebSocket or REST updates.
CompletedFILLEDApply the final filled quantity and execution records.
Closed without full fillCANCELED, REJECTED, PARTIALLY_FILLED_CANCELEDStop active processing and preserve the reason and any executed quantity.