Skip to content

Void reward code

Voids a reward code: the stamps spent on it are refunded to the customer and the code is deactivated in Shopify. Use it to reverse a redemption.

NameTypeRequiredDescription
customerIdID!YesThe Shopify customer ID the code belongs to.
rewardCodeIdID!YesThe reward code to void.

Returns a non-null RewardCode.

FieldTypeDescription
idID!The reward code’s identifier.
nameStringReward name.
codeStringThe discount code.
usedBooleanWhether it has been used.
createdAtDateTimeISO-8601 timestamp.
mutation {
voidRewardCode(customerId: "6677889900", rewardCodeId: "501") {
id
code
}
}
{
"data": {
"voidRewardCode": {
"id": "501",
"code": "APPY-5OFF-XXXX"
}
}
}

Returns an error with message REWARD_CODE_NOT_FOUND if the code does not belong to the customer, CUSTOMER_NOT_FOUND for an unknown customer, or VOID_FAILED if the code cannot be voided.