Set up notifications (Amazon EventBridge workflow)

Learn how to set up your system to receive notifications using the Amazon EventBridge workflow.

Learn how to set up your system to receive the following notifications using the Amazon EventBridge workflow:

If you want to receive any other notification type, skip this tutorial and refer to Set up notifications (Amazon Simple Queue Service workflow).

Prerequisites

To complete this tutorial you need:

  • Authorization from the selling partners (sellers or vendors) for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.

  • An AWS account. This AWS account will be responsible for charges related to receiving notifications. If you are not already an AWS customer, you can create a free AWS account. For more information, refer to AWS Free Tier.

  • A target resource to receive notification events from your Amazon EventBridge bus. For more information, refer to What Is Amazon EventBridge?

  • A basic understanding of Amazon EventBridge. For more information, refer to Amazon EventBridge.

Step 1. Create a destination

  1. Call the createDestination operation to create an Amazon EventBridge destination.

📘

Note

You can only create one EventBridge destination per AWS account.

Parameter Description Required
resourceSpecification The information required to create a destination resource. In this workflow, include the eventBridge specification.

Type: resourceSpecification

Yes
name A developer-defined name to help identify this destination.

Type: string

Yes

📘

Note

Calling the createDestination operation does not require authorization from any selling partner. In this respect, this operation is a "grantless" operation and has a different authorization model from most other Selling Partner API operations. For more information, refer to Grantless operations.

  1. Save the following values:

Step 2. Configure Amazon EventBridge to handle notifications

Associate an event bus with your partner event source. For definitions, refer to Terminology.

  1. Go to Amazon EventBridge and sign in to the AWS Console using the AWS Account ID that you specified when you called the createDestination operation in Step 1. Create a destination.

  2. In the console, ensure that the AWS Region that you specified when you called the createDestination operation is selected.

  3. In the navigation pane, choose Partner event sources.

  4. In the Partner event sources area, under Name, select the partner event source that matches the resource:eventBridge:name value returned in Step 1. Create a destination. The partner event source is in this format: aws.partner/sellingpartnerapi.amazon.com/{AWS Account Id}/{Application Id}.

  5. On the new page that appears, choose Associate with event bus.

  6. On the Associate with event bus page, leave the checkboxes empty and choose Associate.

You have created a partner event bus and associated it with your partner event source. Go to Step 3. Create a rule that starts on a notification event.

Step 3. Create a rule that starts on a notification event

Create a rule that watches for specific notification events and routes them to the target resource of your choice.

  1. Go to Amazon EventBridge. If you are not already signed in to the AWS Console, sign in using the AWS Account ID that you specified when you called the createDestination operation in Step 1. Create a destination.

  2. In the Console, ensure that the AWS Region that you specified when you called the createDestination operation is selected.

  3. In the navigation pane, choose Rules.

  4. Choose Create rule.

  5. Enter a name and optional description for the rule.

  6. For Event bus, select the bus that you associated with the partner event source.

  7. Choose Next.

  8. For Event source, select AWS events or EventBridge partner events.

  9. For Creation method, select Use pattern form.

  10. In Event pattern:

    • Choose Event source, select EventBridge partners.
    • For the Partner dropdown, select Amazon Selling Partner APIs.
    • For the Event type dropdown, select All Events.

    The event pattern that displays should be similar to the following, which indicates that you will receive all events emitted by sellingpartnerapi.amazon.com:

    {
      "source": [
        {
          "prefix": "aws.partner/sellingpartnerapi.amazon.com"
        }
      ]
    }
    
  11. (Optional) Edit the event pattern to include rules that match only the notification events that you want. The following event pattern contains a rule that matches only BRANDED_ITEM_CONTENT_CHANGE events from sellingpartnerapi.amazon.com:

    {
      "source": [
        {
          "prefix": "aws.partner/sellingpartnerapi.amazon.com"
        }
      ],
      "detail-type": ["BRANDED_ITEM_CONTENT_CHANGE"]
    }
    

    For information about creating more complex rules, refer to Event Patterns in the Amazon EventBridge Developer Guide.

  12. Choose Next.

  13. Now select the AWS service that is to act when an event of the selected type is detected. Enter other information specific to this target type, if required.

    📘

    Note

    For many target types, EventBridge needs permissions to send events to the target. In these cases, you can create a new IAM role or you can use an existing IAM role. Do one of the following:

    • To create an IAM role, select Create a new role for this specific resource.
    • To use an IAM role that you have already created, select Use existing role.

    📘

    Note

    To verify that events are coming through your EventBridge, you can use an SQS queue as a target for the rule you created, and then poll that SQS queue as notifications arrive.

  14. (Optional) Choose Add another target to add another target for this rule if you need more than one.

  15. Choose Next.

  16. (Optional) Enter one or more tags for the rule. For more information, refer to Tagging Your Amazon EventBridge Resources in the AWS documentation.

  17. Choose Next.

  18. Choose Create rule.

Troubleshooting:

Step 4. Create a subscription

Subscribe to a notification type, to be delivered to the destination that you created in Step 1. Create a destination.

Note: We allow multiple subscriptions with different payload versions per application, notification type, and party (seller/vendor). For supported payload versions of different notification type, refer to notificationType.

  1. Call the createSubscription operation, passing the following parameters:

Path parameters:

Parameter Description Required
notificationType Information about the notification type and payload version to which you want to subscribe.

Possible values: BRANDED_ITEM_CONTENT_CHANGE, ITEM_PRODUCT_TYPE_CHANGE, LISTINGS_ITEM_STATUS_CHANGE, LISTINGS_ITEM_ISSUES_CHANGE, LISTINGS_ITEM_MFN_QUANTITY_CHANGE, PRODUCT_TYPE_DEFINITIONS_CHANGE. Refer to notificationType.

Type: string

Yes

Body parameters:

Parameter Description Required
payloadVersion The version of the payload object to be used in the notification. For supported payloadVersion for different notification types, refer to notificationType.

Type: string

Yes
destinationId The identifier for the destination where notifications will be delivered. Use the destinationId value that you saved in Step 1. Create a destination.

Type: string

Yes

You are now subscribed to receive BRANDED_ITEM_CONTENT_CHANGE notifications.