Idempotency
Write requests take an Idempotency-Key header so a retried request never applies twice.
curl -X POST https://api.fabhub.app/v1/items \
-H "X-API-Key: $FABHUB_API_KEY" \
-H "Idempotency-Key: 0b9c4a2e-2f1d-4c7a-9b3e-2a1f5c8d7e6b" \
-H "Content-Type: application/json" \
-d '{"name":"Widget","itemType":"product"}'
Rules
- Generate a unique key per logical write (a UUID works well).
- Reuse the same key only for exact retries of that write.
- Do not reuse a key across different payloads - that returns
409withcode: "CONFLICT". - Keys are honored for 24 hours.
Where it applies
Idempotency-Key is required on every POST and PATCH write across items, orders, contacts, stock documents, and webhooks. DELETE operations are naturally idempotent and do not require the header.
With the SDK
The SDK takes an idempotencyKey option on every write method:
await fabhub.createItem(
{ name: 'Widget', itemType: 'product' },
{ idempotencyKey: crypto.randomUUID() },
);