400Do not retry unchanged.
Inspect authentication, headers, fields, response codes, and examples without downloading or reading raw OpenAPI JSON.
Keys belong to one environment, carry explicit scopes, and should live only in trusted server infrastructure.
AuthorizationRequiredBearer <key>X-EnvironmentRequiredEnvironment ID that owns the keyIdempotency-KeyMutationsStable business-event identityX-Request-IdOptionalYour trace ID; otherwise Loyumi creates one/api/v1/eventsPost a completed purchase and award points⌄Evaluates the active earn rule, tier multiplier, audiences, campaign caps, pending policy, expiration policy, and member limit in one idempotent transaction. Requires events:write.
typerequiredconstant: purchase.completedprogramIdrequiredstringexternalCustomerIdrequiredstringamountMinorrequiredintegerCompleted order value in integer minor currency units.
channelrequiredweb | store | appsourceReferencerequiredstringStable order reference from the commerce system.
couponCodeoptionalstringOptional coupon code associated with this purchase.
itemsoptionalarray<CartItem>{
"type": "purchase.completed",
"programId": "prg_…",
"externalCustomerId": "customer-123",
"amountMinor": 2599,
"channel": "web",
"sourceReference": "order-10042"
}{
"id": "txn_…",
"status": "committed",
"requestId": "req_…",
"member": {
"id": "mem_…",
"externalCustomerId": "customer-123",
"tier": "Member"
},
"award": {
"points": 25,
"basePoints": 25,
"campaignPoints": 0
},
"campaigns": [],
"referral": null,
"coupon": null
}200Existing transaction returned for a repeated idempotency key.
201New award committed.
400Invalid JSON or missing Idempotency-Key.
401Credential or X-Environment is absent, invalid, expired, revoked, or crossed between environments.
403Credential lacks events:write.
404Program or active member was not found in the selected environment.
409Production is locked, or a governed policy, cap, or state conflict blocked the award.
413JSON body exceeds 128 KiB.
415Content-Type must be application/json.
422Event type or required field is invalid.
429Credential exceeded 600 requests in one minute. Honor Retry-After.
500Internal processing error. Retry safely with the same key and body.
/api/v1/returnsReturn all or part of an order and claw back points⌄Uses the original source reference to derive the related order and program. Calculates a bounded proportional clawback from the order's remaining active and pending point lots. Requires events:write.
sourceReferencerequiredstringReference of the original completed order.
returnReferencerequiredstringStable identity for this full or partial return.
returnAmountMinorrequiredintegerAmount being returned in integer minor currency units.
{
"sourceReference": "order-10042",
"returnReference": "return-10042-1",
"returnAmountMinor": 1000
}{
"id": "txn_…",
"status": "committed",
"requestId": "req_…",
"return": {
"sourceReference": "order-10042",
"returnReference": "return-10042-1",
"returnAmountMinor": 1000,
"pointsClawedBack": 9,
"orderStatus": "partially_returned"
}
}200Existing clawback transaction returned for a repeated idempotency key.
201Return and proportional clawback committed.
400Invalid JSON or missing Idempotency-Key.
401Invalid credential or environment.
403Credential lacks events:write.
404Original order was not found.
409Production is locked, return exceeds remaining order value, or original points cannot be clawed back.
413JSON body exceeds 128 KiB.
415Content-Type must be application/json.
422sourceReference, returnReference, or positive returnAmountMinor is invalid.
429Rate limit exceeded. Honor Retry-After.
500Internal processing error.
/api/v1/custom-eventsPost a registered engagement event⌄Records a governed event and advances matching challenges atomically, returning any awards created when a target completes. Requires events:write.
typerequiredstringName of an active event definition in the selected environment.
externalCustomerIdrequiredstringsourceReferencerequiredstringoccurredAtoptionalstring · date-timeattributesoptionalobject{
"type": "profile.completed",
"externalCustomerId": "customer-123",
"sourceReference": "profile-customer-123-v1",
"occurredAt": "2026-08-02T08:00:00.000Z",
"attributes": { "source": "account_page" }
}{
"id": "evt_…",
"status": "accepted",
"requestId": "req_…",
"awards": []
}200Existing event returned for a repeated source reference.
201Event accepted and challenge awards returned.
400Invalid JSON.
401Invalid credential or environment.
403Credential lacks events:write.
404Active event definition or member was not found.
413JSON body exceeds 128 KiB.
415Content-Type must be application/json.
422Idempotency-Key or a required event field is missing.
429Rate limit exceeded. Honor Retry-After.
500Internal processing error.
/api/v1/offers/evaluateEvaluate active cart offers⌄Returns a deterministic discount plan under exclusive, stack, and best-value policies without mutating the cart or consuming a coupon. Requires events:write.
programIdoptionalstringRequired to include program-scoped offers.
couponCodeoptionalstringitemsrequiredarray<CartItem>{
"programId": "prg_…",
"couponCode": "WELCOME10",
"items": [
{ "sku": "SKU-42", "category": "coffee", "quantity": 2, "unitPriceMinor": 650 }
]
}{
"requestId": "req_…",
"subtotalMinor": 1300,
"discountMinor": 130,
"totalMinor": 1170,
"effects": [],
"coupon": { "code": "WELCOME10", "valid": true }
}200Applicable effects, coupon validity, subtotal, discount, and total returned.
400Invalid JSON.
401Invalid credential or environment.
403Credential lacks events:write.
413JSON body exceeds 128 KiB.
415Content-Type must be application/json.
422Cart is empty or contains an item without a SKU or positive unitPriceMinor.
429Rate limit exceeded. Honor Retry-After.
500Internal processing error.
/api/v1/choice-benefitsClaim a milestone choice benefit⌄Fulfills one eligible reward choice without spending points and decrements the member's remaining selections. Requires events:write.
externalCustomerIdrequiredstringchoiceSetIdrequiredstringrewardIdrequiredstringsourceReferencerequiredstring{
"externalCustomerId": "customer-123",
"choiceSetId": "choice_…",
"rewardId": "rwd_…",
"sourceReference": "anniversary-2026-customer-123"
}{
"id": "ful_…",
"state": "fulfilled",
"requestId": "req_…",
"choice": {
"setId": "choice_…",
"rewardId": "rwd_…",
"rewardName": "Anniversary benefit",
"choicesRemaining": 0
}
}200Existing fulfillment returned for a repeated idempotency key.
201Choice fulfilled and remaining selections returned.
400Invalid JSON.
401Invalid credential or environment.
403Credential lacks events:write.
404Member or active choice set was unavailable.
409No eligible choice or selected reward inventory remains.
413JSON body exceeds 128 KiB.
415Content-Type must be application/json.
422Idempotency-Key or a required choice field is missing.
429Rate limit exceeded. Honor Retry-After.
500Internal processing error.
/api/v1/members/{externalId}Get a member, balances, tier, and qualification state⌄Returns the member identity state and consent status plus every program profile and its available, pending, and reserved account balances. Requires members:read.
GET /api/v1/members/customer-123
Authorization: Bearer <sandbox-key>
X-Environment: <sandbox-environment-id>{
"requestId": "req_…",
"member": {
"id": "mem_…",
"externalCustomerId": "customer-123",
"status": "active",
"consentStatus": "granted"
},
"programs": [
{
"programId": "prg_…",
"tier": "Member",
"qualificationPoints": 25,
"balances": [
{ "accountType": "member", "available": 25, "pending": 0, "reserved": 0 }
]
}
]
}200Member, consent state, program profiles, tiers, qualification totals, and account balances returned with Cache-Control: no-store.
401Invalid credential or environment.
403Credential lacks members:read.
404Member was not found in the selected environment.
429Rate limit exceeded. Honor Retry-After.
500Internal processing error.
{
"error": {
"code": "invalid_event",
"message": "A human-readable explanation",
"requestId": "req_…"
}
}400Do not retry unchanged.
401The credential is absent, invalid, expired, revoked, or crossed between environments.
403The key is valid but not authorized.
404Member, order, event definition, or resource was not found.
409Production lock, limits, balance, inventory, or eligibility blocked the operation.
413 / 415 / 422Keep JSON under 128 KiB, use application/json, and satisfy the contract.
429Honor Retry-After and keep the same idempotency key and body.
5xxUse exponential backoff and preserve requestId for support.