Idempotency & retries
Retries are safe and free when you send an Idempotency-Key.
How it works#
Send an Idempotency-Key header (any string up to 128 characters of letters, digits, . : _ -). The first request is charged and its result stored. A retry with the same key returns the stored result with credits_used: 0 and cached: true, even if the first response never reached you.
Example
curl https://app.veridock.io/v1/verify \
-H "Authorization: Bearer vd_live_…" \
-H "Idempotency-Key: signup-7f3a9c" \
-H "Content-Type: application/json" \
-d '{"email":"person@example.com"}'Pick a key that means something
Use the id of the thing you are verifying (a signup, a CRM row). Keys are scoped to your account, so the same key from two keys of yours still counts once.
Why you are never double-charged#
Credits are deducted with a single conditional update in the database and every change writes a ledger row with a unique (account, request id). Two concurrent requests can never both succeed when only one fits your quota, and a replayed key can never deduct twice.
Related