Skip to article
auto·printerHelpSystem status
All help articles

Template variables reference

Updated · 7 min read

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.

Example interface
Custom template editor · HTML and preview
Edit HTML or CSS, insert data with Vars, and open Preview to see the current draft. These are sample template variables.Scroll across the illustration to see the full view.

Order#

Variable Shows
{{order.name}} The order number, such as #1042
{{order.created_at}} The order date, in your store's timezone and date format
{{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, in your store's date format
{{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 in the order's currency, with its own symbol: a GBP order prints £108.00 and a euro order prints €42.50. Each has a _raw twin, such as {{order.total_price_raw}}, for the plain number.

Once you choose a format under Settings → Language and format, money also follows that region's style, such as 1.234,50 € for Germany. See Language and format.

Taxes and discounts#

Variable Shows
{{#each order.tax_lines}} Loops over the order's taxes
{{this.title}}, {{this.percentage}}, {{this.amount}} Inside that loop: the tax name, its rate such as 8.25%, and the amount
{{#each order.discount_applications}} Loops over the order's discounts
{{this.value}} Inside that loop: the discount, such as 10% or $10.80

Percentages follow your language and format too, so a German format prints 8,25 %.

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.

Once you choose a format under Settings → Language and format, {{shipping_address.lines}} holds the address lines in the order the destination country expects, such as the postcode before the city for Germany. It leaves out the name and company, so print those first, as in the example below. The country line uses your document language, and .formatted follows the same layout.

<div>{{shipping_address.name}}</div>
{{#ifNotEmpty shipping_address.company}}<div>{{shipping_address.company}}</div>{{/ifNotEmpty}}
{{#if shipping_address.lines}}
  {{#each shipping_address.lines}}<div>{{this}}</div>{{/each}}
{{else}}
  {{#ifNotEmpty shipping_address.address1}}<div>{{shipping_address.address1}}</div>{{/ifNotEmpty}}
  {{#ifNotEmpty shipping_address.address2}}<div>{{shipping_address.address2}}</div>{{/ifNotEmpty}}
  <div>{{shipping_address.city}}, {{shipping_address.province_code}} {{shipping_address.zip}}</div>
  {{#ifNotEmpty shipping_address.country}}<div>{{shipping_address.country}}</div>{{/ifNotEmpty}}
{{/if}}

lines is empty when your store uses the current format, or when Shopify could not send the formatted address, so keep a fallback like the one above.

The same fields exist under {{billing_address.*}}, including .formatted and .lines.

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 are set under Settings → Branding; the tax ID under Settings → Store information. 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}} Formats money in the order's currency
{{formatPrice amount currency}} Formats money with its currency code. In the current format it prints the symbol and the code, such as £108.00 GBP. Once you choose a format under Settings → Language and format, the code takes the symbol's place, such as GBP 108.00 or 1.234,50 EUR. Pass the order's currency: {{formatPrice order.total_price_raw order.currency}}. If you leave the currency out, the current format uses USD; a chosen format uses the order's currency
{{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. They print in the date format from Settings → Language and format: 10/6/2026 in the current US format, 06/10/2026 for the United Kingdom, 6.10.2026 for Germany.

formatDate and formatDateOffset accept an ISO date, such as {{order.created_at_raw}}, or a date already in your store's format, such as {{order.created_at}}. So {{formatDateOffset order.created_at 30}} prints the date 30 days after the order. For the exact order time, use {{formatDateTime order.created_at_raw}}.

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.

Did this help?

Still stuck?

Use the Need help? button inside Autoprinter, or email support@autoprinter.app. Average response time: one business day.

Related articles

  • Custom Templates

    Design your own documents — change the layout, add images and branding, and pull in live order data.

  • Customize a built-in template

    Every switch and option on the built-in packing slip, invoice, return slip, gift receipt, and pick slip.

  • Multi-Location Printing

    Print each location's part of a split order separately, on the printer at that location.