Webhooks
Outbound webhooks send a signed HTTPS POST to your server when loyalty events happen, such as points earned or a VIP tier change. Messages follow the Standard Webhooks specification.
In short
- Add endpoints under Settings → Developers → Set up webhooks, or through the API.
- Check the
webhook-signatureheader with your signing secret before trusting a message. - Answer with a 2xx within 15 seconds. Failed deliveries are retried for about 3 days.
Before you start#
- An HTTPS endpoint on the public internet that accepts
POSTrequests. - Access to the raw request body on your server, so you can check the signature.
- A safe place to store the signing secret (it starts with
whsec_).
Add an endpoint#
- In the app, go to Settings → Developers and click Set up webhooks (or Manage webhooks).
- Click Add endpoint.
- Enter the Endpoint URL: an HTTPS address on the public internet (up to 2,048 characters, no user name or password).
- Optionally add a Description (up to 200 characters). Only you see it.
- Under Events, pick the topics this endpoint gets, or click Select all.
- Click Create, then copy the signing secret from the Endpoint added window.
- Under Manage, use Send a test to check that your server answers with a 2xx status.
A store can have up to 50 endpoints, including those added by apps such as Zapier. Endpoints added by an app show Added by and the app’s name.
Apps and your own systems can also manage endpoints through the API with the manage:webhooks scope. See the API reference.
Topics#
| Topic | Label in the app | Sent when |
|---|---|---|
customer.enrolled |
Customer enrolled | A customer joins the program. |
points.earned |
Points earned | Points become spendable: from an order, a way to earn, a campaign bonus, a reward or a referral. Pending points are sent when released. Past-order imports send nothing. |
points.adjusted |
Points adjusted | Points are added or removed by hand: in the app, through the API, Shopify Flow, a CSV upload or a reversed review reward. |
points.redeemed |
Points redeemed | A customer spends points on a reward. |
redemption.cancelled |
Redemption cancelled | A redemption is cancelled or deleted in the app, and its points go back. |
points.expiring |
Points expiring | A reminder that points expire soon: the first warning, then the last chance. |
points.expired |
Points expired | Points expire. |
tier.changed |
VIP tier changed | A customer moves up or down a VIP tier, or out of every tier (to is null). |
referral.completed |
Referral completed | A referred friend places a qualifying order, or signs up when referral rewards pay at signup. |
Message format#
Every message is JSON with type (the topic), timestamp and data. Test messages also carry "test": true.
Point topics carry the activity as the API’s /activities returns it. They also carry customer, with the balance right after the event.
Example: points.earned#
{
"type": "points.earned",
"timestamp": "2026-11-06T10:00:00.000Z",
"data": {
"id": 1001,
"customer_id": "1234567890",
"type": "earn",
"status": "available",
"points": 100,
"description": "Order #1001 - Points for purchases",
"source": "online",
"order_id": "5550001",
"earn_rule_id": 12,
"created_at": "2026-11-06T10:00:00.000Z",
"customer": {
"id": "1234567890",
"email": "customer@example.com",
"points": 1250,
"pending_points": 100,
"points_owed": 0,
"lifetime_points": 3400
}
}
}
Example: tier.changed#
{
"type": "tier.changed",
"timestamp": "2026-11-06T10:00:00.000Z",
"data": {
"customer": { "id": "1234567890", "email": "customer@example.com", "points": 1250, "pending_points": 100, "points_owed": 0, "lifetime_points": 3400 },
"from": { "id": "tier_silver", "name": "Silver", "threshold": 1000 },
"to": { "id": "tier_gold", "name": "Gold", "threshold": 3000 },
"direction": "up",
"pinned": false
}
}
pinned is true when the tier was set by Shopify Flow or a CSV upload rather than earned. The full schema for every topic is in the webhooks section of /public/v1/openapi.json.
Verify signatures#
Each request has three headers:
webhook-id: the message ID. It stays the same on every retry and replay, so use it to ignore duplicates.webhook-timestamp: Unix seconds when this attempt was sent.webhook-signature: one or more space-separatedv1,<base64 signature>values.
The signature is an HMAC-SHA256 of id.timestamp.body. The key is the base64-decoded part of your secret after whsec_. Sign the raw request body exactly as received, before any JSON parsing.
Any Standard Webhooks library can check it, or use this Node.js example:
import crypto from "node:crypto";
import express from "express";
const SECRET = "whsec_…"; // load from your secret store
const TOLERANCE_SECONDS = 5 * 60;
function verifyWebhook(secret, headers, rawBody) {
const id = headers["webhook-id"];
const timestamp = headers["webhook-timestamp"];
const signatures = headers["webhook-signature"] || "";
if (!id || !timestamp) return false;
const age = Math.abs(Math.floor(Date.now() / 1000) - Number(timestamp));
if (!Number.isFinite(age) || age > TOLERANCE_SECONDS) return false;
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
const expected = crypto
.createHmac("sha256", key)
.update(`${id}.${timestamp}.${rawBody}`)
.digest("base64");
return signatures.split(" ").some((entry) => {
const [version, signature] = entry.split(",");
if (version !== "v1" || !signature) return false;
const given = Buffer.from(signature);
const wanted = Buffer.from(expected);
return given.length === wanted.length && crypto.timingSafeEqual(given, wanted);
});
}
const app = express();
app.post("/loyalty-webhooks", express.raw({ type: "application/json" }), (req, res) => {
const rawBody = req.body.toString("utf8");
if (!verifyWebhook(SECRET, req.headers, rawBody)) return res.status(401).end();
const event = JSON.parse(rawBody);
// Answer fast, then process event.type / event.data in the background.
res.status(200).end();
});
The timestamp check guards against replayed requests. How much clock difference to allow is up to you. 5 minutes is the usual choice in Standard Webhooks libraries.
Rotate the secret#
Under Manage, the Signing secret section has Show secret and Rotate secret. After a rotation, requests are signed with the new secret. For 24 more hours they are also signed with the old one, so the header carries two signatures. Update your server within that time.
Retries and failures#
- Success is any 2xx answer within 15 seconds. Redirects are not followed, so a 3xx counts as a failure.
- Retries: a failed delivery is tried again after 5 seconds, 5 minutes, 30 minutes, 2, 5, 10, 14, 20 and 24 hours: 10 attempts over about 3 days.
- 429: a
Retry-Afterheader is honoured, up to 24 hours. - 410 Gone: an endpoint added in the app is turned off; one added through the API is deleted.
- Failing for 5 days: if every delivery to an endpoint fails for 5 days, it is turned off and the store owner gets an email. An endpoint that an app added and that stays off is deleted after 30 days.
Return 2xx as soon as you’ve checked the signature, then do slow work in the background. Answers slower than 15 seconds count as failures and are retried.
Delivery log, tests and replays#
The Delivery log on the Webhooks page lists every request of the last 30 days. Filter by endpoint or status. Click View to see the webhook-id, the request body, the last answer and any error.
- Send a test: under Manage, pick an Event and click Send test. Sample data marked as a test is sent, even while the endpoint is off.
- Replay one delivery from the log. It is sent again with the same
webhook-id. - Replay since: resends every event since a time you pick that this endpoint didn’t receive, up to 30 days back.
Replays need the endpoint to be on.
Turn off or delete an endpoint#
- Turn off: under Manage, turn off Active to stop sending to the endpoint. Turning it back on doesn’t send what it missed. Use Replay since for that.
- Delete: Delete endpoint stops events at once and deletes its delivery log. This can’t be undone.