1. The order lifecycle
Loyalty in LIP follows the payment lifecycle, not the other way around:- Evaluate (
orders/evaluate) — before checkout, estimate accrual and list available rewards for an order. Read-only, safe to retry. - Accrue (
accruals) — after payment, post the earn. This writes an immutable ledger entry. - Reserve → Capture (
redemptions/reserve,redemptions/capture) — hold a reward against an order, then finalize it when the order completes. Reservations expire on a TTL if never captured. - Reverse (
redemptions/reverse) — release or refund a redemption. - Adjust (
orders/adjust) — correct accrual after a refund, void, or partial return, preserving the original earn multiplier.
2. Idempotency is mandatory
Every mutating request carriescontext.idempotency_key. Reuse the same key when retrying after a lost response — the server replays the original result. Reusing a key with a different payload returns an idempotency_conflict error instead of silently double-posting points.
x-lip-safe-to-retry. The SDK retries reads automatically but never silently retries financial mutations.
3. Errors are contracts
Errors use RFC 9457 problem details withapplication/problem+json. Branch on HTTP status and the stable code field — never parse human-readable detail strings. Validation failures (422 validation_failed) include JSON paths for each issue. See the API overview for the full status and code table.
4. The Admin dashboard is your debugger
Openhttp://127.0.0.1:3210/admin/ and sign in with the printed key. You can inspect account balances, tier progress, expiring point lots, immutable ledger history, program configuration, and storage status. Every mutation you make through the API is visible here immediately.
5. The CLI covers validation and diagnostics
6. State is durable; reset is explicit
The sandbox persists to.lip/reference.db and hydrates members, balances, point lots, reservations, ledger entries, and idempotency records on restart. Start fresh with:
Where to go from here
TypeScript SDK
Typed client, exact money, order builder, webhook verification.
API Reference
Every endpoint with request and response schemas.