Common challenge: Developers sometimes have difficulty reading notifications for all order status updates.
Best practice: Use one of the following two methods to fetch order status updates:
1. Call the API: Regularly call the getOrder API for order status updates until a terminal status [Complete, CompletePartialled, Canceled, Unfulfillable] is achieved on the order. Tracking details are shared in the response when its available which could be during Processing, Complete, and PartiallyComplete status.
2. Subscribe to notifications: By subscribing to notifications and listening to the event FULFILLMENT_ORDER_STATUS. Every time there is change on the order status or a tracking number is generated, a notification is emitted that needs to be read from an SQS queue.
API calling is a pull mechanism and developers might not be aware of the frequency of API calling. The suggested practice is to read notifications and only call the getOrder API for full order details after the order is completed.
By following this approach, you can:
• Reduce the bandwidth required to call APIs frequently.
• Gain awareness of early tracking details.
• Get real-time notifications, as API calls may come with delays.
• Get notifications of updates to tracking numbers, if any.