Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
We’re proud to introduce a new integration which will help you easily manage large volumes of webhooks by integrating your app with Amazon EventBridge. EventBridge is a serverless, event-driven alternative to receiving webhooks via HTTP. If your app is hosted on AWS you can use EventBridge to handle significant scale while reducing your infrastructure cost and complexity.
Checkout the tutorial in our developer documentation to learn how to set up an event source and manage your app’s webhooks with EventBridge.
Questions about EventBridge?
Post them in this thread to discuss your integrations with other developers and Shopify staff.
TyW | Online Community Manager @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Followed Step 1 and 2 from tutorial, everything worked smoothly .
But when trying to follow step 3 for creating rule
i'm not able to find Shopify in Service name drop-down.
check screenshot attached
Thanks! I’ve notified the team and will update when I know more.
In the meantime, there are two other options you can use.
Under ‘Event matching pattern’, choose ‘Pre-defined pattern by service’ and then select ‘All Events’ from the ‘Service provider’ drop-down. This will allow all events sent to that event source to trigger your rule.
Alternatively, under ‘Event matching pattern’, choose ‘Custom pattern’. Then define the pattern that you would like the rule to filter on in the text area on the right and click Save. Here’s an example event pattern for filtering based on a specific webhook topic:
{ "detail-type": [ "shopifyWebhook" ], "detail": { "metadata": { "X-Shopify-Topic": [ "products/update" ] } } }
TyW | Online Community Manager @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
There seems to be a BUG...?
Went pretty far with the setup, but...
Shopify is displaying an error when subscribing to the webhook via the API with an "ARN" address.
I've completed the setup, have used the "unstable" API version as specified in the tutorial ( https://shopify.dev/tutorials/manage-webhook-events-with-eventbridge#4-create-webhook-subscriptions-... ).
Tried both APIs, the REST & GraphQL and get the same error on both.
Error: "Address is not a valid AWS ARN"
Any ideas?
Hi @Mets,
Are you able to share the ARN (address) tha you are trying to subscribe to the webhook with so the team can review? Feel free to send it to as a private message
Thanks!
TyW | Online Community Manager @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
I got an error, this is my ARN arn:aws:events:us-east-2::event-source/aws.partner/shopify.com/3929673/product-label-pro-dev.
I used koa-shopify-webhook to register webhook, but this library didn't support ARN. I tried to edit the shopify-koa-webhook to accept ARN. This is error message:
Failed to register webhook for PRODUCTS_CREATE { data: { eventBridgeWebhookSubscriptionCreate: { userErrors: [], webhookSubscription: [Object] } }, extensions: { cost: { requestedQueryCost: 10, actualQueryCost: 10, throttleStatus: [Object] } } }
Please help, I don't want to use a REST service from API gateway directly!
If I use shopify admin to register webhook, the same error happens.
I get the same kind of error when trying to register a webhook.
{ "errors": { "address": [ "is invalid", "is an AWS ARN and includes api_client_id '3985939' instead of '3986211'" ] } }
I am also having the same issue.
Did anyone found the solution for it?
Any update from Shopify Team?
Call:
curl -X POST \ https://xxxxxxxxx.myshopify.com/admin/api/2020-07/webhooks.json \ -H 'authorization: Basic xxxxxxxxxxxx=' \ -H 'cache-control: no-cache' \ -H 'content-type: application/json' \ -H 'postman-token: 9b6249b5-9296-3dbb-d724-1225bd051dd0' \ -d '{ "webhook": { "topic": "customers/create", "address": "arn:aws:events:us-east-1:xxxxxxxxxx:event-bus/store-webhooks-but", "format": "json" } }'
Response:
{ "errors": { "address": [ "is invalid", "is not a valid AWS ARN" ] } }
In my case it looks like there is a problem when Shopify register the event partner source in Event Bridge and dosent put valid information.
Did you find any workaround for this from admin panel? (not api level...) I checked the response error code is 422 . The problem is with the arn:aws:events:<region>:: ...
Hi all,
I think I understand the problem: the partner event bus ARN should not be copied from AWS Console at "Amazon EventBridge > Events > Event buses" (with format like arn:aws:events:eu-west-1:00000000:event-bus/aws.partner/shopify.com/12345678/my-app), this is the mapped event bus to create rules on. When you try to register a webhook with that ARN the Sopify API respond with "422 - address: is not a valid AWS ARN".
The correct ARN need to be copied from "Amazon EventBridge > Events > Partner event sources", with format like "arn:aws:events:eu-west-1::event-source/aws.partner/shopify.com/12345678/eataly-shopify-bundle" the is the EventSource ARN and not the EventBus ARN.
Here an example of REST API payload:
{
"webhook": {
"topic": "products/update",
"address": "arn:aws:events:eu-west-1::event-source/aws.partner/shopify.com/12345678/eataly-shopify-bundle",
"format": "json"
}
}
yes I followed this instructions but still i am getting error
bumping this, facing the same issue
Oh wow, this helped! The Partner Event Source Arn and NOT your Event Bus Arn... Thanks for saving me lots of wheel spinning....
Thanks Daaru you superstar! This solved it for me.
thanks @daaru , that arn was accepted.
same for me as well
I converted the Event bus pattern to partner souce pattern and used the partner souce pattern as ARN
Event bus pattern: arn:aws:events:ap-northeast-1:393169321359:event-bus/aws.partner/shopify.com/14645592065/Shopify
partner souce pattern: arn:aws:events:ap-northeast-1::event-source/aws.partner/shopify.com/14645592065/Shopify
hello help i get this error when registering the webhook
Response:
Subscribing to this topic. I have the same issue when `POST`ing this to the REST endpoint (I am using REST instead of graphql because of this issue😞
{
"webhook": {
"topic": "checkouts/create",
"address": "arn:aws:events:us-east-1:246797399506:rule/aws.partner/shopify.com/1891866/merchrock-stats/CHECKOUTS_CREATE",
"format": "json"
}
}
and the error response:
{
"errors": {
"address": [
"is invalid",
"is not a valid AWS ARN"
]
}
}
The same problem haunts my project. Is it Shopify integration bug, or the docs miss necessary information?
I'm getting the following error after copy/pasting from the tutorial:
mutation {
eventBridgeWebhookSubscriptionCreate(
topic: PRODUCTS_CREATE
webhookSubscription: {
arn: "arn:aws:events:us-east-1::event-source/aws.partner/shopify.com/...."
format: JSON
})
{
webhookSubscription {
id
}
userErrors {
message
}
}
}
I get the following response:
{
"data": {
"eventBridgeWebhookSubscriptionCreate": {
"webhookSubscription": null,
"userErrors": [
{
"message": "You cannot create a webhook subscription with the specified topic"
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 10,
"throttleStatus": {
"maximumAvailable": 2000,
"currentlyAvailable": 1990,
"restoreRate": 100
}
}
}
}
I had the same bug and fixed it by using the workaround described here : https://community.shopify.com/c/Shopify-APIs-SDKs/AWS-EventBridge-set-up/m-p/816093
Was having the same issue. Took me a bit to realize that I was using the admin token from a different app to register the webhook. I switched to the admin token from the correct app and the webhook subscription post worked.
Hi.
I have a question about Event Source. I've tried to add Event Source in the Shopify Admin area with my AWS info. Event Source was created in the Shopify application, but it doesn't appear in the AWS console. What do I need to check to make it available in the AWS?
Thanks.
Hi,
I followed this video tutorial, and it worked for me fine.
However, I am stuck after that, since I am not sure how to connect back to the Shopify backend and then update things, based on the webhooks payload.