Shop Commander · Developers

Idempotency & Concurrency

Idempotency-Key for safe retries; expected_version so two writers never silently overwrite each other.

Idempotency-Key

Use a fresh Idempotency-Key for every logical command. A key is 1–255 visible ASCII characters (! through ~), is case-sensitive, and is scoped to one integration. Shop Commander stores an encrypted replay response for seven days and reserves the key as a non-replayable tombstone for 30 days.

POST /v1/repair-orders
Idempotency-Key: fleet-wo-2026-000813

Optimistic concurrency with expected_version

Mutable resources carry version (an integer that increments on every change). Include it in updates and domain actions:

PATCH /v1/customers/cus_…
{ "expected_version": 7, "email": "jane@example.com" }

If someone — a staff member in the app, another integration — changed the record since you read it, the API responds 409 conflict / version_conflict naming the current version. Re-read, merge, and try again. Omitting expected_version is allowed and means "last write wins"; use it whenever you edit a field a human might also edit.

Ordering and duplicates in webhooks

Webhook deliveries are at-least-once and unordered. De-duplicate on the event id and treat each delivery as a signal to GET the current object rather than as the object itself — see Webhooks.

Timeouts

Requests are cut off after 60 seconds at the edge. A timed-out command may or may not have committed: retry it with the same Idempotency-Key to find out safely.