Closed vincaslt closed 3 months ago
Hey maybe its the way you register your webhook in combination with the problem I had here: https://github.com/Shopify/shopify-app-template-remix/issues/796#issuecomment-2252418725
you should reinstall your App, when registering a new webhook, as you mentioned. For me only the npm run dev -- reset
did not work. So I reinstalled it and used the command shopify app dev --reset
to get the new webhooks being registered. This did it for me, hope it helps.
and also in addition orders/paid need an extra authorization in the partners shopify site because its sensitive date. See also the documentation https://shopify.dev/docs/api/webhooks?reference=graphql#list-of-topics-orders_paid Make sure you also have the right access scopes in your toml for order/paid.
Maybe first do a simple access scope and topic like PRODUCTS_UPDATE
Thanks for jumping in @FynnMenkIT! I think that's a good point about the scope being restricted. If these suggestions don't work, I'll raise this with the team so they can investigate what might be going wrong, but I think trying with a non-restricted topic and reinstalling the app first might be helpful to know if there's nothing else going wrong.
About the subscriptions not showing up when you query the API, the declarative webhooks are not exposed via the API, so it's expected that they won't be there.
No, it doesn't work for me at all, only the uninstalled webhook is consistently being delivered. All others aren't (product update, order fulfilled), even by following the steps you mentioned exactly (also added any required scopes). My settings:
[webhooks]
api_version = "2024-07"
[[webhooks.subscriptions]]
topics = [
"app/uninstalled",
"discounts/create",
"orders/fulfilled",
"products/update"
]
uri = "/webhooks"
I notice that when I deploy settings get pushed with hardcoded URLs (e.g. application_url
) and when I then start the app with they change, I wonder if it has something to do with it. I'm assuming shopify doesn't know about the changed URLs, unless maybe there's some handling for dev environment.
I can see in the dashboard that all webhooks are failing to deliver, and the last calls are always to the endpoint URL before I call npm run dev -- --reset
OK, so riding on the back of my observation, I got it to work like this:
npm run dev -- --reset
shopify app deploy
in a new console windowIs there a better way that doesn't require juggling URLs?
I don't believe you should have to deploy
on every restart if your topics haven't changed. I'll raise this with the team to see if there is anything we can do here.
UPDATE: for now, you'll need to deploy
before dev
when developing webhooks, so the URLs are updated. I've forwarded this feedback to the team, and we're looking for ways to improve this.
Since there isn't a way for us to change that behaviour from this repo, I'm going to close the issue, but the team is aware of it!
Issue summary
Before opening this issue, I have:
@shopify
packages@shopify/shopify-*
package and version:{ logger: { level: LogSeverity.Debug } }
in my configurationI'm trying to register a new webhook for
orders/paid
topic, and I'm using this Remix template. I have this in my shopify.app.toml file:I deployed this config.myshopify.com/admin/api/2024-07/webhooks.json
shopify app deploy
, I uninstalled/reinstalled the app. In developmentnpm run dev -- --reset
theorders/paid
webhook is not firing at all, but uninstall does fire. I receive an empty list of registered webhooks when I check registered webhooks: https://The old way of adding webhooks to config when initializing shopify client still works fine and the webhooks.json contains my registered webhook:
Is there something that I do wrong?
Expected behavior
The webhook fires.
Actual behavior
Webhook is not fired.
Debug logs