Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
Hi,
We are using the EventBridge bus option to send store webhook data directly to our AWS SQS queue.
This works fine in most cases because the message size is small enough to fit in a single SQS message, but if the message is too large we get an error telling us to load the data from the api, i.e.:
{
"version": "0",
"id": "d6eb4836-91a0-a347-1108-06daa4ad7ac2",
"detail-type": "shopifyWebhook",
"source": "aws.partner/shopify.com/xxx/shopify-production",
"account": "xxx",
"time": "2024-09-26T17:55:38Z",
"region": "us-east-1",
"resources": [],
"detail": {
"payload": {
"id": 123
},
"metadata": {
"Content-Type": "application/json",
"X-Shopify-Topic": "orders/fulfilled",
"X-Shopify-Shop-Domain": "xxx",
"X-Shopify-Order-Id": "xxx",
"X-Shopify-Test": "false",
"X-Shopify-Hmac-SHA256": "xxx",
"X-Shopify-Webhook-Id": "xxx-68c6-4957-8818-xxx",
"X-Shopify-API-Version": "2024-01",
"X-Shopify-Event-Id": "xxx-ee1c-4046-ba64-xxx",
"X-Shopify-Triggered-At": "2024-09-26T17:55:33.722279521Z"
},
"errors": [
{
"code": "payload_too_large",
"message": "The payload is larger than the supported limit. Use the API to retrieve your data."
}
]
}
}
This is fine for order update events because we can load the order data from either the REST or GraphAPIs but we also see this error for cart updates like this:
{
"version": "0",
"id": "xxx-6d3d-8545-c475-xxx",
"detail-type": "shopifyWebhook",
"source": "aws.partner/shopify.com/xxx/shopify-production",
"account": "xxx",
"time": "2024-09-27T07:56:48Z",
"region": "us-east-1",
"resources": [],
"detail": {
"payload": {
"id": "xxx"
},
"metadata": {
"Content-Type": "application/json",
"X-Shopify-Topic": "carts/update",
"X-Shopify-Shop-Domain": "xxx",
"X-Shopify-Hmac-SHA256": "xxx",
"X-Shopify-Webhook-Id": "xxx-xxx-4c27-9976-xxx",
"X-Shopify-API-Version": "2024-01",
"X-Shopify-Event-Id": "xxx-089b-4f8b-9199-xxx",
"X-Shopify-Triggered-At": "2024-09-27T07:56:31.094245705Z"
},
"errors": [
{
"code": "payload_too_large",
"message": "The payload is larger than the supported limit. Use the API to retrieve your data."
}
]
}
}
In this case we can't see any method of loading the cart payload data via the API.
How can we fetch the large data for cart update events?
Thanks