All things Shopify and commerce
Hi,
Is there a way to use Shopify API to update the balance of a gift card?
Looking at the documentation , I can't see any thing related updating the balance.
https://shopify.dev/docs/api/admin-rest/2023-10/resources/gift-card
It should be possible to do, as "balance" is one of the properties that can be used.
The "PUT" function allows for updating existing gift cards.
https://shopify.dev/docs/api/admin-rest/2023-10/resources/gift-card#put-gift-cards-gift-card-id
How to actually make this work though will require input from someone who has more experience with APIs than I do though.
★ Did my post help? If yes, then please like and accept solution. ★
https://stephens.world
support@stephensworld.ca
There used to be a section about adjusting the balance of the gift card but it seems is no longer documented, the endpoint still works and I haven't seen anything about it being deprecated in the soon future.
Here is an example:
Endpoint: "https://yourstore.myshopify.com/admin/api/2024-01/gift_cards/{GIFT_CARD_ID}/adjustments.json"
JSON:
{
"adjustment": {
"amount": -6440,
"gift_card_id": 501700100192,
"note": "Filling",
"remote_transaction_ref": "xxx"
}
}
The adjustment appears in the Shopify Admin Gift Card screen.
NOTE: You need to enable some scopes to access this API:
Hope it helps!
Posting this for anyone else who might need this:
For some reason the resource documentation appears to be hidden from the side menu of the shopify dev docs. Here is the link to the docs: https://shopify.dev/docs/api/admin-rest/2024-04/resources/gift-card-adjustment
Also, you need to go into the settings and create the app, then contact Support and ask them to add the scopes write/read_giftcard_adjustments scopes to the app you created.
As of GraphQL API version 2024-10, you can update the gift card balance using giftCardCredit and giftCardDebit.
Requires write_gift_card_transactions access scope.
giftCardCredit - GraphQL Admin
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024