Skip to content

Redeem reward

redeemReward(customerId, rewardProductId, variableAmount)

Section titled “redeemReward(customerId, rewardProductId, variableAmount)”

Redeems a reward for a customer: deducts the reward’s stamp cost and issues a discount code. For variable-value rewards, pass variableAmount to set how many stamps to spend.

NameTypeRequiredDescription
customerIdID!YesThe Shopify customer ID.
rewardProductIdID!YesThe reward to redeem.
variableAmountIntNoStamp amount for variable-value rewards.

Returns a non-null Redemption carrying the issued code and the new balance.

FieldTypeDescription
codeStringThe issued discount code.
nameStringReward name.
stampBalanceInt!Resulting stamp balance after deduction.
mutation {
redeemReward(customerId: "6677889900", rewardProductId: "44") {
code
name
stampBalance
}
}
{
"data": {
"redeemReward": {
"code": "LOYAL-7Q2X",
"name": "Free coffee",
"stampBalance": 31
}
}
}

Returns an error with message INSUFFICIENT_STAMPS if the customer cannot afford it, or REWARD_NOT_FOUND if the reward does not exist.