Subscribe to MFN notifications

Learn how to use the Notifications API to subscribe to notifications that are relevant to a selling partner's business.

Learn how to use the Selling Partner API for Notifications to subscribe to notifications that are relevant to a selling partner's business. With this API, you can create a destination to receive, subscribe, and delete notification subscriptions. Instead of polling for information, your application can receive information directly from Amazon when an event activates a notification to which you are subscribed.

🚧

Important

Sellers can subscribe to the ORDER_CHANGE notification, which is sent whenever there is an order availability status change.

The MFN_ORDER_STATUS_CHANGE and ORDER_STATUS_CHANGE notification types have been removed. Please update your applications to use the ORDER_CHANGE notification. ORDER_CHANGE sends an order-level payload whenever there is an important change in the order. Important changes include order status changes and buyer requested cancellations. For detailed information about SP-API deprecation dates, refer to the deprecations table.

Step 1. Subscribe to the ORDER_CHANGE notification

To set up and subscribe to the ORDER_CHANGE notification, follow the Notifications API SQS Tutorial. The following figure provides an illustrated overview of the tutorial.

The workflow to subscribe to the `ORDER_CHANGE` notification.

Step 2. Poll the queue to retrieve the latest ORDER_CHANGE messages

  1. Retrieve the queue URL: Connect to the SQS service and retrieve the URL for the queue that receives the ORDER_CHANGE messages. This URL uniquely identifies the queue and is used to interact with it.

  2. Configure polling parameters: Review the polling parameters to determine how frequently and how many messages to retrieve at a time. This includes the wait time between subsequent polling attempts and the maximum number of messages to retrieve in each request.

  3. Poll the queue: To poll the queue, send the requests to retrieve the messages. Use the ReceiveMessage operation to retrieve the messages from the queue. When you call this operation, you can specify the queue URL, maximum number of messages to retrieve, and other optional parameters, such as visibility timeout.

    Alternatively, you can configure event source mapping to automatically invoke a Lambda function when new messages arrive to the SQS queue. For more information on event source mapping, refer to Tutorial: Using Lambda with Amazon SQS.

  4. Process the messages: When you receive the messages, you can process them according to your application's requirements. In the case of ORDER_CHANGE messages from the SP-API, you can extract the relevant information, such as the order ID, status change details, and timestamps.

  5. Delete processed messages: After each message is successfully processed, make sure to delete it from the queue with the DeleteMessage operation provided by SQS. This step ensures that the processed messages are removed from the queue and won't be retrieved again in subsequent polling attempts.

Step 3. Process the order information and call shipment services

The ORDER_CHANGE notification returns high-level information related to the order, such as the OrderId, OrderItemId and the OrderStatus. To learn more about response attributes, refer to ORDER_CHANGE notifications.

To automate the fulfillment process, you must: