Skip to main content
Every error has the same shape:
Branch on code, never on message. Codes are stable; messages are not.

origin tells you whether it happened

This is the field worth understanding, because it answers “did my order exist?” For a retry decision: gateway and port rejects are safe to fix and resend. A core reject is a real economic answer — resending unchanged gets the same result.

Common codes

Authentication

Your request was malformed

The exchange said no

Timeouts are not rejections

A 504 is the one case where “it failed” is the wrong assumption. The request timed out waiting for sequencing; it may well have been sequenced. Always resolve it with the same client_order_id — that is what the idempotency key is for. Retrying with a fresh id is how you end up with two orders.

Cancellations are not errors

Post-only orders that would cross, unfillable FOKs, IOC remainders and self-trade prevention all come back as a successful 201 with status: "canceled" and a reason. They are execution outcomes, not failures, so check status on success responses rather than assuming 201 means resting.