Template variables for Flow

Add template variables to actions to include details about the customer, order, or product involved in your workflow.

Template variables are placeholders that are replaced with values when a workfow runs. These variables describe the attributes of the customers, orders, and products that are involved in your workflows. For example, there are template variables for the order number, order price, customer name, and so on.

The names of most template variables are self-describing. For example, the template variable that displays the name of the product is {{ product.title }}. When the message is sent, this variable is replaced with the name of the ordered product: Large Coffee Mug.

Adding template variables to actions

The easiest way to add template variables is to click the Add template variable link and choose a variable from the list.

You can add template variables to any text field that contains the Add template variable link:

A close-up of the workflow builder that shows the Send email action with the Add template variable link.

The template variables in the Add template variable list are filtered, so that you only see the variables that apply to the trigger that you've chosen. After you choose a variable from the list, it is properly formatted and added to the text box for you.

Template variables

Variables that apply to the Customer created action:

Variables that apply to the Inventory quantity changed and Product added actions:

Variables that apply to the Order paid and Order risk analyzed actions:

Variables that apply to the Order fulfilled action:

Variables that apply to the Refund order action:

Customer variables

The following table describes the template variables related to customers:

Template variables and their descriptions.
Variable name Description
customer.acceptsMarketing Whether the customer has agreed to receive marketing materials.
customer.averageOrderAmountV2.amount Average amount that the customer spent per order.
customer.canDelete Whether the merchant can delete the customer from the store.
customer.createdAt The date and time when the customer was added to the store.
customer.displayName Full name of the customer, based on first name + last name.
customer.email
customer.firstName
customer.hasNote Whether the customer has a note associated with them.
customer.hasTimelineComment Whether the merchant has added timeline comments about the customer on the customer's page.
customer.id Globally unique identifier.
customer.lastName
customer.lifetimeDuration Time since the customer was first added to the store.
customer.note Note about the customer written by the merchant.
customer.ordersCount Number of orders that the customer has made at the store in their lifetime.
customer.phone
customer.state State or province where the customer resides.
customer.taxExempt Whether the customer is exempt from being charged taxes on their orders.
customer.totalSpent Total amount that the customer has spent on orders in their lifetime.
customer.UpdatedAt The date and time when the customer was last updated.
customer.verifiedEmail Whether the email address is formatted correctly.
customer.defaultAddress.address1 Address line 1 (Street address/PO Box/Company name).
customer.defaultAddress.address2 Address line 2 (Apartment/Suite/Unit/Building).
customer.defaultAddress.city City/District/Suburb/Town/Village.
customer.defaultAddress.company Company/Organization/Government.
customer.defaultAddress.country State/County/Province/Region.
customer.defaultAddress.countryCode Two-letter country code.
customer.defaultAddress.firstName First name of the customer.
customer.defaultAddress.formattedArea Comma-separated list of city, province, and country.
customer.defaultAddress.lastName Last name of the customer.
customer.defaultAddress.latitude Latitude coordinate of the customer address.
customer.defaultAddress.longitude Longitude coordinate of the customer address.
customer.defaultAddress.name Name of the customer, based on first name + last name.
customer.defaultAddress.phone Unique phone number for the customer.
customer.defaultAddress.province State/County/Province/Region.
customer.defaultAddress.provinceCode Two-letter province or state code.
customer.defaultAddress.zip Zip/Postal Code.
customer.image.altText A word or phrase to share the nature or contents of an image.
customer.lastOrder.billingAddressMatchesShippingAddress Whether the billing address matches the shipping address.
customer.lastOrder.buyerAcceptsMarketing Whether the customer agreed to receive marketing materials.
customer.lastOrder.canMarkAsPaid Whether the order can be manually marked as paid.
customer.lastOrder.cancelReason Reason the order was canceled.
customer.lastOrder.capturable Whether payment for the order can be captured.
customer.lastOrder.cartDiscountAmountSet.shopMoney.amount Amount of the order-level discount (does not contain any line item discounts).
customer.lastOrder.clientIp The ip address of the client that is associated with this order.
customer.lastOrder.closed Whether the order is closed.
customer.lastOrder.confirmed Whether inventory has been reserved for the order.
customer.lastOrder.currencyCode The currency of the store at the time of the order.
customer.lastOrder.customerLocale
customer.lastOrder.discountCode Discount code provided by the customer.
customer.lastOrder.displayFinancialStatus Financial status of the order that can be shown to the merchant.
customer.lastOrder.displayFulfillmentStatus Fulfillment status for the order that can be shown to the merchant.
customer.lastOrder.email Email address provided by the customer.
customer.lastOrder.fulfillable Whether there are items that can be fulfilled.
customer.lastOrder.fullyPaid Whether the order has been paid in full.
customer.lastOrder.hasTimelineComment Whether the merchant added timeline comments to the order.
customer.lastOrder.landingPageDisplayText
customer.lastOrder.name Unique identifier for the order that appears on the order.
customer.lastOrder.netPaymentSet.shopMoney.amount Net payment for the order, based on the total amount received - total amount refunded.
customer.lastOrder.note Contents of the note associated with the order.
customer.lastOrder.phone Phone number provided by the customer.
customer.lastOrder.referralCode Marketing referral code from the link that the customer clicked to visit your store.
customer.lastOrder.referrerDisplayText Website that sent the customer to your online store.
customer.lastOrder.refundable Whether the order can be refunded.
customer.lastOrder.requiresShipping Whether any line item in the order requires physical shipping.
customer.lastOrder.riskLevel Fraud risk level of the order.
customer.lastOrder.subtotalPriceSet.shopMoney.amount Subtotal of the line items and their discounts (does not contain shipping costs, shipping discounts, and order-level discounts).
customer.lastOrder.taxesIncluded Whether taxes are included in the subtotal price of the order.
customer.lastOrder.test Whether the order is a test.
customer.lastOrder.totalCapturable Amount authorized for the order, that is uncaptured or undercaptured.
customer.lastOrder.totalDiscountsSet.shopMoney.amount Total amount discounted from the order (includes order-level and line item discounts).
customer.lastOrder.totalPriceSet.shopMoney.amount Total amount of the order (includes taxes and discounts).
customer.lastOrder.totalReceived Total amount received by the customer for the order.
customer.lastOrder.totalRefunded Total amount refunded for the order.
customer.lastOrder.totalShippingPrice Total amount charged for shipping the order.
customer.lastOrder.totalTax Total of all taxes applied to the order.
customer.lastOrder.totalWeight Total weight (grams) of the order.
customer.lastOrder.unpaid Whether no payments have been made for the order.

