The case:
When an order only contains gift cards, an ERP system needs to be posted an invoice, including gift card IDs (not codes) that have been generated.
Normally, this would be straigtforward
- When an order is fulfill (or fulfillment order is fulfilled)
- Check the lines…
- Uhh - no way to query gift card IDs that have been generated.
As I see it, there are a few funny ways around this
- After order/fulfillment order is fulfilled, query order timeline events and try to find the event which references the generated gift cards - this could be delayed and pose a timing issue
- After order is fulfilled, query gift cards by timestamp to try to find gift cards created at around the same time - also timing issue
- Query all gift cards every 15 minutes (there are no webhooks for gift card created??
) and save references between Order ID and Gift card ID - check if all gift cards have been fulfilled for the particular order and then do something. Icky.
Since gift cards reference order IDs (if they were created by an order) why for the love of code can we query gift cards by order ID?
I am quite sure it worked in the REST API 
Any bright ideas are welcome 
Hi @Evaldas_Raisutis - you’re right on all counts. There’s no order_id filter on the giftCards query, no gift card webhook topics, and no clean way to go from order to generated gift cards.
The least painful option is probably your first one: query giftCards with source:purchased and a created_at date range, then match on the order field. You might be able to trigger this off an orders/fulfilled webhook to narrow the timing window.
{
giftCards(first: 50, query: "source:purchased created_at:>=2026-03-03 created_at:<=2026-03-04") {
nodes {
id
lastCharacters
order {
id
}
}
}
}
I’ve passed your feedback to the relevant teams internally - the more a specific feature is requested by our merchants and partners, the more likely it is to be considered for future development by our product teams so hopefully this is something that can be added in the not too distant future - thanks for flagging!
Thanks Donald, appreciate it.
On the topic of webhooks, what up with gift cards not having webhooks? 
Short answer is that it’s a gap that the Gift Cards team is aware of but hasn’t been prioritized yet.
There’s an existing thread requesting this (created, updated, expired, deactivated topics), and it’s come up internally from multiple partners as well - so it’s definitely on the radar! I’ve added your use case to the internal feature request, hopefully the continued interest prompts movement on this shortly.
For now the best you can do is use order webhooks as a trigger and query from there, which I know isn’t great for detecting updates, expirations, or deactivations.
1 Like