Skip to content

Errors & the envelope

Every error — across every endpoint — comes back as the same JSON shape:

{
"error": {
"code": "insufficient_balance",
"message": "The member does not have enough spendable points for this redemption.",
"details": { "shortfall": 120 },
"request_id": "req_9f8e7d6c5b4a3210"
}
}

request_id is also echoed as an X-Request-Id response header on every request (success or error) — include it when you contact support about a specific call.

codeHTTP statusWhen
invalid_request400The request is malformed — a missing/wrong-typed field, a bad query param, a missing Idempotency-Key header where one is required.
unauthorized401The bearer credential is missing, unrecognized, or revoked.
signature_invalid401An event’s X-Loyalty-Signature is missing or doesn’t verify.
replay_detected401An event’s timestamp is outside the accepted skew window, or its nonce was already used.
publishable_key_forbidden403A publishable key called an endpoint that requires a secret key.
insufficient_scope403The credential (e.g. an OAuth token) lacks the required scope for this endpoint.
forbidden403The credential is valid but not permitted to perform this action.
tier_gated403The redemption option requires a tier the member hasn’t reached.
not_found404The referenced resource (e.g. a redemption option) doesn’t exist in this tenant.
program_not_published404POST /v1/earn/preview: no published programme version is in force for the programme asked about.
customer_not_found404No member matches the given (channel, external_id) or customer_uuid in this tenant.
not_enrolled404The customer is not a member of the programme (POST /v1/checkout-redemptions).
redemption_not_found404No redemption hold matches the given ID in this tenant.
customer_erased410The customer’s PII was erased (a GDPR deletion) — profile writes/reads on this identity are no longer possible.
conflict409A generic state conflict. On POST /v1/checkout-redemptions: this Idempotency-Key’s earlier attempt is already resolved: it was rolled back (you may not have received that 503), cancelled, used at checkout, or it expired. No redemption is pending under this key; to redeem again, place with a new key.
idempotency_key_reuse409An Idempotency-Key was reused with a materially different request.
idempotency_key_conflict409An event’s Idempotency-Key header didn’t match its body’s idempotency_key.
version_conflict409An optimistic-concurrency conflict updating a config record.
cap_reached409A per-member redemption cap for this option was already hit.
not_stackable409The option can’t be combined with another the member is already redeeming.
hold_already_released409The redemption hold was already released — it can no longer be finalized.
shopify_not_connected409The workspace has no connected Shopify store (POST /v1/checkout-redemptions).
customer_merged409The target customer identity was merged into another; retry against the surviving identity.
insufficient_balance422The member doesn’t have enough spendable points (see details.shortfall).
option_not_eligible422The redemption option isn’t eligible for this member/cart right now.
preview_input_required422POST /v1/earn/preview: an overwrite campaign may apply and the input sent cannot decide it (details.needs names the input), so any figure could misstate the earn.
event_type_not_earnable422POST /v1/earn/preview: the type is not purchase; no earn rule hooks any other event type.
invalid_payload422An event body parsed as JSON but failed the event contract’s validation.
unsupported_event_type422The event’s type isn’t one Tessera recognizes.
profile_validation_error422A profile field (email, birthday, …) failed semantic validation.
payload_too_large413The request body exceeded the size limit.
not_implemented501A referenced configuration option is valid vocabulary but not implemented yet. Reserved — no endpoint currently returns it.
rate_limited429The per-member redemption velocity limit was hit — retry after the duration in the Retry-After header.
redemption_unavailable503A checkout redemption could not be armed in Shopify, so it was released and nothing is held. Its Idempotency-Key is spent: retry with a new key. The SDK does not retry it.
internal_error500An unexpected failure. Safe to retry; include request_id if you report it.

New codes can be added over time (see Changelog & versioning) — always fall back to generic handling (log the code, surface the message, retry on 5xx/429) for a code you don’t recognize yet, rather than treating an unknown code as a hard failure.

See Error handling for retry and logging patterns in practice.