Articles on: Integrations

Klaviyo Advanced: Text Variables and Dynamic Item Blocks

Plans: Pro, Premium, Enterprise, and API users. Metric availability varies across plans Platforms: All platforms


Overview


Explore our extensive list of variables for Klaviyo Emails and SMS triggered by AfterShip metrics. Tailor your communication with precision and elevate your customer engagement using text variables and dynamic item blocks.


What you’ll learn


In this tutorial, we’ll discuss:




AfterShip flow metrics


When using the AfterShip and Klaviyo integration, a set of flow metrics are automatically made available directly in your Klaviyo account. Each metric maps to a specific shipment or order event and can be used as a trigger to build automated flows in Klaviyo.


Metrics classified as Order events include Order event fields (STORE and ORDER categories). Metrics classified as Shipment events include the full range of fields, covering the COURIER and SHIPMENT categories as well. See the General fields table below for a complete breakdown of field availability.


  1. Pre-ship emails


Metric Name

Event Type

Description

Plan Availability

AfterShip: Pre-Ship – Order Confirmation

Order

Triggered when an order is created. Notifies customers that their order has been successfully received.

Pro, Premium, Enterprise Standard, Enterprise Advanced, API Standard, API Advanced

AfterShip: Pre-Ship – Fulfillment Stalled

Order

Triggered when an order remains unfulfilled for a configurable number of days after creation.

Enterprise Standard, Enterprise Advanced, API Standard, API Advanced

AfterShip: Pre-Ship – Partial Fulfillment

Order

Triggered when an order is partially fulfilled. A separate notification is sent for each partial shipment.

Pro, Premium, Enterprise Standard, Enterprise Advanced, API Standard, API Advanced


  1. Delivery summary emails


Metric Name

Event Type

Description

Plan Availability

AfterShip: Delivery Summary – All Items Fulfilled

Order

Triggered when all shipments in an order have been shipped and the order status changes to “Fulfilled.”

Pro, Premium, Enterprise Standard, Enterprise Advanced, API Standard, API Advanced

AfterShip: Delivery Summary – All Items Delivered

Order

Triggered when all shipments in a split order have been successfully delivered.

Pro, Premium, Enterprise Standard, Enterprise Advanced, API Standard, API Advanced


  1. Delivery update emails


Metric Name

Event Type

Description

Plan Availability

AfterShip: Delivery Updates – Info Received

Shipment

Triggered when shipment information is received and the package is awaiting courier pickup.

Pro, Premium, Enterprise Standard, Enterprise Advanced, API Standard, API Advanced

AfterShip: Delivery Updates – In Transit

Shipment

Triggered when the package has been picked up and is on its way to the customer.

Pro, Premium, Enterprise Standard, Enterprise Advanced, API Standard, API Advanced

AfterShip: Delivery Updates – Out for Delivery

Shipment

Triggered when the shipment is scheduled for delivery and is out for delivery that day.

Pro, Premium, Enterprise Standard, Enterprise Advanced, API Standard, API Advanced

AfterShip: Delivery Updates – Available for Pickup

Shipment

Triggered when the shipment has arrived at a pickup location and is ready for collection.

Pro, Premium, Enterprise Standard, Enterprise Advanced, API Standard, API Advanced

AfterShip: Delivery Updates – Delivered

Shipment

Triggered when the shipment has been successfully delivered.

Pro, Premium, Enterprise Standard, Enterprise Advanced, API Standard, API Advanced


  1. Delivery exception emails


Metric Name

Event Type

Description

Plan Availability

AfterShip: Delivery Exceptions – Exception

Shipment

Triggered when a shipment encounters an issue, such as delay, loss, customs hold, damage, or return to sender.

Pro, Premium, Enterprise Standard, Enterprise Advanced, API Standard, API Advanced

AfterShip: Delivery Exceptions – Failed Delivery Attempt

Shipment

Triggered when a delivery attempt is unsuccessful.

Pro, Premium, Enterprise Standard, Enterprise Advanced, API Standard, API Advanced

AfterShip: Delivery Exceptions – Shipment Stalled

Shipment

Triggered when no tracking updates are received for a configurable number of days, regardless of shipment status.

Enterprise Standard, Enterprise Advanced, API Standard, API Advanced



  1. Delivery anticipation emails (EDD)


Metric Name

Event Type