Fulfillment variables

The following table describes the template variables related to fulfillment:

Descriptions of template variables related to fulfillment.
Variable name Description
fulfillment.displayStatus Human readable display status for this fulfillment.
fulfillment.id Globally unique identifier.
fulfillment.name Human readable reference identifier for this fulfillment.
fulfillment.status
fulfillment.totalQuantity
fulfillment.service.handle Human-readable unique identifier for this fulfillment service.
fulfillment.service.inventoryManagement
fulfillment.service.productBased
fulfillment.service.serviceName
order.all_line_items_shippable

Order variables

The following table describes the template variables related to orders:

Descriptions of template variables related to orders.
Variable name Description
order.billingAddressMatchesShippingAddress Whether the billing address matches the shipping address.
order.buyerAcceptsMarketing Whether the customer agreed to receive marketing materials.
order.canMarkAsPaid Whether the order can be manually marked as paid.
order.cancelReason Reason the order was canceled.
order.cancelledAt Date and time when the order was cancelled.
order.capturable Whether payment for the order can be captured.
order.cartDiscountAmountSet.shopMoney.amount Amount of the order-level discount (does not contain any line item discounts).
order.clientIp The ip address of the client that is associated with this order.
order.closed Whether the order is closed.
order.closedAt Date and time when the order was cancelled.
order.confirmed Whether inventory has been reserved for the order.
order.createdAt Date and time when the order was created.
order.currencyCode The currency of the store at the time of the order.
order.customerLocale
order.discountCode Discount code provided by the customer.
order.displayFinancialStatus Financial status of the order that can be shown to the merchant.
order.displayFulfillmentStatus Fulfillment status for the order that can be shown to the merchant.
order.email Email address provided by the customer.
order.fulfillable Whether there are items that can be fulfilled.
order.fullyPaid Whether the order has been paid in full.
order.hasTimelineComment Whether the merchant added timeline comments to the order.
order.id Globally unique identifier.
order.customerJourney.lastVisit.landingPageHtml
order.lineItems An array of order line items.
order.name Unique identifier for the order that appears on the order.
order.netPaymentSet.shopMoney.amount Net payment for the order, based on the total amount received - total amount refunded.
order.note Contents of the note associated with the order.
order.phone Phone number provided by the customer.
order.presentmentCurrencyCode The payment currency of the customer for this order.
order.processedAt Date and time when the order was processed.
order.customerJourney.lastVisit.referralCode Marketing referral code from the link that the customer clicked to visit your store.
order.customerJourney.lastVisit.referralInfoHtml Website that sent the customer to your online store.
order.refundable Whether the order can be refunded.
order.requiresShipping Whether any line item in the order requires physical shipping.
order.riskLevel Fraud risk level of the order.
order.subtotalPriceSet.shopMoney.amount Subtotal of the line items and their discounts (does not contain shipping costs, shipping discounts, and order-level discounts).
order.taxesIncluded Whether taxes are included in the subtotal price of the order.
order.test Whether the order is a test.
order.totalCapturableSet.shopMoney.amount Amount authorized for the order, that is uncaptured or undercaptured.
order.totalDiscountsSet.shopMoney.amount Total amount discounted from the order (includes order-level and line item discounts).
order.totalPriceSet.shopMoney.amount Total amount of the order (includes taxes and discounts).
order.totalReceivedSet.shopMoney.amount Total amount received by the customer for the order.
order.totalRefundedSet.shopMoney.amount Total amount refunded for the order.
order.totalShippingPriceSet.shopMoney.amount Total amount charged for shipping the order.
order.totalTaxSet.shopMoney.amount Total of all taxes applied to the order.
order.totalWeight Total weight (grams) of the order.
order.unpaid Whether no payments have been made for the order.
order.UpdatedAt Date and time when the order was last modified.
order.billingAddress.address1 Address line 1 (Street address/PO Box/Company name).
order.billingAddress.address2 Address line 2 (Apartment/Suite/Unit/Building).
order.billingAddress.city City/District/Suburb/Town/Village.
order.billingAddress.company Company/Organization/Government.
order.billingAddress.country State/County/Province/Region.
order.billingAddress.countryCodeV2 Two-letter country code.
order.billingAddress.firstName First name of the customer.
order.billingAddress.formattedArea Comma-separated list of city, province, and country.
order.billingAddress.lastName Last name of the customer.
order.billingAddress.latitude Latitude coordinate of the customer address.
order.billingAddress.longitude Longitude coordinate of the customer address.
order.billingAddress.name Name of the customer, based on first name + last name.
order.billingAddress.phone Unique phone number for the customer.
order.billingAddress.province State/County/Province/Region.
order.billingAddress.provinceCode Two-letter province or state code.
order.billingAddress.zip Zip/Postal Code.
order.publication.name Name of the publication.
order.publication.supportsFuturePublishing Whether or not this publication supports future publishing.
order.customer.acceptsMarketing Whether the customer has agreed to receive marketing materials.
order.customer.averageOrderAmountV2.amount Average amount that the customer spent per order.
order.customer.canDelete Whether the merchant can delete the customer from the store.
order.customer.displayName Full name of the customer, based on first name + last name.
order.customer.email
order.customer.firstName
order.customer.hasNote Whether the customer has a note associated with them.
order.customer.hasTimelineComment Whether the merchant has added timeline comments about the customer on the customer's page.
order.customer.lastName
order.customer.lifetimeDuration Time since the customer was first added to the store.
order.customer.note Note about the customer written by the merchant.
order.customer.ordersCount Number of orders that the customer has made at the store in their lifetime.
order.customer.phone
order.customer.state State or province where the customer resides.
order.customer.taxExempt Whether the customer is exempt from being charged taxes on their orders.
order.customer.totalSpent Total amount that the customer has spent on orders in their lifetime.
order.customer.verifiedEmail Whether the email address is formatted correctly.
order.customerJourney.customerOrderIndex
order.customerJourney.daysToConversion
order.displayAddress.address1 Address line 1 (Street address/PO Box/Company name).
order.displayAddress.address2 Address line 2 (Apartment/Suite/Unit/Building).
order.displayAddress.city City/District/Suburb/Town/Village.
order.displayAddress.company Company/Organization/Government.
order.displayAddress.country State/County/Province/Region.
order.displayAddress.countryCodeV2 Two-letter country code.
order.displayAddress.firstName First name of the customer.
order.displayAddress.formattedArea Comma-separated list of city, province, and country.
order.displayAddress.lastName Last name of the customer.
order.displayAddress.latitude Latitude coordinate of the customer address.
order.displayAddress.longitude Longitude coordinate of the customer address.
order.displayAddress.name Name of the customer, based on first name + last name.
order.displayAddress.phone Unique phone number for the customer.
order.displayAddress.province State/County/Province/Region.
order.displayAddress.provinceCode Two-letter province or state code.
order.displayAddress.zip Zip/Postal Code.
order.customerJourney.firstVisit.utmParameters.campaign
order.customerJourney.firstVisit.utmParameters.content
order.customerJourney.firstVisit.utmParameters.medium
order.customerJourney.firstVisit.utmParameters.source
order.customerJourney.firstVisit.utmParameters.term
order.physicalLocation.isActive Indicates whether or not a location is active.
order.physicalLocation.name
order.physicalLocation.shipsInventory Indicates whether or not this location ships inventory.
order.shippingAddress.address1 Address line 1 (Street address/PO Box/Company name).
order.shippingAddress.address2 Address line 2 (Apartment/Suite/Unit/Building).
order.shippingAddress.city City/District/Suburb/Town/Village.
order.shippingAddress.company Company/Organization/Government.
order.shippingAddress.country State/County/Province/Region.
order.shippingAddress.countryCodeV2 Two-letter country code.
order.shippingAddress.firstName First name of the customer.
order.shippingAddress.formattedArea Comma-separated list of city, province, and country.
order.shippingAddress.lastName Last name of the customer.
order.shippingAddress.latitude Latitude coordinate of the customer address.
order.shippingAddress.longitude Longitude coordinate of the customer address.
order.shippingAddress.name Name of the customer, based on first name + last name.
order.shippingAddress.phone Unique phone number for the customer.
order.shippingAddress.province State/County/Province/Region.
order.shippingAddress.provinceCode Two-letter province or state code.
order.shippingAddress.zip Zip/Postal Code.
order.shippingLine.custom
order.shippingLine.originalPriceSet.shopMoney.amount
order.shippingLine.shippingRateHandle
order.shippingLine.title
order.suggestedRefund.amountSet.shopMoney.amount
order.suggestedRefund.maximumRefundableSet.shopMoney.amount
order.suggestedRefund.subtotalSet.shopMoney.amount
order.suggestedRefund.totalTaxSet.shopMoney.amount

