Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi there! I've been following the webhook tutorial from the Shopify Node + React guide. I've been able to successfully register, validate, and receive webhooks. However, my app needs to call the Shopify API after receiving a webhook, and I'm wondering the best way to do this. From what I understand, it's not possible to get an access token from a webhook since those are only provided via OAuth.
I came across this post from 2 years ago which suggests storing the Shop URL and access code in a database, then I can retrieve the access code for a given shop using the x-shopify-shop-domain header from the webhook request.
Is this the best way to proceed? If possible I'd prefer to avoid using a database since my app otherwise doesn't need it.
Hey Thresher,
Storing Access Tokens is definitely required for most apps, and a database is one of the recommended methods for storing that information.
If you're not storing the Access Token for each shop upon installation, you will then be unable to make any authenticated API calls to that shop in the future. In this case, the merchant would need to uninstall and reinstall your app to generate a new Access Token which you would then need to store for your API calls.
To learn more visit the Shopify Help Center or the Community Blog.
hay i desperately need it im working on it since 25 days only requirement is i need to get access token and shop name when someone will install my app and post it to another link i have no idea how to do it can u help me with it?