Description

Plan Availability

AfterShip: EDD – Delivery Anticipation

Shipment

Triggered when a shipment is expected to arrive the next day, helping set customer expectations proactively.

Enterprise Standard, Enterprise Advanced, API Standard, API Advanced

AfterShip: EDD – EDD Revised

Shipment

Triggered when the estimated delivery date (EDD) is updated.

Enterprise Standard, Enterprise Advanced, API Standard, API Advanced

AfterShip: EDD – EDD Missed

Shipment

Triggered when the estimated delivery date passes without successful delivery.

Enterprise Standard, Enterprise Advanced, API Standard, API Advanced


Text variables - General fields


Field availability: COURIER and SHIPMENT category fields are exclusive to Shipment events and return null in Order events. STORE and ORDER category fields are available in both event types. CustomFields is also limited to Shipment events only.


General fields


Category

Trigger Filters & Splits

Variable

Description

STORE

StoreName

{{ event.StoreName }}

Your store's name, sourced from your platform connection, commerce API, or order CSV.

STORE

StoreURL

{{ event.StoreURL }}

Your store's URL, sourced from your platform connection, commerce API, or order CSV.

COURIER

CourierName

{{ event.CourierName }}

The courier's name.

COURIER

CourierSlug

{{ event.CourierSlug }}

The courier's slug identifier.

COURIER

CourierContact

{{ event.CourierContact }}

The courier's contact information.

COURIER

CourierWebURL

{{ event.CourierWebURL }}

The courier's website URL.

COURIER

CourierRedirectURL

{{ event.CourierRedirectURL }}

The courier's URL where customers can redirect their parcel.

COURIER

CourierTrackingURL

{{ event.CourierTrackingURL }}

The courier's tracking page URL.

SHIPMENT

TrackingNumber

{{ event.TrackingNumber }}

The shipment's tracking number.

SHIPMENT

ShipmentTrackingURL

{{ event.ShipmentTrackingURL }}

The URL to your AfterShip branded tracking page, with the tracking number as a pre-set parameter. Shopify users who want to direct customers to a Proxy URL embed should enable "From notifications" under Tracking pages → Embedding → Embed on Shopify using a proxy URL.

SHIPMENT

ShipmentCurrentStatus

{{ event.ShipmentCurrentStatus }}

The shipment's current delivery status in AfterShip.

SHIPMENT

ShipmentCurrentSubStatus

{{ event.ShipmentCurrentSubStatus }}

The shipment's current delivery substatus in AfterShip.

SHIPMENT

ShipmentDeliveryAddress

{{ event.ShipmentDeliveryAddress }}

The shipment's destination address.

SHIPMENT

LatestLocation

{{ event.LatestLocation }}

The shipment's most recent known location.

SHIPMENT

LatestUpdateTime

{{ event.LatestUpdateTime }}

The time of the most recent courier update on the shipment.

SHIPMENT

LatestCourierMessage

{{ event.LatestCourierMessage }}

The most recent checkpoint message from the courier.

SHIPMENT

CourierEstimatedDeliveryDate

{{ event.CourierEstimatedDeliveryDate }}

The courier's estimated delivery date, sourced directly from AfterShip's courier tracking integrations.

SHIPMENT

AfterShipAIEstimatedDeliveryDate

{{ event.AfterShipAIEstimatedDeliveryDate }}

AfterShip's AI Predicted Estimated Delivery Date (AIEDD), calculated using AI and proprietary tracking data to deliver above-industry accuracy.

SHIPMENT

AfterShipCustomSettingEstimatedDeliveryDate

{{ event.AfterShipCustomSettingEstimatedDeliveryDate }}

A custom estimated delivery date configured in the AfterShip Tracking admin dashboard. Useful for merchants with their own EDD logic based on shipping type, courier, or destination.

SHIPMENT

PromisedDeliveryDate

{{ event.PromisedDeliveryDate }}

A merchant-defined delivery date passed to AfterShip via the Tracking API, representing the merchant's own delivery projection.

SHIPMENT

LatestEstimatedDeliveryDate

{{ event.LatestEstimatedDeliveryDate }}

The most relevant estimated delivery date, resolved in this priority order: Courier EDD → AfterShip AI EDD → Promised delivery date → Custom EDD.

SHIPMENT

PickupLocation

{{ event.PickupLocation }}