Product variables

The following table describes the template variables related to products:

Descriptions of template variables related to products.
Variable name Description
product.availablePublicationCount The number of channels a product is published on without feedback errors.
product.createdAt The date and time when the product was created.
product.defaultCursor A default cursor for use in pagination.
product.description Stripped description of the product, single line with HTML tags removed.
product.handle
product.hasOnlyDefaultVariant Whether the product has only a single variant with the default option and value.
product.hasOutOfStockVariants
product.id Globally unique identifier.
product.isGiftCard
product.publishedAt The date and time when the product was published to the online store.
product.productType
product.publicationCount The number of channels a product is published on.
product.publishedOnCurrentChannel Check to see if product is published to the calling app's channel.
product.templateSuffix
product.title
product.totalInventory
product.totalVariants
product.tracksInventory
product.UpdatedAt The date and time when the product was last modified.
product.vendor
product.feedback.summary
product.seo.description SEO Description.
product.seo.title SEO Title.
product_variant.availableForSale Indicates if the product variant is available for sale.
product_variant.barcode
product_variant.compareAtPrice
product_variant.defaultCursor A default cursor for use in pagination.
product_variant.displayName Display name of the variant, based on product's title + variant's title.
product_variant.harmonizedSystemCode
product_variant.id Globally unique identifier.
product_variant.inventoryManagement
product_variant.inventoryPolicy
product_variant.inventoryQuantity Total sellable quantity of the variant
product_variant.inventoryQuantityPrior
product_variant.position
product_variant.price
product_variant.requiresShipping
product_variant.sku
product_variant.taxable
product_variant.title
product_variant.weight
product_variant.weightUnit
product_variant.fulfillmentService.handle Human-readable unique identifier for this fulfillment service.
product_variant.fulfillmentService.inventoryManagement
product_variant.fulfillmentService.productBased
product_variant.fulfillmentService.serviceName
product_variant.image.altText A word or phrase to share the nature or contents of an image.
product_variant.product.availablePublicationCount The number of channels a product is published on without feedback errors.
product_variant.product.defaultCursor A default cursor for use in pagination.
product_variant.product.description Stripped description of the product, single line with HTML tags removed.
product_variant.product.handle
product_variant.product.hasOnlyDefaultVariant Whether the product has only a single variant with the default option and value.
product_variant.product.hasOutOfStockVariants
product_variant.product.isGiftCard
product_variant.product.productType
product_variant.product.publicationCount The number of channels a product is published on.
product_variant.product.publishedOnCurrentChannel Check to see if product is published to the calling app's channel.
product_variant.product.templateSuffix
product_variant.product.title
product_variant.product.totalInventory
product_variant.product.totalVariants
product_variant.product.tracksInventory
product_variant.product.vendor

