ErgOpsDocs

Idempotency

Every logistics write requires Idempotency-Key. Persist one key per logical shipment operation.

If a network timeout occurs, retry the identical material request with the same key. ErgOps returns the same logical result without creating another transport, calculation, usage event or webhook event. Reusing the same key with a different payload returns 409 IDEMPOTENCY_KEY_REUSED.

Idempotency state is stored durably and survives service restarts, deployments and client retries. A completed key is retained for at least 30 days; only a normalized fingerprint and minimum identifiers are retained, not the full API request body.

Idempotency-Key vs external_reference#

These identify two different things and are checked independently:

Idempotency-Key (header) external_reference (body field)
Identifies One retry attempt of one logical write The shipment in your own business system
Scope Per request Per organization and environment
Reuse with a different payload 409 IDEMPOTENCY_KEY_REUSED 409 EXTERNAL_REFERENCE_CONFLICT
Typical value A UUID or hash you generate per call Your order or shipment ID

Sending the same external_reference twice with the same Idempotency-Key is a safe retry. Sending the same external_reference with a new Idempotency-Key is treated as a second, conflicting attempt to create the same business record and is rejected — see Error handling.