Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
I am using Google Pub Sub to receive shopify webhook data. I've make webhook subscription for total of 9 Topics, using GraphQL Mutation (pubSubWebhookSubscriptionCreate) which is available in new API version 2021-07. Shopify official docs can be read here.
The followings are the Topics that I am subscribing to and the Scopes to which I've access.
const topics = [ ShopifyWebhookSubscriptionTopicEnum.COLLECTION_LISTINGS_ADD,
ShopifyWebhookSubscriptionTopicEnum.COLLECTION_LISTINGS_UPDATE,
ShopifyWebhookSubscriptionTopicEnum.COLLECTION_LISTINGS_REMOVE,
ShopifyWebhookSubscriptionTopicEnum.PRODUCT_LISTINGS_ADD,
ShopifyWebhookSubscriptionTopicEnum.PRODUCT_LISTINGS_UPDATE,
ShopifyWebhookSubscriptionTopicEnum.PRODUCT_LISTINGS_REMOVE,
ShopifyWebhookSubscriptionTopicEnum.LOCATIONS_CREATE,
ShopifyWebhookSubscriptionTopicEnum.LOCATIONS_UPDATE,
ShopifyWebhookSubscriptionTopicEnum.LOCATIONS_DELETE,
]
const scopes = [
read_products,
read_product_listings,
read_customers,
read_orders,
read_draft_orders,
read_inventory,
read_locations,
read_checkouts,
read_discounts,
write_products,
write_customers,
write_orders,
write_order_edits,
write_draft_orders,
write_inventory,
write_fulfillments,
write_assigned_fulfillment_orders,
write_merchant_managed_fulfillment_orders
]
The Shopify returns a successful response for each of them, but I am not able to receive events for all of those topics only some of them worked each time. Sometimes I receive data for
Listing Add and Location Create and sometimes I receive data only for Location Create, Update and Delete.
I am not able to receive webhook data for all of the subscribed events. Can anyone point out what could be the issue here.
Solved! Go to the solution
This is an accepted solution.
Figured out, that the issue was with the topics I was subscribing to updating them worked for me!
COLLECTIONS_CREATE,
COLLECTIONS_UPDATE,
COLLECTIONS_DELETE,
PRODUCTS_CREATE,
PRODUCTS_UPDATE,
PRODUCTS_DELETE,
LOCATIONS_CREATE,
LOCATIONS_UPDATE,
LOCATIONS_DELETE
This is an accepted solution.
Figured out, that the issue was with the topics I was subscribing to updating them worked for me!
COLLECTIONS_CREATE,
COLLECTIONS_UPDATE,
COLLECTIONS_DELETE,
PRODUCTS_CREATE,
PRODUCTS_UPDATE,
PRODUCTS_DELETE,
LOCATIONS_CREATE,
LOCATIONS_UPDATE,
LOCATIONS_DELETE
Thank you for sharing your solution! Can you also share your entire graphql code? I'm trying to do the same thing, subscribing to pub/sub webhooks. I'm receiving a 200 response but the response object's data is null, as follows:
"data": {
"pubSubWebhookSubscriptionCreate": {
"webhookSubscription": null
}
},
I'm coming back here to update after my question above in case it helps anyone else...
userErrors {
field
message
}