Refund variables

The following table describes the template variables related to refunds:

Descriptions of template variables related to refunds.
Variable name Description
refund.id Globally unique identifier.
refund.note
refund.restocked
refund.staffMember.active Whether the staff member is active or not.
refund.staffMember.email
refund.staffMember.exists
refund.staffMember.firstName
refund.staffMember.isShopOwner Whether or not the user is an owner.
refund.staffMember.lastName
refund.staffMember.name
refund.staffMember.phone

Shop variables

The following table describes the template variables related to shops:

Description of template variables related to shops.
Variable name Description
shop.channelCount Exposes the number of channels.
shop.checkoutApiSupported Specifies whether the shop supports checkouts via Checkout API.
shop.currencyCode
shop.customerAccounts
shop.description
shop.email
shop.ianaTimezone
shop.myshopifyDomain
shop.name
shop.limitedPendingOrderCount.count
shop.setupRequired
shop.taxShipping Specifies whether or not taxes are charged for shipping.
shop.taxesIncluded The setting for whether applicable taxes are included in product prices.
shop.weightUnit
shop.billingAddress.address1 Address line 1 (Street address/PO Box/Company name).
shop.billingAddress.address2 Address line 2 (Apartment/Suite/Unit/Building).
shop.billingAddress.city City/District/Suburb/Town/Village.
shop.billingAddress.company Company/Organization/Government.
shop.billingAddress.country State/County/Province/Region.
shop.billingAddress.countryCode Two-letter country code.
shop.billingAddress.firstName First name of the customer.
shop.billingAddress.formattedArea Comma-separated list of city, province, and country.
shop.billingAddress.lastName Last name of the customer.
shop.billingAddress.latitude Latitude coordinate of the customer address.
shop.billingAddress.longitude Longitude coordinate of the customer address.
shop.billingAddress.name Name of the customer, based on first name + last name.
shop.billingAddress.phone Unique phone number for the customer.
shop.billingAddress.province State/County/Province/Region.
shop.billingAddress.provinceCode Two-letter province or state code.
shop.billingAddress.zip Zip/Postal Code.
shop.countriesInShippingZones.includeRestOfWorld Whether 'Rest of World' has been defined in any shipping zones.
shop.features.branding Branding of the shop.
shop.features.financialReports
shop.features.harmonizedSystemCode Display Harmonized System codes on products. Used for customs when shipping cross-border.
shop.features.liveView Whether to show the live view. Live view is hidden from merchants that are on a trial or don't have a storefront.
shop.features.shopifyPlus
shop.features.showMetrics Whether to show metrics. Metrics are hidden for new merchants until they become meaningful.
shop.features.storefront
shop.primaryDomain.host The host name of the domain (eg: example.com).
shop.primaryDomain.sslEnabled Whether SSL is enabled or not.
shop.resourceLimits.maxProductOptions Maximum number of product options allowed.
shop.resourceLimits.maxProductVariants Maximum number of variants allowed.
shop.resourceLimits.redirectLimitReached Whether the shop has reached the limit of the number of URL redirects it can make for resources.

