Skip to content

Process activity

Runs an earn rule for a customer, awarding the stamps that rule grants (its step times multiplier) and recording the activity. Use this when you want the program’s configured earn logic to decide the amount, rather than specifying a raw number.

NameTypeRequiredDescription
customerIdID!YesThe Shopify customer ID.
earnRuleIdID!YesThe earn rule to process.

Returns a non-null StampResult describing the applied change and the resulting balance.

FieldTypeDescription
customerIdID!The affected customer’s ID.
stampChangeInt!The stamp change applied.
stampBalanceInt!Resulting stamp balance.
mutation {
processActivity(customerId: "6677889900", earnRuleId: "12") {
customerId
stampChange
stampBalance
}
}
{
"data": {
"processActivity": {
"customerId": "6677889900",
"stampChange": 1,
"stampBalance": 41
}
}
}

Returns an error with message ACTIVITY_NOT_AWARDED if the rule could not be applied.