Idempotency
Networks fail. Send an Idempotency-Key header with a write, and you can retry it without doing anything twice.
The header
Any unique string, for example a UUID. Sending the same request again with the same key within 24 hours returns the first response without doing anything twice. Reusing a key with a different body is refused with idempotency_key_reused. A refused request (4xx) frees the key so you can correct and resend it; a server error (5xx) is kept and returned again, because the write may already have happened: check the resource before retrying with a new key.
Shell
curl -X POST "$DAPI_API_URL/v2/orders/ord_123/cancel" \
-H "x-api-key: $DAPI_API_KEY" \
-H "Idempotency-Key: 8e7c6c1e-2f0a-4f7b-9d3e-5b1f0c2a9e41"Endpoints that accept it
- POSTQuote a model file
/v2/quotes - POSTRequest account approval
/v2/integrator/approval-requests - POSTCreate a product
/v2/products - POSTPublish a product
/v2/products/{id}/publish - POSTUnpublish a product
/v2/products/{id}/unpublish - POSTAdd a design to a product
/v2/products/{id}/designs - POSTAdd a variant
/v2/products/{id}/variants - POSTUpload a compliance document
/v2/products/{id}/compliance/documents - POSTCreate an order
/v2/orders - POSTCancel an order
/v2/orders/{id}/cancel - POSTOrder prints of your quotes
/v2/integrator/orders - POSTEstimate the shipping of an order
/v2/integrator/orders/shipping-estimate - POSTCancel an order
/v2/integrator/orders/{id}/cancel - POSTReview a quality check
/v2/qc-tickets/{id}/review - POSTReply on a QC conversation
/v2/qc-tickets/{id}/messages - POSTReport an issue with a delivered order
/v2/qc-tickets - POSTCreate a stock
/v2/stocks - POSTAdd a design to a stock
/v2/stocks/{id}/designs - POSTBuy stock batches
/v2/stock-purchases - POSTCreate an extra part
/v2/extras - POSTStart a file upload
/v2/uploads