Developers

Connect M1 Rewards to any system

Two ways, and you can use both. Your system calls our API to add points and redeem rewards. M1 Rewards calls your system — a signed webhook — the moment a member joins, earns or redeems.

Keys and webhooks are set up by the shop owner under Settings → Integrations, on every package.

Your till or checkout

Add points from every sale and redeem rewards without a second screen.

Your online shop

Members earn on web orders too, and see one balance everywhere.

Your ERP or CRM

Every join, point and reward arrives in your own records as it happens.

Your system calls us

The API

Every call is a POST with JSON to the address below, with your key in the Authorization header. A key only reaches the counter operations it was given, never your settings or staff.

Record a sale and add points
curl -X POST https://app.m1rewards.com/api/rpc/visit_record \
  -H "Authorization: Bearer m1r_your_key" \
  -H "Content-Type: application/json" \
  -d '{"phone": "0501234567", "amount": 45.00, "client_ref": "INV-10293"}'

Send client_ref with your own invoice number: if your till sends the same sale twice after a dropped connection, it is recorded once.

CallWhat it doesPermission
member_findFind a member by phone, member number or codemembers:read
member_enrolEnrol a new member with a phone numbermembers:write
person_scanRead the code a member shows from their phonemembers:read
points_previewSee what a bill would earn before recording itvisits:read
visit_recordRecord a sale and add the pointsvisits:write
visit_listList recent visitsvisits:read
rewardsThe shop's rewardsprogramme:read
rewards_for_memberWhat this member can have right nowredemptions:read
redemption_checkCheck a redemption before making itredemptions:read
otp_issueAsk the member to confirm on their phoneredemptions:write
otp_verifyCheck the code they confirm withredemptions:write
redemption_recordRedeem: take the points offredemptions:write
programme_getHow points are earned and worthprogramme:read
enrolment_channelsThe shop's join links and QR codesprogramme:read

The full list, live, with the details of each call: app.m1rewards.com/api/docs

We call your system

Webhooks

Give us an https address and choose the events. We send each one as it happens, signed with your secret.

member.joined
A member joined: at the counter, by QR code or through the API
points.earned
Points were added, with the member's new balance
points.spent
Points were spent, taken off or expired
reward.redeemed
A reward was redeemed, with its name and value
What arrives
POST  (your address)
X-M1R-Event: points.earned
X-M1R-Delivery: 7c9e6679-7425-40de-944b-e07fc1f90ae7
X-M1R-Signature: t=1795590000,v1=5d41402abc4b2a76b9719d911017c592...

{
  "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "event": "points.earned",
  "created_at": "2026-11-25T09:30:00Z",
  "business": "your-shop",
  "data": {
    "member": { "id": "…", "name": "Layla Haddad", "phone": "0501234567", "balance": 992 },
    "points": 45, "kind": "earn", "visit_id": "…"
  }
}
Check the signature

X-M1R-Signature is an HMAC-SHA256 of the time, a dot and the raw body, with your secret. Refuse anything that does not match or is more than five minutes old.

Answer 2xx, and expect retries

Answer with any 2xx within 10 seconds. Anything else is retried after 1, 5 and 30 minutes, then 2 and 12 hours. The same X-M1R-Delivery id comes with every retry, so you can ignore repeats.

// Node.js — check a webhook came from M1 Rewards
import crypto from "node:crypto";

function fromM1Rewards(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const expected = crypto.createHmac("sha256", secret)
    .update(parts.t + "." + rawBody).digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
  return fresh && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}

Need a hand connecting your system? [email protected] · Register your business

Try it with your own shop

Free while you try it. No card, and nothing to install on your till.