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 I am trying to create a webhook for ORDERS/CREATE, but nothing seems to be working. When i test on the local Ngrok with shopify webhook trigger, it always ends up not having an admin object, so the if statement (line 28) enters. I am not sure if the webhooks are being set up correctly, but i believe i have done everything right.
The APP_UNINSTALLED webhook seems to do its job when it do unistall the app, everything in the db gets cleared, but when i test APP_UNISTALLED in my testing enviorment the admin object is null and the default response 200 is sent.
Here are all my files, please help.
# shopif.app.toml
# Learn more about configuring your app at https://shopify.dev/docs/apps/tools/cli/configuration
client_id = "118a9d50cdbd89a6baf3cf0d0bf02bf4"
name = "update-order-numbers"
application_url = "https://exist-ordering-nokia-agencies.trycloudflare.com"
embedded = true
[build]
automatically_update_urls_on_dev = true
dev_store_url = "peacefuldev.myshopify.com"
include_config_on_deploy = true
[access_scopes]
# Learn more at https://shopify.dev/docs/apps/tools/cli/configuration#access_scopes
scopes = "read_all_orders,read_orders,read_products,write_orders"
[auth]
redirect_urls = [
"https://exist-ordering-nokia-agencies.trycloudflare.com/auth/callback",
"https://exist-ordering-nokia-agencies.trycloudflare.com/auth/shopify/callback",
"https://exist-ordering-nokia-agencies.trycloudflare.com/api/auth/callback"
]
[webhooks]
api_version = "2024-01"
[pos]
embedded = false
Hey @nebneb8
Please post this here: https://github.com/Shopify/shopify-app-template-remix/issues
Scott | Developer Advocate @ Shopify
Hello,
I encountered the same thing. Apparently Shopify CLI (`shopify app webhook trigger`) leaves `admin` and `session` as null. The trigger mocks a sample shop, and thus have no way of actually creating real `admin` and `session` objects.
You need use an actual development site to actually get `admin` and `session` objects. E.g I actually went to the development site and edited my shop details to fire a `shop/update` trigger with a proper `admin` object.
This is the trigger that I sent
```
shopify app webhook trigger --client-id XXXX --client-secret XXXX --api-version 2024-07 --topic shop/update --address https://constitutes-airports-liked-defects.trycloudflare.com/webhooks
```
In the webhook, I did
```