Docs

Send Events to Amazon EventBridge 

Enhance your business workflows by integrating Chargebee events with Amazon EventBridge, using AWS native infrastructure. This integration simplifies your event-handling process and enables scalable, event-driven automation.

About Amazon EventBridge 

Amazon EventBridge is a serverless event bus that connects application components using events. It helps you build and manage event-driven applications more efficiently.

By streaming Chargebee events directly to your AWS account via EventBridge, you can reduce the effort of handling webhook-based event delivery. EventBridge can route events to supported targets, enabling you to trigger workflows and automation seamlessly.

Sending events from Chargebee to Amazon EventBridge 

Prerequisites 

Before you begin, ensure you have the following:

Step 1: Configure Event Streaming in Chargebee 

  1. Log in to your Chargebee account.

  2. Navigate to Settings > Configure Chargebee > API Keys and Events > Event Streams.

  3. Click Set Up Event Stream to configure the event stream.

    1. Enter the following details: 

      1. Ensure that the Stream Name follows this format - <sitename_eventstream>. For example, if your stream name is acme.chargebee.com then the event stream name will be acme_eventstream.
      2. AWS EventBridge is selected by default as a Service.
      3. Under the AWS Account Number field, enter your AWS Account ID where events are supposed to be received and the EventBridge is currently hosted.
      4. Under AWS Region, select the region where their AWS account is currently hosted.
        Note: If the region where your AWS account is hosted is not on the list, please contact Chargebee support to add your region. 
    2. Once all the mandatory fields, such as Stream Name, AWS Account Number, and AWS Region, are entered, click Next.

    3. Set up API version and ability to mask card information 

      1. Chargebee supports multiple API versions. The Select API Version field provides the option to select the API version based on which the event content is structured. While processing events, ensure that the API version is the same as the API version used as part of your calls to Chargebee.
      2. Enable Send card information to include card information in the event stream. Click Next to navigate to the section to select the events that you want to send.
    4. Use the dropdown menu to select the Chargebee events that will be sent via this webhook. All Events are selected by default. However, select just the intended set of events in this list to enable your systems to handle the volume of events triggered. Click Activate to complete the setup of Amazon EventBridge from the Chargebee.

    5. Click Finish to complete the setup.

Step 2: Set Up the Event Bus in Amazon EventBridge 

  1. Sign in to your AWS account and complete the process by setting up EventBridge configuration in the Amazon Management console.
  2. Navigate to the Amazon EventBridge > Integrations > Partner event sources.
  3. Select the button next to the partner event source and then choose Associate with event bus. Grant the required permissions. Learn more about event buses.
  4. After the event bus is associated, the status of the event source changes from Pending to Active in Chargebee under the Event Streams tab and the name of the event bus updates to match the partner event source name. You can now start creating rules that match events from the partner event source.

Creating Event Routing Rules

Event routing is based on rules you define in EventBridge. After you associate a partner event source with an event bus, you must configure rules to determine how events are handled.

You can create multiple rules to route different types of events to specific targets as needed.

To create a rule:

  1. Define the rule
  2. Build the event pattern
  3. Select targets
  4. Configure tags and review rule

Step 3: Test the Event Streaming Setup Between Chargebee and Amazon EventBridge 

You can test the event streaming setup to ensure that events from Chargebee are received successfully in Amazon EventBridge.

  1. Trigger an event in Chargebee: Perform an action in Chargebee that corresponds to a subscribed event—for example, create a new subscription.
  2. Check event reception in EventBridge: Open the EventBridge console and navigate to the configured event bus or the target destination (such as CloudWatch Logs).
  3. Verify event details: Select the received event to view its details and ensure that it contains the expected information.
  4. Use the Test Stream option (optional): Alternatively, go to the Event Streams tab in Chargebee and select Test Stream to simulate event delivery and verify the setup.

Limitations 

  • Payload size restriction: Amazon EventBridge supports a maximum payload size of 256 KB. If your payload exceeds this limit, contact Chargebee Support for assistance with alternative setup options.
  • Event delivery order: Amazon EventBridge does not guarantee the order of event delivery. This behavior is similar to how webhook delivery works today.
  • Event source provisioning window: After you initiate the creation of an event source, Amazon EventBridge retains the provisioning for 7 days. You must associate the event bus with the partner event source within this period.
  • Retry handling: Event retry mechanisms are fully managed by Amazon EventBridge. Chargebee delivers events to the EventBridge ecosystem, after which your systems are responsible for retrieving and processing those events according to your business requirements.
Was this article helpful?
Loading…