Amazon EventBridge
Amazon EventBridge is a serverless event bus that distributes events to connect application components and build highly scalable, resilient, event-driven applications. It provides a simple way to consume BigCommerce webhook events at scale, and it is an alternative to HTTPS and Google Cloud Pub/Sub delivery.
To deliver webhooks to Amazon EventBridge, complete the following steps:
- Set up an event source
- Associate your event source with an event bus
- Create a rule for the event bus
- Apply a target to the rule
- Create an Amazon EventBridge webhook
Prerequisites
To send the following GraphQL queries and view responses, import the examples into Postman or any other tool that supports GraphQL queries. Set the following variables before you start:
GraphQL Admin API endpoints use the X-Auth-Token header to authenticate to BigCommerce servers. To call the Admin GraphQL API, use an API client tool such as Postman.
Set up an event source
Setting up an event source with EventBridge lets you send event data directly to Amazon services instead of receiving that traffic yourself through a front-end web server. Create an event source with the createEventSource mutation.
Request
Response
Make note of the event_source_arn and event_source_name
Obtain the event_source_arn and event_source_name from the createEventSource mutation response. You use these values in the following steps, so save them as environment variables in Postman.
Associate an event bus
Next, associate the event source with an event bus:
Request
Response
Create a rule
Create a rule to route specified events to the event bus. Without a rule, all events are ignored.
Request
Response
Apply a target to the rule
Add the target to the specified rule. This step lets Amazon SQS receive message requests so you can verify end-to-end delivery.
Request
Response
Create an Amazon EventBridge webhook
Create the webhook with the createEventBridgeWebhook mutation, using the event source ARN as the destination.
Request
Response
Receive the event message
Trigger the event to receive the event message. Although the SQS API has limited JSON support, you can use SQS Receive Messages to view the event message.
For a complete reference of all BigCommerce webhook events and their callback payloads, see Webhook Events.
Troubleshooting
Field validation errors
To resolve a validation error, update the specified field to a valid value.
Internal validation errors
Retry the request after a short delay to resolve an internal error.