Sending Notifications

This documentation outlines typical scenarios for sending notifications related to Commerce API, and provides detailed instructions on how to utilize the API effectively in each case. For additional scenarios and further information, please refer to the index page.

AfterShip Tracking enables you to send timely email notifications for various delivery statuses. These prompt notifications help ensure your customers are consistently informed about the progress of their orders.

FieldDescriptionSample
customerCustomer information object-
customer.emailsThe customer's email array["[email protected]"]
{ "source_id": "CM1011", "number": "CM1011", "currency": "USD", "status": "open", "delivery_method": "shipping", "order_total": "9.5", "items": [ { "source_id": "9716591689898", "product_variant_title": "Mobile Phone Case", "quantity": 1 } ], "source_created_at": "2023-02-16T01:00:10Z", "source_updated_at": "2023-02-16T01:00:10Z", "customer": { "emails": [ "[email protected]" ] } }

To enable SMS notifications, ensure that you include valid customer phone numbers in the order payload under the customer.phones field.

FieldDescriptionSample
customerCustomer information object-
customer.phonesThe customer's phone number array["+12025553750"]
{ "source_id": "CM1011", "number": "CM1011", "currency": "USD", "status": "open", "delivery_method": "shipping", "order_total": "9.5", "items": [ { "source_id": "9716591689898", "product_variant_title": "Mobile Phone Case", "quantity": 1 } ], "source_created_at": "2023-02-16T01:00:10Z", "source_updated_at": "2023-02-16T01:00:10Z", "customer": { "phones": [ "+12025553750" ] } }

When creating a new notification workflow, you can use the Order Status as the trigger.

AfterShip Notifications page listing Shipment order status with the Order fulfillment flow card offering Email and SMS
Edit trigger dialog for the Order fulfillment flow with the Unfulfilled status checked in the Trigger filters dropdown

To set up a notification workflow based on an order's status, be sure to include the fulfillment_status parameter when creating the order via Commerce API.

FieldDescriptionSample
customerCustomer information object-
customer.emailsThe customer's email array["[email protected]"]
customer.phonesThe customer's phone array["+12025553750"]
fulfillment_statusThe status of fulfillment associated with the orderunfulfilled
{ "source_id": "CM1011", "number": "CM1011", "currency": "USD", "status": "open", "delivery_method": "shipping", "order_total": "9.5", "items": [ { "source_id": "9716591689898", "product_variant_title": "Mobile Phone Case", "quantity": 1 } ], "source_created_at": "2023-02-16T01:00:10Z", "source_updated_at": "2023-02-16T01:00:10Z", "customer": { "emails": [ "[email protected]" ] }, "fulfillment_status": "unfulfilled" }

When editing the notification workflow, you can apply trigger filters to specify which data elements will initiate or halt a particular flow.

Order fulfillment trigger filters with Unfulfilled and Partially fulfilled selected and the Add filter field list open

The following table outlines which fields in various resources are associated with each trigger filter.

Commerce API Resource FieldTrigger Filter NameExample Value
numberOrder numberCM1011
statusOrder statusopen
items.*.product_categoriesProduct type["makeup"]
shipping_address.country_regionDestination country/regionUSA
Commerce API Resource FieldTrigger Filter NameExample Value
trackings.*.slugSlug"fedex"
trackings.*.custom_fieldsCustom fields{"customer_tag": "testing"}
In transit flow trigger filter dropdown listing Source, Transit time, Custom fields, Estimated delivery date and carrier Slug
Trigger Filter NameFilter Value
SourcePlease select automizely-private from the list to indicate the orders imported via Commerce API
Order fulfillment trigger filters: Fulfilled statuses plus a Source is any of automizely-private filter, with Save button

The AfterShip product recommendation feature allows you to showcase the most relevant products to your customers by analyzing various behaviors and criteria. To use this feature, you need to import a minimum of order and product resources into AfterShip.

For configuring the product recommendation feature for the notifications, please refer to this page.

With Buy Online, Pickup In Store (BOPIS) & Buy Online, Ship to Store (BOSS) tracking, shoppers will be able to track when and where to pick up their orders. Proactively communicate with customers, enabling them to prepare for order pickups. Businesses control the information in BOPIS & BOSS tracking page and notifications.

For configuring the BOPIS & BOSS feature for the notifications, please refer to this page.