data-src=../../../../includes/commerce-only.md
giftCardAccount query
The giftCardAccount query returns information for a specific gift card.
Syntax
giftCardAccount(code: String!): GiftCardAccount
Reference
The giftCardAccount reference provides detailed information about the types and fields defined in this query.
Example usage
The following example returns information about the 01PNC9L76H4H gift card code.
Request:
query {
giftCardAccount(input: {gift_card_code: "01PNC9L76H4H"}){
code
balance {
currency
value
}
expiration_date
}
}
Response:
{
"data": {
"giftCardAccount": {
"code": "01PNC9L76H4H",
"balance": {
"currency": "USD",
"value": 25
},
"expiration_date": null
}
}
}
Errors
Error
Description
Gift card not foundThe specified
gift_card_code value does not exist in the giftcardaccount table, or the full amount has already been redeemed.Field GiftCardAccountInput.gift_card_code of required type String! was not providedThe value specified in the
GiftCardAccountInput.gift_card_code argument is empty.