Loyalty events

POST /loyalty-events

Report something your own systems saw to the loyalty engine. The token names a rule whose trigger is set to an event, and the rule decides what the customer earns. Several rules can share a token. The event is queued rather than applied inline, so a 202 means it was accepted, not that anything was awarded yet. Sending the same idempotencyKey twice awards nothing a second time. Programs that are paused are reported back rather than queued.

Requires the loyalty:write permission.

Body Parameters

dataobjectrequired

The event to report.

Request
curl \
  -X POST \
  "https://api.cascade.dev/loyalty-events" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "data": {
    "token": "string",
    "customerEmail": "[email protected]",
    "value": 0,
    "idempotencyKey": "string",
    "createCustomer": true,
    "occurredAt": "2025-01-15T09:30:00Z"
  }
}'
Response
{
  "accepted": true,
  "customerId": "550e8400-e29b-41d4-a716-446655440000",
  "dedupeKey": "string",
  "loyaltyProgramIds": ["550e8400-e29b-41d4-a716-446655440000"],
  "pausedLoyaltyProgramIds": ["550e8400-e29b-41d4-a716-446655440000"]
}