Re: AWS Eventbridge Webhook Topics

AWS Eventbridge Webhook Topics

Jackito
Visitor
2 0 0

Hi, 

Trying to add a webhook through the GraphQL API. I get back a message stating that the webhook I am trying to create doesn't exist. Listed below is my mutation. Notice the topic SHIPPING_ADDRESSES_UPDATE my topic.  

const shippingAddressUpdateMutation = {
         data: `mutation {
              eventBridgeWebhookSubscriptionCreate(
                topic: SHIPPING_ADDRESSES_UPDATE
                webhookSubscription: {
                     arn: "${process.env.AWS_WEBHOOK_ARN}"
                     format: JSON
                }
            ) {
               webhookSubscription {
                        id
                }
                 userErrors {
                      message
                }
            }
        }`,
};

 Now I get back a response from the API: 

 

{
eventBridgeWebhookSubscriptionCreate: {
       webhookSubscription: null,
       userErrors: [
         {
          message: 'Topic Invalid topic specified: shipping_addresses/update. Does it exist? Is there a 
            missing access scope? Topics allowed: app/uninstalled, carts/create, carts/update, 
            checkouts/create, checkouts/delete, checkouts/update, collections/create, collections/delete, 
            collections/update, order_transactions/create, orders/cancelled, orders/create, orders/delete, 
             orders/edited, orders/fulfilled, orders/paid, orders/partially_fulfilled, orders/updated, 
            products/create, products/delete, products/update, refunds/create, shop/update, 
           tender_transactions/create, app_purchases_one_time/update, app_subscriptions/update, 
            domains/create, domains/update, domains/destroy, profiles/create, profiles/update, 
             profiles/delete\n'
        }
   ]
 }
}

 


The topics in the user errors message are the topics for the Shopify Admin REST API for webhooks even though I'm using the Graphql API. Are only the REST API webhooks support for the eventBridgeWebhookSubscriptionCreate mutation? The docs seem to suggest otherwise. 

Here https://shopify.dev/api/admin/graphql/reference/events/eventbridgewebhooksubscriptioncreate lists that https://shopify.dev/api/admin/graphql/reference/events/webhooksubscriptiontopic is supported on this mutation. SHIPPING_ADDRESSES_UPDATE is listed there. Can anyone clarify this? 
 

Thanks!


Replies 3 (3)

Luke_K
Shopify Staff
402 66 102

Hey @Jackito 

Could I grab a list of the Access scopes that you have enabled for the public/custom app you were using with EventBridge? Do you have Write Shipping Scopes on the app? Feel free to DM me the app details if it's easier.

Looks to be an Access Scope thing on the face of it more than anything else. Curiously for me the topic SHIPPING_ADDRESSES_UPDATE is valid my end, but let me know - will be happy to take a dig into it. Thanks!

 

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
Jackito
Visitor
2 0 0

Hey @Luke_K! Thanks for the response greatly appreciate it. I'll send you a DM shortly. 

kv_
Shopify Partner
1 0 0

This is definitely a bug, I have an app with the correct scopes (read_shipping) all the other topics that I want to use work just fine, this is the only one that does not install. It's been an issue for over 6 months...