Hi Shopify Devs,
I’m working on a project combining e-commerce features with game mechanics. One idea I’m exploring is sending real-time notifications or in-game events when a user performs certain purchases or achieves milestones.
I’m trying to use Shopify Webhooks / GraphQL API to push those changes to a game server or engine.
As part of the prototype, I made a demo / concept which I’ve documented here: GameHaunted Demo & Concepts.
Does anyone have experience integrating Shopify Webhooks with game backends (Unity, Node.js, etc.)? What approaches worked for you, and what pitfalls should I watch out for?
Thanks
Hi @lisa_charlie
This sounds like a really interesting project. Have you looked into using the Storefront API? This is what devs usually use for displaying product and store info on non-Shopify surfaces (like within a game).
For webhooks specifically you should be able to set these up to notify your backend in near real-time when certain events occur (e.g., order creation, customer milestone). Then your backend (Node.js, Unity server, etc.) receives the webhook, processes the payload, and triggers the corresponding in-game event or notification.
You can subscribe to Shopify webhook topics using the webhookSubscriptionCreate mutation, which is part of the Admin API, and would look something like this:
mutation {
webhookSubscriptionCreate(
topic: ORDERS_CREATE,
webhookSubscription: {
uri: "https://your-game-backend.com/webhooks/shopify"
format: JSON
}
) {
userErrors {
field
message
}
webhookSubscription {
id
topic
uri
}
}
}
The uri should be your backend endpoint that will process the webhook and trigger the game event. Your backend should validate the webhook, parse the payload and map the Shopify event to your in-game logic (e.g., grant a reward, trigger a notification).