Integrate the complete customer lifecycle.
Follow tested request shapes for earning, reading balances, returns, engagement events, offers, and signed outcomes.
Award a completed purchase.
Create the program, active member, and events:write key in the same environment before sending the event.
curl -X POST "https://app.loyumi.com/api/v1/events" \
-H "Authorization: Bearer <sandbox-key>" \
-H "X-Environment: <sandbox-environment-id>" \
-H "Idempotency-Key: order-10042" \
-H "Content-Type: application/json" \
-d '{
"type": "purchase.completed",
"programId": "<program-id>",
"externalCustomerId": "customer-123",
"amountMinor": 2599,
"channel": "web",
"sourceReference": "order-10042"
}'Read a member and their program balances.
URL-encode the external customer ID. The response includes identity status, consent state, tier, qualification points, and account balances by program.
- Requires
members:read. - Uses the same
X-Environmentas the award. - Returns
Cache-Control: no-store.
GET /api/v1/members/customer-123
Authorization: Bearer <sandbox-key>
X-Environment: <sandbox-environment-id>Claw back a full or partial order.
Reference the original order and send the amount being returned as returnAmountMinor. The endpoint derives the related program and bounds the proportional clawback.
curl -X POST "https://app.loyumi.com/api/v1/returns" \
-H "Authorization: Bearer <sandbox-key>" \
-H "X-Environment: <sandbox-environment-id>" \
-H "Idempotency-Key: return-10042-1" \
-H "Content-Type: application/json" \
-d '{
"sourceReference": "order-10042",
"returnReference": "return-10042-1",
"returnAmountMinor": 1000
}'Advance a challenge with a registered event.
The event definition must already be active in the selected environment and the member must exist. Use a source reference that identifies the real behavior once.
- Requires
events:write. - Requires an idempotency key.
- Returns any completed challenge awards in
awards.
{
"type": "profile.completed",
"externalCustomerId": "customer-123",
"sourceReference": "profile-customer-123-v1",
"occurredAt": "2026-08-02T08:00:00.000Z",
"attributes": { "source": "account_page" }
}Evaluate a cart without mutating it.
Send positive integer minor-unit prices. The result explains subtotal, discount, total, eligible effects, and coupon validity.
{
"programId": "prg_…",
"couponCode": "WELCOME10",
"items": [
{ "sku": "SKU-42", "category": "coffee", "quantity": 2, "unitPriceMinor": 650 }
]
}