LIP is not an identity provider. Your app or backend-for-frontend (BFF) owns customer sign-in; LIP owns the loyalty ledger. Agents should follow that split unless they are building a provider adapter.
AI resources
Everything an agent needs to reason about LIP correctly — no guessing loyalty semantics from training data.Agent Skills
Installable, task-specific knowledge for checkout, webhooks, the BFF pattern, SDK usage, and conformance.
MCP server
Official server exposing spec lookups, schema validation, and checkout checklists as tools.
llms.txt index
A compact index of the spec, OpenAPI contract, SDK entry points, and CLI — point your agent here first.
AI prompts
Curated prompts that get enroll, checkout, webhook, and refund flows right on the first pass.
Quick setup
1
Point your agent at llms.txt
Load the checked-in
llms.txt so the agent reads the normative spec before changing behavior.2
Install the Agent Skills
From a clone of the repo, install specialized loyalty knowledge into any skills-aware agent.
3
Connect the MCP server
Enable the repo-root
mcp.json, or run the published server standalone.The llms.txt index
The repo root includes llms.txt, a compact index of the normative spec, OpenAPI contract, SDK entry points, CLI commands, and the files agents should read before changing behavior. Point your agent at it first:
Agent Skills
LIP ships installable Agent Skills in theskills/ directory. They give coding agents specialized knowledge for the checkout lifecycle, webhooks, the BFF pattern, SDK usage, and conformance.
Works with Cursor, Claude Code, Codex, Windsurf, GitHub Copilot, and other agents that support the skills format. See the Skills README for the full catalog.
lip init prints the install command when you bootstrap a new project, so the Skills are one step away from any fresh integration.MCP server
LIP includes an official MCP server that exposes spec lookups, thellms.txt index, OpenAPI operation lists, schema validation, checkout lifecycle checklists, and SDK snippets — so agents do not guess loyalty semantics from training data.
Cursor: enable the repo-root mcp.json (Settings → MCP).
Manual configuration:
MCP tools
In MCP, the client is the LLM application (Cursor, Claude) and the server is the tool provider. LIP’s MCP server supplies docs and validation — it does not hold member data or merchant keys. Runtime loyalty calls still go through your BFF and the HTTP API. To expose live loyalty operations as MCP tools in your product, wrap
LipClient in a custom server and keep the merchant key server-side.CLI
Thelip CLI is the primary tool for agents and humans to validate, serve, and test a LIP deployment. Use the published package with npx, or npm run lip from a clone.
Load a custom program when building a brand-specific integration — for example, a demo rewards program in a companion app:
Spec and OpenAPI as agent context
LIP’s contract is machine-readable. Before implementing or modifying loyalty behavior, agents should load:
Recommended agent read order for a new integration:
1
llms.txt
Start with the index to orient on what exists.
2
Lifecycle rules
Read
spec/lifecycle.md for reserve → capture → reverse and idempotency.3
Full lifecycle example
Study
examples/typescript/full-lifecycle.ts for end-to-end SDK usage.4
TypeScript SDK
Review the TypeScript SDK for operations and helpers.
5
API reference
Cross-check paths against the API reference.
TypeScript SDK
The idiomatic client handles protocol context, validation, typed errors, and retry-safe reads. Agents should preferLipClient over hand-rolled fetch calls:
Webhooks and event-driven agents
The reference platform emits signed CloudEvents after successful mutations (enrollment, accrual, adjustment, reserve, capture, reverse). Enable delivery with environment variables or thewebhooks option on createDemoPlatform.
Receivers must verify the raw body with verifyWebhook from @loyalty-interchange/sdk and deduplicate on CloudEvent source + id. This is the primary event surface for agents that need to react to loyalty changes without polling the ledger.
1
Expose a receiver
Your BFF or worker exposes
POST /loyalty/webhook.2
Receive signed events
The LIP server pushes signed CloudEvents after mutations.
3
Verify, dedupe, and act
The receiver verifies the raw body, deduplicates on
source + id, and triggers downstream automation (CRM sync, push notifications, analytics).A reference BFF that implements this pattern typically exposes received events at an endpoint like
GET /loyalty/events for local inspection. See Webhooks for configuration and semantics.Build integrations with AI coding tools
The BFF pattern
Mobile and web apps should not hold the LIP merchant API key. Agents building customer-facing apps should introduce a thin backend that:- Owns customer auth (email, OTP, social — outside LIP today)
- Maps app users to
member_idand enrolls viamembers/enroll - Prices orders server-side and calls
orders/evaluatefor earn/redeem previews - Runs checkout:
redemptions/reserve→ payment →accruals→redemptions/capture, withredemptions/reverseon failure - Posts
orders/adjuston refunds
Checkout preview
Conformance before you ship
Agents should run these checks after implementing loyalty flows:AI prompts
Curated prompts help agents implement LIP correctly on the first pass — enroll flows, checkout lifecycle, webhook receivers, refund adjustments, and conformance checks.AI prompts
Copy-ready prompts for every core loyalty flow.
What LIP does not provide
- Customer sign-in, OTP, or social auth (merchant-key API only)
- Campaigns, segments, push notifications, or CRM
- Program editing at runtime (boot-time
--program, or Admin read-only today) - Issued coupon wallets or QR check-in flows
Next steps
AI prompts
Ready-to-paste prompts for enroll, checkout, webhooks, refunds, and conformance.
TypeScript SDK
Operations, money helpers, the order builder, and webhook verification.