New Shopify Certification now available: Liquid Storefronts for Theme Developers

Webhook events not being sent to AWS EventBridge from Shopify admin app

Solved
kensalanio
Shopify Partner
5 0 0

I followed the instructions here:
https://shopify.dev/docs/apps/webhooks/configuration/eventbridge

I created an app using the Shopify Admin> Settings> Develop Apps steps and set up a webhook with the appropriate Admin API access scopes. I also setup the partner event source, EventBridge bus, rules, and a lambda function and cloudwatch logs to handle the webhook on AWS. To test the webhook, I've tried creating and editing the cart and orders, but no events arrive in my AWS. No failure notifications were sent to my email too.

I've tried using Shopify Admin> Settings> Notifications to create webhooks with URL endpoints and they work fine, but there's no option to create EventBridge webhooks from there.

Aside from emails, is there anywhere else I can check for failures, or another way to initiate and check webhook events sent from the shopify admin app?


Accepted Solution (1)
lizk
Shopify Staff
Shopify Staff
246 57 62

This is an accepted solution.

Hi there 👋

I would start with querying your webhook subscriptions  and reviewing the topics that you are subscribed to. 
Could you confirm what webhook topics you are subscribed to? And what steps you have been taking to trigger the webhooks?

At this time there is limited webhook observability for Apps created from the Shopify Admin. If you instead create a custom app from the Shopify CLI or Partner Dashboard you would gain access to the Webhook metrics dashboard. You would also gain the ability to trigger webhooks with the Shopify CLI. 

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 2 (2)
lizk
Shopify Staff
Shopify Staff
246 57 62

This is an accepted solution.

Hi there 👋

I would start with querying your webhook subscriptions  and reviewing the topics that you are subscribed to. 
Could you confirm what webhook topics you are subscribed to? And what steps you have been taking to trigger the webhooks?

At this time there is limited webhook observability for Apps created from the Shopify Admin. If you instead create a custom app from the Shopify CLI or Partner Dashboard you would gain access to the Webhook metrics dashboard. You would also gain the ability to trigger webhooks with the Shopify CLI. 

To learn more visit the Shopify Help Center or the Community Blog.

kensalanio
Shopify Partner
5 0 0

I think I see the problem now. I queried the webhook subscriptions using GraphQL and apparently I'm only subscribed to APP_UNINSTALLED topic.

So I tried subscribing to the CARTS_CREATE topic in the Shopify GraphQL app again using this snippet:

 

mutation {
  eventBridgeWebhookSubscriptionCreate(
    topic: CARTS_CREATE
    webhookSubscription: {
      arn: "arn:aws:events:us-east-1::event-source/aws.partner/shopify.com/<MY_AWS_ID>/test_webhook_ken_njs"
      format: JSON
    }
  ) {
    webhookSubscription {
      id
    }
    userErrors {
      message
    }
  }
}

 


and I now see that there is an error:

 

 

 

{
  "data": {
    "eventBridgeWebhookSubscriptionCreate": {
      "webhookSubscription": null,
      "userErrors": [
        {
          "message": "Address is invalid"
        },
        {
          "message": "Address is an AWS ARN and includes api_client_id '<MY_AWS_ID>' instead of '<SOME_OTHER_ID>'"
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 10,
      "actualQueryCost": 10,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 990,
        "restoreRate": 50
      }
    }
  }
}

 

 

 

 

 

But <MY_AWS_ID> is the ID i used in creating the Amazon EventBridge source in the Shopify Admin app, so i don't understand why it's asking for <SOME_OTHER_ID> instead.