Skip to main content
Every Options order error carries error.slug and error.code next to its human-readable text in body, on the Order Management Stream, whether the order was sent over WebSocket or over HTTP: the HTTP routes answer 202 once the order is queued, and the engine reports its decision on the stream. The Error Reference describes the shape per transport and the SYS codes shared by every route; HTTP responses use only those. Options codes are OPT: OPT-00xx can answer any order command, OPT-01xx belongs to createOrder, OPT-02xx to cancelOrder, and OPT-03xx to modifyOrder. A condition shared by create and modify takes the same last two digits in both blocks. To send a refused request again, give it a new clientRequestId: the gateway answers a reused one with 409 for 60 seconds.

Any Order Command

createOrder

cancelOrder

modifyOrder

A refused modify leaves the original order unchanged.

cancelAllOrders

A sweep is refused only with OPT-0005, OPT-0006 or OPT-0007, and a refused sweep cancels nothing. The cancels a sweep expands into report as cancelOrder with the codes above; an order that fills before its cancel reports OPT-0004.

Shared Codes

The order routes also answer with these codes from the Error Reference: A snapshot request (emit*) that fails answers under its response resultType with SYS-0006 for a pageToken it cannot read, or SYS-0002 SERVER_ERROR otherwise. A snapshot changes nothing, so sending it again is safe.