// glossary

Idempotency

An operation is idempotent if running it once or running it many times produces the same result.

Idempotent endpoints are safe to retry. PUT /resource/42 with the same body twice is the same as once: the resource ends up in that state. POST /transfers with $100 from A to B twice is NOT idempotent — without an idempotency key, it transfers $200.

Webhook handlers must be idempotent. Providers retry on 5xx, network blips, their own internal failures. Your handler will see the same event-id more than once. Keep a table of processed event-ids; if the inbound event is already there, return 200 without re-processing.

Stripe popularized the Idempotency-Key request header for client-side calls — you generate a UUID per logical operation, Stripe deduplicates server-side. Same idea, applied to outbound API calls instead of webhooks.

Read more

// shipping?

lrok gives your localhost a public HTTPS URL with a reserved subdomain on the free plan. Useful when this term comes up in a real integration:

$ curl -fsSL https://lrok.io/install.sh | sh
$ lrok http 3000

← all glossary terms