LineItems template variables

If you have experience working with Shopify Liquid, then you might want to use advanced features like Liquid tags in your workflows. For example, you can use a for loop tag to list line item details, such as the name of each product order or its SKU and price. To do this, you also need to use the lineItems object (order.lineItems). The lineItems object that Flow supports is slightly different from the line_item object that's described in the Shopify Liquid documentation.

View examples of messages that use the lineItems object.

The following table describes the template variables that are supported for the lineItems object in Flow:

Descriptions of the template variables supported for LineItem objects.
Template variable Data type Description
canRestock Boolean Whether the item ordered in the line item can be restocked if it is returned or the order is canceled.
discountedTotal Money Amount of the discount applied to the line item.
discountedUnitPrice Money Unit price of the product variant after its per-unit discount had been applied.
fulfillableQuantity Integer Number of product variants that still need to be fulfilled. This value is based on _quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilledquantity.
fulfillmentStatus String How far along an order is in terms line items fulfilled. Valid values: fulfilled, null or partial.
name String Name of the ordered product.
nonFulfillableQuantity Integer Number of line items that cannot be fulfilled.
originalTotal Money Total price (without discounts) of the line item, based on the original unit price of the variant multiplied by the quantity ordered.
originalUnitPriceSet MoneyBag Variant price without any discounts applied.
Quantity Number Number of variant items ordered.
refundableQuantity Integer Number of items in the line item that can be refunded.
requiresShipping Boolean Whether physical shipping is required for the variant.
sku String Variant SKU number.
taxable Boolean Whether the variant is taxable.
title String Title of the product or variant (this field only applies to custom line items).
totalDiscount Money Total amount discounted from the order. Includes line item and order-level discounts.
unfulfilledDiscountedTotal Money
unfulfilledOriginalTotal Money
unfulfilledQuantity Integer
variantTitle String Name of the variant.
vendor String Name of the vendor who made the variant.

Advanced feature

If you are a developer with experience writing Shopify Liquid code, then you can also use Liquid to write your template variables. Learn more about Flow's Liquid support.

Examples

View examples of messages and notes that use template variables.

Ready to start selling with Shopify?

Try it free