The location where the customer can pick up their package.

SHIPMENT

SignedBy

{{ event.SignedBy }}

The recipient's information at the time of delivery.

SHIPMENT

CourierServiceType

{{ event.CourierServiceType }}

The courier service type used for the shipment (e.g., UPS Express Saver®).

SHIPMENT

Note

{{ event.Note }}

Additional notes configured for the shipment in AfterShip.

SHIPMENT

ShipmentPackageCount

{{ event.ShipmentPackageCount }}

The number of packages in this shipment.

SHIPMENT

ShipDate

{{ event.ShipDate }}

The date the shipment was shipped.

SHIPMENT

PickupDate

{{ event.PickupDate }}

The date the shipment was picked up.

SHIPMENT

DeliveryDate

{{ event.DeliveryDate }}

The date the shipment was delivered.

SHIPMENT

DestinationCity

{{ event.DestinationCity }}

The shipment's destination city.

SHIPMENT

DestinationState

{{ event.DestinationState }}

The shipment's destination state.

SHIPMENT

DestinationCountryIso3

{{ event.DestinationCountryIso3 }}

The shipment's destination country in ISO 3 format.

SHIPMENT

DestinationCountryName

{{ event.DestinationCountryName }}

The shipment's destination country name.

SHIPMENT

DestinationPostalCode

{{ event.DestinationPostalCode }}

The shipment's destination postal code.

SHIPMENT

TransitTime

{{ event.TransitTime }}

The total transit time for this shipment so far, in days.

SHIPMENT

OriginCity

{{ event.OriginCity }}

The shipment's origin city.

SHIPMENT

OriginState

{{ event.OriginState }}

The shipment's origin state.

SHIPMENT

OriginCountryIso3

{{ event.OriginCountryIso3 }}

The shipment's origin country in ISO 3 format.

SHIPMENT

OriginCountryName

{{ event.OriginCountryName }}

The shipment's origin country name.

SHIPMENT

OriginPostalCode

{{ event.OriginPostalCode }}

The shipment's origin postal code.

SHIPMENT

ShipmentWeight

{{ event.ShipmentWeight }}

The shipment's weight value.

SHIPMENT

ShipmentWeightUnit

{{ event.ShipmentWeightUnit }}

The unit of measurement for the shipment's weight.

SHIPMENT

ShipmentTitle

{{ event.ShipmentTitle }}

The shipment's title as set in AfterShip.

SHIPMENT

ImportSource

{{ event.ImportSource }}

The source through which the tracking was imported into AfterShip.

SHIPMENT

Language

{{ event.Language }}

The language of the notification.

ORDER

OrderNumber

{{ event.OrderNumber }}

The customer-facing order number.

ORDER

OrderID

{{ event.OrderID }}

The merchant's internal order ID.

ORDER

OrderName

{{ event.OrderName }}

