Skip to content

Webhooks

Goal: get notified when something happens in a member’s loyalty activity, instead of polling.

Webhook endpoints (a URL + the event types you want) are configured per tenant in the Tessera merchant console — there’s no public /v1 call to register one yourself. Registering (or rotating) an endpoint returns its signing secret once; store it securely, the same way you would an API key.

typeFires when
redemption.requestedA redemption that needs merchant fulfillment was requested.
redemption.finalizedA redemption hold was finalized.
redemption.releasedA redemption hold was released.
fulfillment.requestedA fulfillment action is needed for a granted reward.
fulfillment.fulfilledA fulfillment was marked complete.
fulfillment.cancelledA fulfillment was cancelled.
points.pre_expiryA member’s points are approaching expiry.

Every delivery is the same JSON shape, regardless of type:

{
"id": "evt_...",
"type": "redemption.requested",
"created_at": "2026-07-24T12:00:00.000Z",
"tenant_id": "...",
"data": { "...": "event-specific fields" }
}

id is stable across retries and a manual replay — use it as your own de-dup key so reprocessing a redelivered event is a no-op.

Each delivery carries X-Loyalty-Signature: v1=<hex> and X-Loyalty-Timestamp, computed the same way as inbound event signing — HMAC-SHA256 over {timestamp}.{raw_body}, keyed on that endpoint’s own signing secret (not your connector signing secret, and not your API key — each webhook endpoint has its own).

import { createHmac, timingSafeEqual } from 'node:crypto';
function verify(rawBody: string, timestamp: string, signature: string, secret: string): boolean {
const expected = createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex');
const presented = signature.startsWith('v1=') ? signature.slice(3) : signature;
const a = Buffer.from(presented, 'hex');
const b = Buffer.from(expected, 'hex');
return a.length === b.length && timingSafeEqual(a, b);
}

Verify against the raw request bytes, before any JSON parsing or reformatting — re-serializing the body changes the signature.

If you rotate an endpoint’s secret, the previous secret still verifies for a 24-hour grace window so in-flight deliveries signed with it aren’t rejected.

A delivery moves queued → delivering → delivered (any 2xx response within 10 seconds) or, on a non-2xx response, timeout, or error, retrying with jittered geometric backoff (roughly 1s, 5s, 25s, … capped at 1 hour between attempts) for up to 10 attempts, then dead_letter. Once delivered or dead_letter, a delivery only moves again via a manual replay (which reuses the same event id). Respond 2xx quickly and do slow work asynchronously — a slow response counts as a failed attempt.

See Error handling for handling dead_letter/replay in your own alerting.