August 2024

Callback support for Order updates

7min

Date: August 25, 2024 We've introduced an optional callback attribute for order updates in PUT APIs to allow developers to receive the order status asynchronously.

New Features

This mechanism minimizes the need for repetitive polling by the client to verify update success. It reduces the server load and ensures real-time feedback

  • Allows developers to receive confirmation of successful updates without manual checks.
  • Enhances the reliability of update operations by notifying through a specified URL.

Callback workflow

The basic process involves adding a callback attribute to your API requests, which contains the URL or endpoint where notifications can be sent once a defined event occurs.

Update Request

Include the callback attribute in the request body when making a PUT request.

Configure

  • Ensure the provided callback URL is accessible and properly configured to handle incoming requests.
  • The endpoint should return a success status code (e.g., 200 OK) upon receiving a notification.

Example Use Case

An order is updated in the logistics order service. The system sends a POST request to the specified callback URL in the attribute. The response is processed to confirm successful notification delivery.

Limitations

  • Tokens used in API requests expire after a defined time period (e.g., 30 minutes).
  • Ensure to refresh tokens and update your requests accordingly to avoid authentication issues.

API Changes

The following APIs have been updated to include the new callback attribute:

Developer Resources

For detailed information on how to use this new attribute, refer to our updated How to Guide for Order Update.