CropPath for developers

All guides

Idempotency keys

Available

Retry a create safely: the repeat gets the first response instead of running again.

Send an Idempotency-Key header (1 to 255 visible ASCII characters; a UUID is a good choice) with a POST. The key belongs to your tenant and to you: no other caller can use it.

curl -sS https://<host>/v1/lots \
  -H "Authorization: Bearer $CROPPATH_TOKEN" \
  -H "Idempotency-Key: 6f1c2e0a-8d0b-4c1e-9a55-3b2f7f1d9e42" \
  -H "Content-Type: application/json" \
  -d '{"code": "LO-260928-014", "facility": "VN-TGPH-021"}'

When the first request succeeds, its response is stored and replayed for 24 hours to every request with the same key, method, path, query and body, with the header Idempotent-Replayed: true. The same key with another request gets 422 idempotency_key_mismatch; while the first request is still running, 409 idempotency_key_in_use with Retry-After.

A request that fails before anything is written frees its key: correct it and send it again with the same key. The API reference shows the header on every operation that takes it.

In the API reference