Skip to content

Activities

Read a customer’s loyalty ledger and process earn rules on their behalf.

A customer’s {id} is its Shopify customer ID.

GET /customers/{id}/activities

Cursor-paginated loyalty ledger for a customer (newest first).

Query params:

ParamTypeDescription
limitintegerPage size, 1–1000 (default 20).
afterstringCursor for the next page.
beforestringCursor for the previous page.
hasCountbooleanInclude the total count in meta.pagination (slower).

See pagination for details.

[
{
"id": "9001",
"label": "Placed an order",
"stampChange": 5,
"createdAt": "2026-06-05T12:00:00+00:00"
}
]
FieldTypeDescription
idstringUnique identifier.
labelstringHuman-readable description of the activity.
stampChangeintegerStamps added or removed (negative for deductions).
createdAtstringISO-8601 timestamp.
FieldTypeDescription
hasNextbooleanWhether another page follows.
hasPreviousbooleanWhether a previous page exists.
nextCursorstringCursor to fetch the next page (pass as after).
previousCursorstringCursor for the previous page (pass as before).
countintegerTotal matching records (only when hasCount=true, otherwise null).

POST /customers/{id}/activities

Process an earn rule for the customer (e.g. award stamps for completing a social follow or review).

Body:

FieldTypeRequiredDescription
earn_rule_idintegeryesThe earn rule to process (id from /earn-rules).
// returns
{
"customerId": "6677889900",
"stampChange": 5,
"stampBalance": 45
}
FieldTypeDescription
customerIdstringThe affected customer’s ID.
stampChangeintegerThe stamp change applied.
stampBalanceintegerResulting stamp balance.

Returns 404 EARN_RULE_NOT_FOUND for an unknown rule, or 422 ACTIVITY_NOT_AWARDED if the rule could not be awarded (e.g. rate-limited or the customer is ineligible).