Skip to content

Idempotency

A network timeout after you’ve sent a request is ambiguous — did the redemption hold get placed or not? Tessera’s idempotency support means “retry the exact same request” is always safe: you get back the original result, never a duplicate hold, a double-earned event, or a second charge.

The exact mechanism differs by endpoint:

Redemptions — the Idempotency-Key header

Section titled “Redemptions — the Idempotency-Key header”

POST /v1/redemptions requires an Idempotency-Key header. Retry the same request with the same key and you get back the same hold — Tessera never places a second one. Omit the header and the request is rejected with invalid_request (400) before anything is reserved.

Idempotency-Key: 3f29b6b0-9e0a-4b0e-8f0a-6a0d5e6c7b8a

Generate a fresh key per logical redemption attempt (a UUID is the common choice), and reuse the same key only when retrying that exact attempt.

POST /v1/events dedups on the idempotency_key field inside the (signed) request body, not a header. Namespace it so it’s unique per event across your integration — e.g. shopify:ord_9001-purchase rather than just the order ID:

{ "idempotency_key": "shopify:ord_9001-purchase", "...": "..." }

Resending the identical body is a no-op: the response reports "status": "duplicate" instead of re-processing the event. You may also send an Idempotency-Key header on this endpoint, but if you do, it must exactly echo the body’s idempotency_key — a mismatch is rejected with idempotency_key_conflict (409), since the header and body disagreeing on “which request is this” is itself a signal something is wrong.

Enrolling members — naturally idempotent

Section titled “Enrolling members — naturally idempotent”

POST /v1/customers needs no idempotency key at all: it resolves-or-creates keyed on (channel, external_id), so calling it twice with the same identity is always safe — the second call just merges into the same customer and reports "created": false.

See Errors & the envelope for what a conflicting retry looks like on the wire, and Redemptions & holds / Earning events for these in context.