Unknown Order State
This page covers the "unknown order state" failure mode after place_order failures.
Cause
FYERS does not provide client idempotency keys. If a network timeout occurs, the order may or may not have been accepted.
Symptom
OrderUnknownStateErroris raised.- The order id may be missing or only a request id is returned.
Resolution
- Check Order WS updates for the order id or request id.
- Call
orderbook()to confirm if the order exists. - Only retry once you have confirmed the order was not accepted.
What NOT To Do
- Do not retry immediately.
- Do not place a duplicate order to "fix" the state.
Scenario Example
Scenario: place_order returns a timeout and you see no WS updates. - Check orderbook() for recent orders. - If nothing is found, refresh token and retry once.