Webhooks

Setting up

A business adds its own webhook address on its dashboard, in the Webhooks card on the Messaging tab. Only a team member in the Connections group can do this; the Owner has that group by preset, a Manager does not. The business gives the address a name and the address itself, and is shown a signing secret, which starts with whsec_. It is shown once: the business passes it to you and you store it like a password. A business can hold up to 10 webhook addresses. The ConvertPlus team can also add an address for a business, at its request.

Rules for the address:

The verification challenge

When the address is set up we send one endpoint.verification message. It is signed like every other message, and looks like this:

The challenge

{
  "event": "endpoint.verification",
  "event_id": "endpoint.verification:whe_5b1e…",
  "schema_version": 1,
  "occurred_at": "2026-10-03T12:34:56.789Z",
  "client_id": "cli_…",
  "campaign_id": null,
  "branch_id": null,
  "data": { "challenge": "0f1e2d3c4b5a69788796a5b4c3d2e1f0" }
}

Answer with a 2xx status and a JSON body, at most 4096 bytes, whose top-level challenge is exactly the value you were sent:

Your answer

{ "challenge": "0f1e2d3c4b5a69788796a5b4c3d2e1f0" }

The message

Every message is an HTTP POST to your address with a JSON body, sent on a fresh connection, one message at a time.

HeaderValue
Content-Typeapplication/json. The body is UTF-8.
User-AgentConvertPlus-Webhook/1
X-ConvertPlus-Signaturet=<unix seconds>,v1=<hex>, or two v1 values while a secret is being replaced. See below.
X-ConvertPlus-Event-IdThe same value as event_id in the body.
X-ConvertPlus-Schema-VersionThe same value as schema_version in the body.

A message body

{
  "event": "reward.unlocked",
  "event_id": "reward.unlocked:l48211",
  "schema_version": 1,
  "occurred_at": "2026-10-03T12:34:56.789Z",
  "client_id": "cli_…",
  "campaign_id": "cmp_…",
  "customer": {
    "ref": "usr_3f9a1c2b4d5e6f70",
    "phone_sha256": "…64 hex characters…",
    "email_sha256": ""
  },
  "branch_id": null,
  "data": {
    "reward_name": "Free coffee",
    "pool_ref": "loyalty:main",
    "pool_name": "Coffee card",
    "earned_by": "earned",
    "claim_by": "2026-11-02T12:34:56.789Z",
    "referral_role": null
  }
}

Events

EventWhen it is sent
visit.recordedA visit was recorded for a known customer - scanned by the customer, logged by staff, or reported through this API.
reward.unlockedA customer earned a reward (any way except winning a draw), or spent points on one. Both people in a referral get their own event.
reward.claimedStaff handed a reward over to the customer.
lottery.wonA draw took place and this customer won. A draw win is never also sent as reward.unlocked.
loyalty.progressA visit added points to the customer's balance.
streak.progressA visit was counted on a visit ladder - every counted visit, not only the ones that reach a reward.
passport.progressA visit stamped a branch the customer had not visited before on a branch passport.
endpoint.testA test message, sent when Send test is pressed for your address, by the business on its dashboard or by the ConvertPlus team. It names no customer and no campaign.
endpoint.verificationSent once, when your address is first set up. Nothing else is sent until you answer it correctly.

visit.recorded

A visit was recorded for a known customer - scanned by the customer, logged by staff, or reported through this API.

This event carries the customer object.

