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
andORDER_STATUS_CHANGE
notification types have been removed. Please update your applications to use theORDER_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
ORDER_CHANGE
notificationTo 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.
Step 2. Poll the queue to retrieve the latest ORDER_CHANGE
messages
ORDER_CHANGE
messages-
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. -
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.
-
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.
-
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. -
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:
- Check notification messages with an
OrderStatus
ofUpComing
,Pending
, orUnshipped
. Check thatMFN
is within theFulfillmentChannel
attribute. - Retrieve order and shipping information with the
getOrder
operation. - Pass this information to the
getEligibileShipmentServices
operation and follow the steps in Fulfill seller-fulfilled Prime and non-Prime order.
Updated about 11 hours ago