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.
Arguments
Section titled “Arguments”| Name | Type | Required | Description |
|---|---|---|---|
customerId | ID! | Yes | The Shopify customer ID. |
rewardProductId | ID! | Yes | The reward to grant. |
variableAmount | Int | No | Value for variable-value rewards. |
Returns a non-null Redemption carrying the issued code and the customer’s (unchanged) balance.
Returns / Fields
Section titled “Returns / Fields”| Field | Type | Description |
|---|---|---|
code | String | The issued discount code. |
name | String | Reward name. |
stampBalance | Int! | The customer’s stamp balance (unchanged, since no stamps were spent). |
Example
Section titled “Example”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.