Skip to content

Grant reward

grantReward(customerId, rewardProductId, variableAmount)

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

Grants (comps) a reward to a customer without deducting any stamps, and issues a real discount code. Use it for goodwill gestures or manual comps. It mirrors redeemReward but leaves the stamp balance untouched.

NameTypeRequiredDescription
customerIdID!YesThe Shopify customer ID.
rewardProductIdID!YesThe reward to grant.
variableAmountIntNoValue for variable-value rewards.

Returns a non-null Redemption carrying the issued code and the customer’s (unchanged) balance.

FieldTypeDescription
codeStringThe issued discount code.
nameStringReward name.
stampBalanceInt!The customer’s stamp balance (unchanged, since no stamps were spent).
mutation {
grantReward(customerId: "6677889900", rewardProductId: "44") {
code
name
stampBalance
}
}
{
"data": {
"grantReward": {
"code": "APPY-7Q2X",
"name": "Free coffee",
"stampBalance": 35
}
}
}

Returns an error with message REWARD_NOT_FOUND if the reward does not exist, or CUSTOMER_NOT_FOUND for an unknown customer.