The order name as displayed in your eCommerce store (e.g., #1001).

ORDER

OrderStatus

{{ event.OrderStatus }}

The order's current fulfillment status.

ORDER

OrderDate

{{ event.OrderDate }}

The date the order was placed.

ORDER

OrderCurrency

{{ event.OrderCurrency }}

The currency used for the order.

ORDER

OrderTaxesIncluded

{{ event.OrderTaxesIncluded }}

Indicates whether the order total includes taxes (true/false).

ORDER

OrderTotal

{{ event.OrderTotal }}

The order's total price, including taxes and shipping.

ORDER

OrderSubtotal

{{ event.OrderSubtotal }}

The order subtotal, before taxes and shipping.

ORDER

OrderShippingTotal

{{ event.OrderShippingTotal }}

The order's total shipping cost.

ORDER

OrderDiscountTotal

{{ event.OrderDiscountTotal }}

The total discount amount applied to the order.

ORDER

OrderTaxTotal

{{ event.OrderTaxTotal }}

The total tax amount charged for the order.

ORDER

OrderTags

{{ event.OrderTags }}

The order's tags from your eCommerce store.

ORDER

OrderPathURL

{{ event.OrderPathURL }}

The URL where customers can view their order on your eCommerce store.

ORDER

OrderStatusPageURL

{{ event.OrderStatusPageURL }}

The order status page URL on your eCommerce platform.

ORDER

OrderTrackingURL

{{ event.OrderTrackingURL }}

The URL to your AfterShip branded tracking page, with order number and customer email/phone as pre-set parameters. Shopify users who want to direct customers to a Proxy URL embed should enable "From notifications" under Tracking pages → Embedding → Embed on Shopify using a proxy URL.

ORDER

CustomerName

{{ event.CustomerName }}

The customer's full name.

ORDER

CustomerFirstName

{{ event.CustomerFirstName }}

The customer's first name.

ORDER

CustomerEmailAddress

{{ event.CustomerEmailAddress }}

The customer's email address.

ORDER

TotalShipments

{{ event.TotalShipments }}

The total number of shipments under this order.

ORDER

ShippingAddress

{{ event.ShippingAddress }}

The order's formatted shipping address.

ORDER

BillingAddress

{{ event.BillingAddress }}

The order's formatted billing address.


Text variables - Custom fields


Category

Trigger Filters & Splits

Variable

Description

Custom

custom_fields_{your custom field key}

{{ event.CUSTOMFIELD_{KEY} }}

User-described fields created via AfterShip Tracking API, CSV, or in the Admin. For example, if you created “store_name” as a custom field, use it to set up your flow triggers.


If you have any queries, feel free to connect with our support team for quick assistance.


Items block


If your AfterShip organization is seamlessly linked to an eCommerce store or if you are importing shipments via Commerce API or order CSV, the dynamic items block in your Klaviyo account becomes your powerhouse.


Event Data Property Name

Details

OrderLineItems

Items encapsulated within the order.

ShipmentLineItems

Items shipped by the carrier.

ToShipItems

An array of line items for fulfillable products not attached to any shipments—representing "yet to ship" or backordered items.

OtherShipmentsInThisOrder

An array of other shipments in the order, and their line items.

AllShipmentsInThisOrder

An array of all shipments in the order, and their line items.


OrderLineItems Configuration


  1. Configure the data source elements using markdown:


Property

Event Variables

Row collection

event.OrderLineItems

Row alias

line_item


  1. Next, leverage these variables within your dynamic table block:


Property

Event Variables

Item Title

{{ line_item.ItemTitle }}

Item Quantity

{{ line_item.ItemQuantity }}

Item Variant Title

{{ line_item.ItemVariantTitle }}

Item URL

{{ line_item.ItemURL }}

Product Image

{{ line_item.ItemImages }}

Product Unit Price Amount

{{ line_item.ItemtUnitPrice.amount }}

Product Unit Price Currency

{{ line_item.ItemtUnitPrice.currency }}

Product Final Line Price Amount

{{ line_item.ItemFinalPrice.amount }}

Product Final Line Price Currency

{{ line_item.ItemFinalPrice.currency }}

SKU

{{ line_item.SKU }}

Requires Shipping

{{ line_item.RequiresShipping }}

Total Amount

{{ line_item.Total.amount }}

Total Currency

{{ line_item.Total.currency }}

Discount Amount (optional)

{{ line_item.Discount.amount }}

Discount Currency (optional)

{{ line_item.Discount.currency }}

Tax Amount (optional)

{{ line_item.Tax.amount }}

Tax Currency (optional)

{{ line_item.Tax.currency }}


Efficiently configure and utilize OrderLineItems variables for a dynamic and enriched presentation in your Klaviyo dynamic table block.


ShipmentLineItems Configuration


  1. Configure the data source elements using markdown:


Property

Event Variables

Row collection

event.ShipmentLineItems

Row alias

line_item


  1. Next, leverage these variables within your dynamic table block:


Property

Event Variables

Item Title

{{ line_item.ItemTitle }}

Item Quantity

{{ line_item.ItemQuantity }}

Item Variant Title

{{ line_item.ItemVariantTitle }}

Item URL

{{ line_item.ItemURL }}

Product Image

{{ line_item.ItemImages }}

Product Unit Price Amount

{{ line_item.ItemtUnitPrice.amount }}

Product Unit Price Currency

{{ line_item.ItemtUnitPrice.currency }}

Product Final Line Price Amount

{{ line_item.ItemFinalPrice.amount }}

Product Final Line Price Currency

{{ line_item.ItemFinalPrice.currency }}

SKU

{{ line_item.SKU }}

Requires Shipping

{{ line_item.RequiresShipping }}

Total Amount

{{ line_item.Total.amount }}

Total Currency

{{ line_item.Total.currency }}

Discount Amount (optional)

{{ line_item.Discount.amount }}

Discount Currency (optional)

{{ line_item.Discount.currency }}

Tax Amount (optional)

{{ line_item.Tax.amount }}

Tax Currency (optional)

{{ line_item.Tax.currency }}


Additionally, the following JSX example showcases how to use these variables:


{{line_item.ItemTitle}}
{{line_item.ItemVariantTitle}}*{{ line_item.ItemQuantity }}
{{line_item.ItemFinalPrice.amount}} {{line_item.ItemFinalPrice.currency}}


Efficiently configure and utilize ShipmentLineItems variables for a dynamic and enriched presentation in your Klaviyo dynamic table block.


ToShipItems Configuration - Split Shipment


Available for Enterprise Standard, Enterprise Advanced, API Standard, API Advanced plans only


  1. Configure the data source elements using markdown:


Property

Event Variables

Row collection

event.ToShipItems

Row alias

line_item


  1. Next, leverage these variables within your dynamic table block:


Property

Event Variables

Item Title

{{ line_item.ItemTitle }}

Item Quantity

{{ line_item.ItemQuantity }}

Item Variant Title

{{ line_item.ItemVariantTitle }}

Item URL

{{ line_item.ItemURL }}

Product Image

{{ line_item.ItemImages }}

Product Unit Price Amount

{{ line_item.ItemtUnitPrice.amount }}

Product Unit Price Currency

{{ line_item.ItemtUnitPrice.currency }}

Product Final Line Price Amount

{{ line_item.ItemFinalPrice.amount }}

Product Final Line Price Currency

{{ line_item.ItemFinalPrice.currency }}

SKU

{{ line_item.SKU }}

Requires Shipping

{{ line_item.RequiresShipping }}

Total Amount

{{ line_item.Total.amount }}

Total Currency

{{ line_item.Total.currency }}

Discount Amount (optional)

{{ line_item.Discount.amount }}

Discount Currency (optional)

{{ line_item.Discount.currency }}

Tax Amount (optional)

{{ line_item.Tax.amount }}

Tax Currency (optional)

{{ line_item.Tax.currency }}


Efficiently configure and utilize ToShipItems variables for a dynamic and enriched presentation in your Klaviyo dynamic table block.


OtherShipmentsInThisOrder Configuration - Split Shipment


Available for Enterprise Standard, Enterprise Advanced, API Standard, API Advanced plans only


This section details related shipments using a nested loop to display their contents and status. It's a complex block requiring technical support. If you lack resources, contact your customer success manager for assistance; AfterShip Support can provide the code for you to integrate into your email content.


  1. Configure the data source elements using markdown:


Property

Event Variables

Row collection

event.OtherShipmentsInThisOrder

Row alias

line_item


  1. Next, leverage these variables within your dynamic table block:


Property

Example

CourierName

{{ line_item.CourierName }}

TrackingNumber

{{ line_item.TrackingNumber }}

ShipmentCurrentStatus

{{ line_item.ShipmentCurrentStatus }}

LatestEstimatedDeliveryDate

{{ line_item.LatestEstimatedDeliveryDate }}

DeliveryDate

{{ line_item.DeliveryDate }}

ShipmentLineItems

The line items array for the contents of the fulfillment.


AllShipmentsInThisOrder Configuration - Split Shipment


Available for Enterprise Standard, Enterprise Advanced, API Standard, API Advanced plans only


  1. Configure the data source elements using markdown:


Property

Event Variables

Row collection

event.AllShipmentsInThisOrder

Row alias

line_item


  1. Next, leverage these variables within your dynamic table block:


Property

Example

CourierName

{{ line_item.CourierName }}

TrackingNumber

{{ line_item.TrackingNumber }}

ShipmentCurrentStatus

{{ line_item.ShipmentCurrentStatus }}

LatestEstimatedDeliveryDate

{{ line_item.LatestEstimatedDeliveryDate }}

DeliveryDate

{{ line_item.DeliveryDate }}

ShipmentLineItems

The line items array for the contents of the fulfillment.


This section details related shipments using a complex nested loop for displaying contents and status. For technical support, contact your customer success manager; AfterShip Support can share the code for your email content integration.


Need help?


If you have any queries, feel free to connect with our support team for quick assistance.

Updated on: 23/03/2026