Documentation Index
Fetch the complete documentation index at: https://stabyl.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Idempotency-Key is required for order create, cancel, and replace requests.
idempotency_key appears in the JSON body, it must match the Idempotency-Key header.
What Counts As The Same Intent
Use one idempotency key for one business action:| Action | Same intent |
|---|---|
| Create order | Same pair, side, type, quantity, price, and account |
| Cancel order | Same order ID and cancel attempt |
| Replace order | Same original order ID and replacement values |
Storage Pattern
Store the idempotency key before sending the API request.order_id, attach it to the local action. If the request times out, retry with the same key and then reconcile the returned order state.
Response Handling
| Response | Meaning | Recommended action |
|---|---|---|
2xx | Request accepted or previous matching request replayed | Store returned IDs and read status |
400 | Request is malformed or invalid | Fix the request before retrying |
401 | API key missing or invalid | Stop and rotate or correct credentials |
409 | Key or current resource state conflicts | Read the existing resource or create a new intent |
429 | Too many requests | Back off and retry with the same key |
5xx | Outcome may be uncertain | Retry with the same key, then reconcile |
Checklist
- Store the key with your local order action before sending the request.
- Retry uncertain responses with the same key.
- Generate a new key only for a new intent.
- Treat
409as an idempotency or current-state conflict. - Never use timestamps alone as idempotency keys; use a UUID or similarly unique value.
- Keep idempotency keys out of logs if your logs are widely accessible.