Template variables reference
On this page
Every variable and helper you can use in a custom template, in one place. Variables pull live order data into your document; helpers format it.
Wrap a variable in double curly braces to print its value: {{order.name}} prints the order number, such as #1042. The same list is available inside the editor: {} Vars opens a picker, and ? Help opens this reference with copy-and-paste examples.
New to custom templates? Start with Custom Templates.
Order#
| Variable | Shows |
|---|---|
{{order.name}} |
The order number, such as #1042 |
{{order.created_at}} |
The order date, in your store's timezone |
{{order.phone}} |
The phone number entered at checkout |
{{order.note}} |
The order note |
{{order.tags_string}} |
The order's tags, comma separated |
{{order.po_number}} |
The purchase order number |
{{order.source_name}}, {{order.channel_name}} |
Where the order came from |
{{order.financial_status}}, {{order.fulfillment_status}} |
Payment and fulfillment status |
{{order.payment_gateway_names_string}} |
How the customer paid, such as "Vipps" |
{{order.ship_by_date}} |
The ship-by date |
{{order.total_weight}} |
Total weight |
{{order.currency}} |
Currency code |
Money#
| Variable | Shows |
|---|---|
{{order.subtotal}} |
Subtotal |
{{order.discount_total}} |
Discounts |
{{order.shipping_cost}} |
Shipping |
{{order.tax_total}} |
Tax |
{{order.total_price}} |
Order total |
{{order.amount_paid}}, {{order.balance_due}} |
Paid so far, and what is still owed |
Money values come formatted with the currency. Each has a _raw twin, such as {{order.total_price_raw}}, for the plain number.
Addresses#
{{shipping_address.name}}, .company, .phone, .address1, .address2, .city, .province_code, .zip, .country.
{{shipping_address.formatted}} prints the whole address with line breaks. Add white-space: pre-line in your CSS so the breaks show.
The same fields exist under {{billing_address.*}}, including .formatted.
Line items#
Loop over the items in the order:
{{#each line_items}}
{{this.quantity}} × {{this.title}}
{{/each}}
| Inside the loop | Shows |
|---|---|
{{this.title}} |
Product and variant name |
{{this.product_title}} |
Product name without the variant |
{{this.variant_title}} |
Variant name |
{{this.quantity}} |
Quantity |
{{this.sku}} |
SKU |
{{this.price}}, {{this.unit_price}}, {{this.line_total}} |
Prices |
{{this.weight}} |
Weight |
{{this.image_url}} |
Product image |
{{this.tags}} |
Product tags |
Outside the loop, {{total_quantity}} is the total number of units and {{line_items.length}} is the number of distinct items.
Line item properties#
Properties are the per-item details a buyer or another app adds at checkout, such as "Gift Wrap: Yes" or an engraving message.
Print them all inside the loop:
{{#each this.custom_attributes}}{{this.key}}: {{this.value}}{{/each}}
Or pull one by name with {{this.custom.<Name>}}. Spaces become underscores, so "Gift Wrap" is {{this.custom.Gift_Wrap}}. Properties whose names start with an underscore belong to other apps and are hidden automatically.
Your company and the customer#
| Variable | Shows |
|---|---|
{{company.name}}, .address, .phone, .email, .website |
Your store details from Settings |
{{company.logo_url}} |
Your default logo |
{{company.square_logo_url}} |
Your square logo |
{{company.tax_id}} |
Your tax ID |
{{customer.tax_id}} |
A business buyer's tax ID |
Logos and the tax ID are set under Settings → Branding. See Branding & Tax ID.
Accent color: use var(--brand-accent) in your CSS to pick up the accent color from Branding. Brand intensity applies to built-in templates only.
Shipping#
{{shipping.method}}, {{shipping.tracking_company}} (the carrier, such as USPS), {{shipping.tracking_number}}, {{shipping.tracking_url}}.
Fulfillment location#
For shops that ship from more than one Shopify location:
| Variable | Shows |
|---|---|
{{fulfillment_location.name}} |
The location's name |
{{fulfillment_location.address1}}, {{fulfillment_location.address2}} |
Street address |
{{fulfillment_location.city}}, .province, .zip, .country |
City, region, postal code, and two-letter country code |
{{fulfillment_location.phone}} |
The location's phone number |
These fill in whenever the document belongs to a known location, including orders that ship entirely from one place. They are empty on invoices for split orders, which always cover the whole order, so they are safe to add to any template. See Multi-Location Printing.
Your store's custom fields#
Order attributes, metafields, and line item properties from your own recent orders appear in the {} Vars picker:
{{order.custom.<name>}}for order attributes{{order.meta.<namespace>.<key>}}for order metafields{{this.custom.<name>}}for line item properties, inside the line items loop
Helpers#
Show something only sometimes#
{{#if settings.showPrices}} … {{/if}}{{#ifNotEmpty order.note}} … {{/ifNotEmpty}}{{#ifEquals a b}} … {{/ifEquals}}{{#if (hasTag this.tags "fragile")}} … {{/if}}checks a product tag
Format values#
| Helper | Does |
|---|---|
{{formatCurrency amount}}, {{formatPrice amount currency}} |
Formats money |
{{formatDate isoString}} |
A date |
{{formatDateTime isoString}} |
Date plus 24-hour time, such as 7/7/2026 18:45. Use {{formatDateTime order.created_at_raw}} for the exact order time |
{{formatDateOffset isoString days}} |
A date some days later, such as a return-by date |
{{formatQuantity this.quantity total format}} |
Quantity display |
{{multiply a b}}, {{addOne index}} |
Simple math |
{{removePrefix value "PO-"}} |
Strips a prefix |
Dates and times always use your store's timezone, set in Shopify admin under Settings → General.
Barcodes and codes#
| Helper | Does |
|---|---|
{{barcode value}} |
A barcode from any value |
{{resolveBarcode path this}} |
Looks up a value by its variable path, such as "order.name", to feed a barcode |
{{qrCode url}} |
A QR code from any link or text |
{{lookupBin this "location.bin"}} |
Reads a product metafield, such as a bin location for a pick slip |
Need a variable that is not here? Email support@autoprinter.app and tell us which Shopify field you need.