Skip to content

Loyalty Events

Loyalty events represent customer actions that can trigger point awards, promotion evaluations, and workflow executions.

FieldTypeDescription
eventstringEvent type (e.g., purchase, signup)
customerIdstringThe customer who performed the action
amountnumberMonetary value (in cents) if applicable
metadataobjectAdditional event data
timestampdatetimeWhen the event occurred

Use the ingest endpoint for high-throughput event tracking:

Terminal window
curl -X POST https://api.storelayer.io/ingest/events \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "purchase",
"customerId": "cust_123",
"amount": 4999,
"metadata": {
"orderId": "ord_456",
"items": ["sku_a", "sku_b"]
}
}'
EventDescription
purchaseA completed purchase
signupNew customer registration
referralSuccessful referral
reviewProduct review submitted
birthdayCustomer birthday (auto-triggered)

You can also define custom events for any action specific to your business.

Events are processed through Cloudflare Queues with guaranteed delivery:

  1. Event received via ingest API
  2. Queued for processing (batch size: 10, timeout: 5s)
  3. Evaluated against active promotions and workflows
  4. Rewards applied automatically