AfterShip Tracking Common Scenario

One of the most common usage of the Commerce API is to import shipments to AfterShip Tracking, in order to send out the order/shipment update notification. Also the shopper can also visit AfterShip branded tracking page to view the order/shipment latest status or registering email/sms updates.

This document will describe several common usage scenarios for AfterShip Tracking, provided for your reference.


For importing shipments to AfterShip Tracking via Commerce API, you need to create both order and fulfillment resources.

You can import the your order with order endpoints, and also import your fulfillment with fulfillment endpoints. Once you have successfully imported order and fulfillment, you can view the shipments under the AfterShip Tracking admin portal.

The following table outlines the common required fields for the order resource, applicable to all scenarios mentioned below. Please ensure that you include all fields listed here. Depending on your specific use case, additional fields may be necessary to meet the requirements. Detailed descriptions of scenario-specific required fields will be provided in subsequent sections of this documentation.

FieldDescriptionSample
idThe unique identifier of the order. For most of the case it should be the same as the order ID of your system.CM1011
delivery_methodThe method by which the order will be delivered.shipping
numberThe order nameCM1011
currencyThe currency of the orderUSD
statusThe status of the orderopen
order_totalThe total price of the order9.5
itemsItems of order-
items.*.idA unique identifier for the line item in your system9716591689898
items.*.product_titleThe title of the productMobile Phone Case
items.*.quantityThe number of items that have been purchased1
source_created_atThe date and time (ISO 8601 format) when an order was created2023-02-16T01:00:10Z
source_updated_atThe date and time (ISO 8601 format) when an order was updated.2023-02-16T01:00:10Z
preparing...

For all information and logic related to fulfillment, please refer to the Fulfillment Resource. This includes details such as fulfillment status, tracking numbers, and courier information.

If your order has not yet been fulfilled, there is no need to create a fulfillment. The table below outlines the essential fields required to create a fulfillment. Depending on your specific use case, additional fields may be necessary to meet the requirements. Detailed descriptions of scenario-specific required fields will be provided in subsequent sections of this documentation.

FieldDescriptionSample
idA unique identifier for the shipment in your system.321324145553321
order_idThe order ID generated when creating the order with Order endpointsdc85ac8d298a4ed7bb5263d6e6c4f4e4
delivery_methodThe method by which the order will be delivered.shipping
statusFulfillment statuspending
line_itemsOrder items included in this fulfillment object-
line_items.*.idOrder item ID under your platform. The ID has to be exist in the order's line items9716591689898
line_items.*.quantityOrder item quantity for this fulfillment.2
ship_from_locationShip from location object-
ship_from_location.location_idThe ID of the location, which can be retrieved in hereda29876699374218bc6d18c9de8c91e8
ship_to_locationShip to location object-
ship_to_location.addressThe detailed address of the ship to locationPlease refer to the following sample JSON
trackingstracking number array-
trackings.*.tracking_numberTracking number.32332131122
trackings.*.ship_dateShip date of the package2024-05-05

Recommended Optional Fields

FieldDescriptionSample
trackings.*.slugCarrier slug.usps
ship_to_location.address.postal_codeThe postal code of the recipient’s address.065001
preparing...

Depending on your specific usage requirements, you may need to include additional auxiliary data alongside the common fields described in the previous section.

For comprehensive information on specific scenarios categories, please refer to each individual page.