Skip to content

Ingest a signed business event

POST
/events

The signed, idempotent, channel-agnostic event front door. Requires a secret key, the X-Loyalty-Signature/X-Loyalty-Timestamp/X-Loyalty-Nonce headers, and an Idempotency-Key header echoing the body idempotency_key.

object
channel
required
string
external_id
required
string
type
required
string
Allowed values: purchase refund referral review profile
source_ref
required
string
idempotency_key
required
string
occurred_at
required
string format: date-time
tenant
string
trigger
string
Allowed values: order_placed payment_captured fulfillment
order_ref
string
sales_channel

The sales channel this order came through, for programme routing. A key such as shopify:web: lower-case letters, digits and : . _ -, starting with a letter or digit, up to 64 characters. Optional. An order with none is keyed by its channel: a channel that already fits the key shape is the key as it is (acme:pos stays acme:pos); any other channel is lower-cased, each run of characters outside a-z 0-9 . _ - (a space or a : included) becomes one -, leading characters that are not a letter or digit are dropped, the result is cut to 64 characters and trailing - characters are dropped; if nothing is left the key is unknown. It does not name a programme, and a refund ignores it (a refund follows its order).

string
/^[a-z0-9][a-z0-9:._-]{0,63}$/
amount
object
gross
integer
net_of_tax_shipping
integer
final_after_discounts
integer
currency
string
>= 3 characters <= 3 characters
refunded_base
integer
> 0
order_base
integer
> 0
email
string
>= 3 characters <= 320 characters
phone
string
>= 3 characters
items
Array<object>
<= 200 items
object
product_id
required
string
>= 1 characters <= 120 characters
collection_ids
Array<string>
default: <= 50 items
quantity
integer
default: 1 > 0
unit_price_cents
integer
refunded_amount_cents
integer
units
Array<object>
<= 20 items
object
unit
required
string
/^[a-z][a-z0-9_]{0,31}$/
value
required
integer

Duplicate or opt-in-skipped (deduped).

object
event_id
required
string
customer_id
required
string format: uuid
channel
required
string
source_ref
required
string
type
required
string
Allowed values: purchase refund referral review profile
status
required
string
Allowed values: accepted duplicate skipped
customer_created
required
boolean
linked_via
required
string
enqueued
required
boolean

Accepted (first sighting).

object
event_id
required
string
customer_id
required
string format: uuid
channel
required
string
source_ref
required
string
type
required
string
Allowed values: purchase refund referral review profile
status
required
string
Allowed values: accepted duplicate skipped
customer_created
required
boolean
linked_via
required
string
enqueued
required
boolean

Malformed event body.

object
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210

Missing/invalid API key credential (unauthorized), or a missing/invalid signature, or a detected replay (signature_invalid / replay_detected).

object
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210

The credential lacks the loyalty:write scope — a publishable key (publishable_key_forbidden), or an OAuth token, which is always read-only in v1 (insufficient_scope).

object
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210

The Idempotency-Key was reused with a different body (idempotency_key_conflict).

object
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210

The payload failed validation, or the event type is unsupported.

object
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210