Loymore
API and webhooks
With the API you stamp and create customers from your register or your systems; with webhooks we tell you about every stamp, reward and new customer; and Shopify and WooCommerce stores and the Square register add every sale to the card with no code. Everything is switched on in the panel, under Integrations (Total plan, owner only).
Authentication
Create a key under Integrations → API keys and send it with every call as Authorization: Bearer wl_live_…. The key is shown once; if you lose it, revoke it and create another. Base: https://loymore.app/api/v1 (the previous host, loyalty.eklevertech.com, keeps answering with the same keys during the transition). JSON responses; errors come as { "error": "…", "code": "…" } with their HTTP status (400 invalid_request with an issues list, 401 invalid key, 403 plan without API, 402 trial ended, 404 not found, 409 program rule, 429 rate limit). Error messages are in English and the codes are stable: program against code, never against the text.
curl https://loymore.app/api/v1/me -H "Authorization: Bearer wl_live_XXXXXXXX"
The customer
Every response and every webhook describes the customer the same way:
{
"id": "6f1c2d3e-…",
"name": "Ana Pérez",
"email": "ana@example.com",
"phone": "+17875551234",
"birthday": null,
"program": { "id": "…", "slug": "tarjeta-de-lealtad", "type": "stamps", "name": "Loyalty card", "unit": "stamps" },
"stamps": { "balance": 3, "required": 8 },
"rewardsAvailable": 1,
"visitsTotal": 12,
"balances": { "points": 0, "creditCents": 0, "visitsLeft": 0, "lifetimeSpendCents": 0 },
"discount": null,
"offer": null,
"tier": { "id": "silver", "name": "Silver", "benefit": "10% off drinks" },
"shortCode": "6f1c2d3e",
"cardUrl": "https://loymore.app/c/6f1c2d3e-…",
"createdAt": "2026-11-01T12:00:00+00:00",
"lastVisitAt": "2026-11-22T20:00:00+00:00"
}
shortCode is the 8 characters under the card's barcode: what your POS scanner reads. tier is null when the business does not use tiers. program says which card the customer holds and what it counts in (stamps, points, cents, visits, or none on a tiered discount); balances carries points, store credit in cents, visits left on a pass and lifetime spend; discount is the tier and its percentage (tiered discount only); offer is the welcome offer (pending, redeemed, expired) when the card has one.
Endpoints
GET /api/v1/me
Your business, your program (stamps required, reward, spend rules, barcode type), the programs list of all your active cards with their type, and the key in use.
GET /api/v1/members
One exact customer with ?email=, ?phone= or ?code= (returns 0 or 1); a search with ?q=; or the whole list, newest first, with ?limit= (max 100) and ?cursor=.
curl "https://loymore.app/api/v1/members?email=ana@example.com" -H "Authorization: Bearer wl_live_…"
# → { "data": [ { …customer… } ], "nextCursor": null }
POST /api/v1/members
Creates a customer with their card (201). If the email or phone already exists, returns the existing customer with "existing": true (200). Send the cardUrl link to the customer so they add the card to their wallet.
curl -X POST https://loymore.app/api/v1/members -H "Authorization: Bearer wl_live_…" -H "Content-Type: application/json" \
-d '{ "name": "Ana Pérez", "email": "ana@example.com", "phone": "787-555-1234" }'
GET /api/v1/members/{id}
One customer by id.
GET /api/v1/members/{id}/events
Their history (stamps, undos, redemptions, passes), newest first; ?limit= up to 200.
POST /api/v1/stamps
Gives stamps. Name the customer with one of id, code, email or phone. The scanner's rules apply: count (default 1) or, when the program stamps by spend, saleAmount decides how many; invoiceNumber when the program requires it (an invoice is stamped once); the daily limit. idempotencyKey (a UUID of yours) makes a retry harmless: same answer, no extra stamp. When the business runs several cards, programId (id or slug) says which; without it the oldest card is used, as always (by id the customer resolves on their own card; by code on another card: 404 not_found), and when by email or phone the person holds several we answer 409 ambiguous_member.
curl -X POST https://loymore.app/api/v1/stamps -H "Authorization: Bearer wl_live_…" -H "Content-Type: application/json" \
-d '{ "member": { "code": "6f1c2d3e" }, "saleAmount": 25, "invoiceNumber": "A-1041", "idempotencyKey": "9b2f…" }'
# → { "member": { … }, "stamp": { "id": "…", "delta": 2 }, "earned": [ { "id": "…", "type": "full_card", "name": "Free coffee" } ], "duplicate": false }
POST /api/v1/redemptions
Redeems one of the customer's rewards: the oldest, or the one you name with rewardId (ids come in earned or on the customer's page). programId as in /stamps. Answers the updated customer, redeemed and the rewards they have left.
curl -X POST https://loymore.app/api/v1/redemptions -H "Authorization: Bearer wl_live_…" -H "Content-Type: application/json" \
-d '{ "member": { "email": "ana@example.com" } }'
POST /api/v1/transactions
The counter of the points, store credit, tiered discount and visit pass cards (and the welcome offer of any card). Name the customer as in /stamps; it acts on their card (when the same person holds several, programId with the id or slug picks one). kind by type:
- Points:
earnwithamountCents(the purchase, in cents) adds points by the card's rule;spendwithcatalogItemIdredeems a catalog reward. - Store credit:
earnwithamountCentsaccrues the percentage;spendwithamountCentsuses credit on a purchase. - Tiered discount:
salewithamountCentsrecords the purchase; the tier rises by itself. - Visit pass:
usetakes one visit;loadreloads (countvisits, default the whole pass;amountCentsoptional as the price). - Any card:
offer_redeemredeems the pending welcome offer.
invoiceNumber when the card requires it; locationId and idempotencyKey as in /stamps. Double hours apply on their own. A stamp card answers 400 invalid_kind: use /stamps for it. When the same person holds several cards and you pass no programId: 409 ambiguous_member. Other refusals: amount_required, below_minimum, sale_required, item_required, unknown_item, insufficient_points, insufficient_credit, insufficient_balance, no_visits_left, invalid_visits, no_offer, duplicate_invoice.
curl -X POST https://loymore.app/api/v1/transactions -H "Authorization: Bearer wl_live_…" -H "Content-Type: application/json" \
-d '{ "member": { "code": "6f1c2d3e" }, "kind": "earn", "amountCents": 1250, "invoiceNumber": "A-1042", "idempotencyKey": "4c7d…" }'
# → { "member": { …, "balances": { "points": 132, … } },
# "transaction": { "id": "…", "kind": "earn", "unit": "points", "delta": 12, "balanceAfter": 132, "multiplier": 1, "meta": { "amountCents": 1250 }, "expiresAt": null },
# "duplicate": false }
GET /api/v1/menu
The business's digital menu as stored (not only what customers see): enabled (the switch), live (on, with a plan that includes it), the public page url, mode (items or pdf), languages (primaryLanguage, languages), currency and tax note, and the sections in order with every product, sold-out ones too (available: false) and empty sections. Each product carries name/description in the primary language, its translations in i18n ({ "en": { "name", "description" } }), priceCents and price (formatted), isNew, tags, photoUrl and reward: the card reward it is linked to (kind, programId, programName, label, cost, unit) or null. In PDF mode, pdfUrl and pages (images with width/height). menu is null while the business has never opened Menu in the panel. Read-only: the menu is edited in the panel.
curl https://loymore.app/api/v1/menu -H "Authorization: Bearer wl_live_…"
# → { "menu": { "enabled": true, "live": true, "url": "https://loymore.app/m/cafe-mar-azul", "mode": "items",
# "primaryLanguage": "es", "languages": ["es", "en"], "currency": "USD", "showTaxNote": true, "taxName": "IVU", "showRewards": true,
# "sections": [ { "id": "…", "name": "Cafés", "i18n": { "en": { "name": "Coffee" } },
# "items": [ { "id": "…", "name": "Café con leche", "description": "", "i18n": { "en": { "name": "Latte" } }, "priceCents": 375, "price": "$3.75",
# "available": true, "isNew": false, "tags": [], "photoUrl": null,
# "reward": { "kind": "full_card", "programId": "…", "programName": "Cafés", "label": "Café gratis", "cost": 8, "unit": "stamps" } } ] } ],
# "pages": [], "pdfUrl": null, "updatedAt": "2026-12-03T14:00:00+00:00" } }
Webhooks
Under Integrations → Webhooks register an https URL and the events you want: member.created, stamp.created, reward.issued, reward.redeemed, transaction.undone and, on points, credit, discount and visit-pass cards, balance.changed, tier.changed, bundle.used, offer.redeemed and balance.expired. We give you a secret (whsec_…) once. Every event arrives as a JSON POST:
POST https://your-server.com/webhook
Content-Type: application/json
WL-Event: stamp.created
WL-Event-Id: 2b1c…
WL-Signature: t=1763900000,v1=5f1a…
{
"id": "2b1c…",
"type": "stamp.created",
"created_at": "2026-11-23T15:00:00.000Z",
"business_id": "…",
"data": {
"member": { …customer… },
"stamp": { "id": "…", "delta": 1, "balanceAfter": 4, "saleAmount": 12.5, "invoiceNumber": "#1001", "locationId": null, "source": "shopify" }
}
}
reward.issuedandreward.redeemedcarrydata.reward(id,type,name);member.createdcarriesdata.source(panel, api, shopify, woocommerce, square, mcp).balance.changed(points earned or spent, credit accrued or used, pass reloaded, purchase recorded on a tiered discount) andbundle.usedcarrydata.transaction:id,kind,unit,delta,balanceAfter,saleAmount,invoiceNumber,locationId,source,metaandexpiresAt.tier.changedcarriesdata.tier(kinddiscount or membership,from,to);offer.redeemedthe customer,eventIdandsource;balance.expired(the nightly expiry)unitandexpired.transaction.undone: the cashier undid the last stamp or movement from the counter.data.transactionis the undo movement itself (kindundo, the undo movement'sdeltain the card'sunit: negative, or positive when a completed card is given back;balanceAfter),data.revertedsays what was cancelled (eventId,kind) anddata.revokedRewardslists the rewards that stamp had earned and are now void.- Answer 2xx within 10 seconds. Otherwise we retry after 1, 2, 4, 8 and 16 minutes. After 5 failed events in a row the webhook is switched off; you turn it back on from the panel.
- The same
idarrives on every retry and at every URL: use it to never process an event twice.
Verify the signature. WL-Signature is t=<unix seconds>,v1=<HMAC-SHA256 hex> of the string `${t}.${body}` with your secret. Reject signatures older than 5 minutes. In Node:
import { createHmac, timingSafeEqual } from "node:crypto";
export function verify(secret, header, rawBody) {
const { t, v1 } = Object.fromEntries(header.split(",").map((kv) => kv.split("=")));
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
return timingSafeEqual(Buffer.from(expected, "hex"), Buffer.from(v1, "hex"));
}
Shopify and WooCommerce
Under Integrations → Online stores tap "Connect". We give you a URL to paste into the store and ask for the secret the store signs its webhooks with. Every paid order gives a stamp (or the stamps by spend the total earns); on a points, credit or tiered-discount card it adds in that unit. We look the buyer up by email, then by phone; without a card, we create one from the order and email the link. An order the store resends is not stamped twice. Refunds and cancellations do not take stamps away: the cashier can undo the stamp from the customer's page. Shopify POS charges arrive through the same webhook.
Shopify
- Settings → Notifications → Webhooks → Create webhook.
- Event "Order payment" (orders/paid), JSON format, URL: the one we gave you.
- Below the webhook list, copy the key Shopify signs webhooks with ("Your webhooks will be signed with…") and paste it under Integrations.
WooCommerce
- WooCommerce → Settings → Advanced → Webhooks → Add webhook.
- Status "Active", topic "Order updated", delivery URL: the one we gave you, API version v3.
- Make up a long secret, put it in the webhook and paste the same one under Integrations.
Square (register)
Under Integrations → Online stores and registers tap "Connect Square" and authorize with your Square account (we only read payments and customers). Every completed charge adds to the customer's card by its type; the tip does not count. To know who bought, scan the pass barcode into the Note of the Square POS charge, or charge a Square customer that has the email or phone of their card. Each payment adds once even if Square notifies it several times; refunds do not reverse.
Connect Claude or ChatGPT (MCP server)
The business can also be run from an AI assistant. Our MCP (Model Context Protocol) server is at https://loymore.app/api/mcp and authorizes with the panel account: when the connector is added, the assistant opens our sign-in screen, the person picks the business and authorizes. Every tool respects the role of whoever authorized (cashier: search and stamp; manager and owner: also notifications, export and KPIs). The owner sees and revokes connections under Integrations → AI connections.
- claude.ai: Settings → Connectors → "Add custom connector" → URL
https://loymore.app/api/mcp→ "Connect" and sign in. - ChatGPT: Settings → Connectors → "Create" → the same URL (needs a ChatGPT plan with custom connectors).
- Claude Code (OAuth or API key):
claude mcp add --transport http wallet-loyalty https://loymore.app/api/mcp
# or, with an Integrations key instead of signing in:
claude mcp add --transport http wallet-loyalty https://loymore.app/api/mcp --header "Authorization: Bearer wl_live_…"
Tools: get_business, list_customers, get_customer, add_stamp, redeem_reward, earn, spend, use_bundle, redeem_offer (the points, credit, discount and pass operations, like /api/v1/transactions), send_notification (the assistant asks for confirmation first), export_customers, get_kpis and get_menu (the digital menu with prices, availability, translations and linked rewards, like GET /api/v1/menu; optional language for the summary). get_customer, add_stamp and redeem_reward take programId like /stamps. Technical details: OAuth 2.1 with PKCE S256, dynamic client registration and Client ID Metadata Documents, metadata at /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource, 1-hour tokens refreshed for 30 days.
Limits and good practice
- One key per system (register, web, ERP): if one leaks, you revoke only that one.
- Always use
idempotencyKeywhen stamping from a register: a slow network must not duplicate stamps. - Google Wallet notifications are capped at 3 per card every 24 hours; later stamps show without a notice.
- Rate limit: 600 calls every 10 minutes per key. Past it you get
429with{ "error": "…", "code": "rate_limited" }and theRetry-Afterheader (seconds). Every 429 carriesX-RateLimit-LimitandX-RateLimit-Remaining. The MCP server has its own cap: 120 tool calls every 10 minutes per connection.