Key in dataTypeAlways thereMeaning
channelstring or null: scan, staff, apiyesHow the visit was recorded: scan (the customer's own page), staff (logged on the dashboard), api (reported through this API). Null on old history.
transaction_valuenumber or nullyesThe bill amount, when one was given.

reward.unlocked

A customer earned a reward (any way except winning a draw), or spent points on one. Both people in a referral get their own event.

This event carries the customer object.

Key in dataTypeAlways thereMeaning
reward_namestring or nullyesThe reward's name.
pool_refstring or nullyesWhich part of the campaign gave the reward. Treat it as opaque.
pool_namestring or nullyesThat part's name as the business wrote it.
earned_bystring or nullyesHow it was earned: referral, points_spent, or a word such as earned, granted or compensation.
claim_bystring or nullyesThe last moment to claim it (UTC), or null when it does not lapse.
referral_rolestring or null: referrer, referredyesOn a referral reward, which side this customer is.

reward.claimed

Staff handed a reward over to the customer.

This event carries the customer object.

Key in dataTypeAlways thereMeaning
reward_namestring or nullyesThe reward's name.
pool_refstring or nullyesWhich part of the campaign gave the reward. Treat it as opaque.
pool_namestring or nullyesThat part's name as the business wrote it.

lottery.won

A draw took place and this customer won. A draw win is never also sent as reward.unlocked.

Carries EITHER reward_name (a prize) OR points (points added to the balance) - the other key is absent.

This event carries the customer object.

Key in dataTypeAlways thereMeaning
draw_namestring or nullyesThe draw's name.
roundinteger or nullyesWhich round of the draw.
reward_namestring or nullnoThe prize, when the win is a prize.
pointsnumber or nullnoThe points won, when the win is points.
claim_bystring or nullyesThe last moment to claim a prize (UTC). Null for a points win.

loyalty.progress

A visit added points to the customer's balance.

This event carries the customer object.

Key in dataTypeAlways thereMeaning
points_earnednumber or nullyesPoints added by this visit.
balancenumber or nullyesThe balance after it.
tierstring or nullyesThe customer's tier name, or null.

streak.progress

A visit was counted on a visit ladder - every counted visit, not only the ones that reach a reward.

This event carries the customer object.

Key in dataTypeAlways thereMeaning
pool_refstring or nullyesWhich visit ladder. Treat it as opaque.
visit_countnumber or nullyesVisits counted on the ladder so far.
positionnumber or nullyesWhere the customer stands on the ladder.
next_milestonenumber or nullyesThe visit count of the next reward. Null at the top.

passport.progress

A visit stamped a branch the customer had not visited before on a branch passport.

This event carries the customer object.

Key in dataTypeAlways thereMeaning
pool_refstring or nullyesWhich passport. Treat it as opaque.
stampsnumber or nullyesBranches stamped so far.
stamps_requirednumber or nullyesBranches needed to complete it.
stamped_branchstring or nullyesThe branch this visit stamped. (branch_id on the message itself is null for this event.)

endpoint.test

A test message, sent when Send test is pressed for your address, by the business on its dashboard or by the ConvertPlus team. It names no customer and no campaign.

This event has no customer object.

data is empty: {}.

endpoint.verification

Sent once, when your address is first set up. Nothing else is sent until you answer it correctly.

This event has no customer object.

Key in dataTypeAlways thereMeaning
challengestringyes32 lower-case hex characters. Send the same value back.

Verifying the signature

Check the signature of every message before you trust it.

  1. Keep the request body exactly as received, as raw bytes. Do not parse it and write it out again first.
  2. Read X-ConvertPlus-Signature. Split it on commas. Take the t value and every v1 value.
  3. Build the signed text: the t value, a dot, then the raw body.
  4. Compute HMAC-SHA256 of that text with your signing secret as the key, and write it as lower-case hex. The key is the whole secret you were given, including whsec_.
  5. Accept the message if any v1 value equals what you computed, with any secret you currently hold. Compare in constant time.
  6. Reject a message whose t is far from your own clock. We suggest five minutes. We do not enforce a window; you should.

Node.js

const crypto = require('node:crypto');

// rawBody: the body exactly as received (a Buffer). header: X-ConvertPlus-Signature.
// secrets: every signing secret you hold now (two while one is being replaced).
function verify(rawBody, header, secrets, toleranceSeconds = 300) {
  const parts = String(header || '').split(',');
  const t = (parts.find((p) => p.startsWith('t=')) || '').slice(2);
  const sent = parts.filter((p) => p.startsWith('v1=')).map((p) => p.slice(3));
  if (!/^[0-9]+$/.test(t) || sent.length === 0) return false;
  if (Math.abs(Date.now() / 1000 - Number(t)) > toleranceSeconds) return false;
  for (const secret of secrets) {
    const expected = crypto.createHmac('sha256', secret).update(t + '.').update(rawBody).digest('hex');
    for (const sig of sent) {
      if (sig.length === expected.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))) return true;
    }
  }
  return false;
}

Python

import hashlib
import hmac
import time

# raw_body: the body exactly as received (bytes). header: X-ConvertPlus-Signature.
# secrets: every signing secret you hold now (two while one is being replaced).
def verify(raw_body, header, secrets, tolerance_seconds=300):
    parts = (header or '').split(',')
    t = next((p[2:] for p in parts if p.startswith('t=')), '')
    sent = [p[3:] for p in parts if p.startswith('v1=')]
    if not t.isdigit() or not sent:
        return False
    if abs(time.time() - int(t)) > tolerance_seconds:
        return False
    for secret in secrets:
        signed = t.encode('ascii') + b'.' + raw_body
        expected = hmac.new(secret.encode('utf-8'), signed, hashlib.sha256).hexdigest()
        if any(hmac.compare_digest(sig, expected) for sig in sent):
            return True
    return False

Replacing a secret without an outage. When a secret is replaced, every message is signed with both the new secret and the old one, so the header carries two v1 values, the new one first. The business chooses Replace secret on the Webhooks card and passes you the new secret. Install it, then tell the business, which chooses Remove old secret. (The ConvertPlus team can do both steps for a business too.) A secret cannot be replaced again until the old one has been removed. A secret is shown once; a lost secret means a replacement.

t is the time of that attempt. A retry or a replay carries a new t and a new signature over the same body.

What counts as delivered

Retries, messages set aside, and pause

Duplicates, event ids and replay

Delivery is at least once. You can receive the same event more than once: when your 2xx answer was lost or came after the 10 seconds, when a send was interrupted on our side, or when a message was sent again on request.

Customer details: hashed unless switched on