How to retrieve the gift card balance using the Storefront API?

Cpc_dev
Visitor
1 0 0

Is there a method to calculate the gift card balance and display it in my custom Next.js app using the Storefront API?

Reply 1 (1)

kaaaaa
Shopify Partner
13 0 8

You could create a checkout with a product that costs like $1 and then apply the giftcard to it. Afterwards you'll get a checkout object that contains the applied giftcards. for each gift card you can see the amount left (add the $1 here). Just a workaround. Currently I don't think it's possible to directly query the amount left on giftcards..

https://shopify.dev/docs/api/storefront/2024-01/objects/AppliedGiftCard#field-appliedgiftcard-balanc...