Edit in GitHubLog an issue
Adobe Commerce only. Learn more

redeemGiftCardBalanceAsStoreCredit mutation

The redeemGiftCardBalanceAsStoreCredit mutation converts the entire balance of a gift card to store credit. The gift card must be redeemable and cannot have a balance of 0 at the time you run the mutation. After successfully running the mutation, the value of the gift card changes to 0.

Syntax

Copied to your clipboard
mutation {
redeemGiftCardBalanceAsStoreCredit(
input: GiftCardAccountInput
) {
GiftCardAccount
}
}

Reference

The redeemGiftCardBalanceAsStoreCredit reference provides detailed information about the types and fields defined in this mutation.

Example usage

The following example redeems the gift card with code "056MHP57TJ5C".

Request:

Copied to your clipboard
mutation {
redeemGiftCardBalanceAsStoreCredit(
input: {
gift_card_code: "056MHP57TJ5C"
}
) {
balance {
currency
value
}
code
expiration_date
}
}

Response:

Copied to your clipboard
{
"data": {
"redeemGiftCardBalanceAsStoreCredit": {
"balance": {
"currency": "USD",
"value": 0
},
"code": "056MHP57TJ5C",
"expiration_date": null
}
}
}

Errors

ErrorDescription
Gift card not found
The specified gift_card_code value does not exist in the giftcardaccount table or the amount has been already redeemed.
Field GiftCardAccountInput.gift_card_code of required type String! was not provided
The value specified in the GiftCardAccountInput.gift_card_code argument is empty.
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.