Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
I am trying to add a CARTS_UPDATE webhook.
The code used is this :
const registration = await registerWebhook({ address: `${EVENTHOST}/webhook/cart/update`, topic: 'CARTS_UPDATE', accessToken, shop, apiVersion: ApiVersion.October19 }); if (registration.success) { console.log('Successfully registered webhook!'); } else { console.log('Failed to register webhook'); console.dir(registration, { depth: null }); }
However, the error I get is this :
{ success: false, result: { data: { webhookSubscriptionCreate: { userErrors: [ { field: [ 'webhookSubscription' ], message: 'You cannot create a webhook subscription with the specified topic' } ], webhookSubscription: null } }, extensions: { cost: { requestedQueryCost: 10, actualQueryCost: 10, throttleStatus: { maximumAvailable: 1000, currentlyAvailable: 990, restoreRate: 50 } } } } }
Any idea why this happens ? I am thinking it could be related to permissions, but there are no obvious permissions in this area. My current permission set is
thanks for any pointers or ideas,
Peter
Solved! Go to the solution
This is an accepted solution.
OK - added
Any ideas on this? If I create a webhook with same code for PRODUCTS_CREATE topic, it works fine.
Is there a list of needed permission values for the different webhook topics?
thanks,
Peter
This is an accepted solution.
OK - added