POS print templates
On this page
POS print templates let you define exactly what gets printed when a cart quote, receipt, label, or document is triggered from a POS register. Templates are stored in Salesforce as POS Print Template records and rendered using Liquid at print time.
The POS Print Template system supports three output types:
- Receipt — formatted output for thermal receipt printers (Star Micronics, Epson)
- Label — ZPL or EPL commands for label printers (Zebra and compatible)
- Document — PDF output via a browser print dialog, for invoices, packing slips, and custom documents
Cart quotes use the same output types — a cart template with receipt printer type prints to the thermal printer, and one with document printer type produces a PDF.
How it works
Each POS Print Template record has two key settings:
- Context — determines what data is available in the template (
cart,receipt, orlabel) - Printer type — determines where the output is sent (
receipt,label, ordocument)
These settings are independent, which gives you flexibility. For example, you can send label-context data to a document printer to produce product label PDFs instead of printing directly to a label printer.
When a print action fires in the POS, StoreConnect:
- Looks up the template (by SFID or from the default set in POS settings)
- Builds a Liquid context from the template’s context setting
- Renders the Liquid template
- Sends the output to the matching printer
Create a POS print template
- In Salesforce, go to POS Print Templates in the StoreConnect navigation.
- Select New.
- Enter a Name for the template — use something descriptive, for example “Receipt — standard” or “Label — barcode 4x2”.
- Set the Context:
cart— template receives cart/quote data (current_cart,current_outlet,current_store)receipt— template receives order data (current_order,current_outlet,current_store)label— template receives product data (products,quantity)
- Set the Printer type:
receipt— output is sent to the thermal receipt printerlabel— output is sent to the label printerdocument— output is rendered as a PDF and sent to the browser print dialog
- Enter your Content — the Liquid template. See the sections below for syntax guidance by type.
- Select Save.
:::note The StoreConnect External ID field is auto-generated on save. Do not modify it. :::
Set default templates in POS settings
After creating templates, set them as defaults in POS Hardware Settings so they are used automatically when print actions run without a template override.
:::note [Screenshot needed — POS Settings → Hardware → default cart template selector, default receipt template selector, and default label template selector] :::
Template contexts and available variables
Cart context
Available when Context is set to cart.
| Variable | Type | Description |
|---|---|---|
current_cart |
Cart | The active cart/quote being printed |
current_outlet |
Outlet | The POS outlet where the print was triggered |
current_store |
Store | The store |
Key properties available on current_cart:
| Property | Description |
|---|---|
current_cart.id |
Cart token |
current_cart.items |
Array of line items in the cart |
current_cart.item_count |
Total quantity of all items |
current_cart.total |
Cart total (including tax) |
current_cart.sub_total |
Cart subtotal (excluding tax) |
current_cart.contact |
Customer contact, if set |
Use the cart context for templates that print quotes or order summaries for unpaid carts. Cart templates can target any printer type — use receipt to print to the thermal printer or document to produce a PDF.
Receipt context
Available when Context is set to receipt.
| Variable | Type | Description |
|---|---|---|
current_order |
Order | The order being printed |
current_outlet |
Outlet | The POS outlet where the print was triggered |
current_store |
Store | The store |
Use the receipt context for templates that print order summaries, receipts, invoices, or any output based on a completed order.
For receipt template syntax and a full working example, see Create or update a POS receipt template.
Label context
Available when Context is set to label.
| Variable | Type | Description |
|---|---|---|
products |
Array | The products to print labels for |
quantity |
Number | Number of labels to print per product (default: 1) |
Label templates iterate over products and quantity to generate the correct number of labels:
liquid
{% for product in products %}
{% for i in (1..quantity) %}
... label content for {{ product.name }} ...
{% endfor %}
{% endfor %}
For label template syntax, ZPL and EPL command reference, and working examples, see Create or update a POS label template.
:::tip
You don’t need to write ZPL from scratch. Free online ZPL preview tools let you design and test labels in the browser before adding them to StoreConnect. AI tools are also well-suited to generating ZPL for common label layouts — describe your label and ask it to produce the commands. Once you have working ZPL, wrap it in Liquid to inject product data using variables like {{ product.name }} and {{ product.sfid }}.
:::
Document (PDF) templates
When Printer type is set to document, the template renders as a PDF using the jsPDF library and opens the browser print dialog. This is suited to multi-line documents such as invoices, packing slips, and quotes.
Document templates use special Liquid tags that map directly to jsPDF methods, wrapped in a {% pdf %} block:
liquid
{% pdf orientation: 'portrait', format: 'a4' %}
{% set_font 'helvetica', 'bold' %}
{% set_font_size 16 %}
{% text 'Tax Invoice', 20, 20 %}
{% set_font 'helvetica', 'normal' %}
{% set_font_size 11 %}
{% text current_order.reference, 20, 32 %}
{% line 20, 40, 190, 40 %}
{% endpdf %}
For the full jsPDF tag reference and more examples, see Document print templates.
Print actions
POS print templates are triggered from POS layouts using print actions. You can attach these to action items, buttons, or other interactive elements.
print:cart
Prints the active cart as a quote using the default cart template, or a specified template override. If no cart_sc_id is provided, the currently active cart is used.
json
{
"action": "print:cart"
}
With a template override:
json
{
"action": "print:cart",
"params": "print_template_sfid=a2cMn00003s4X88IAE"
}
| Parameter | Required | Description |
|---|---|---|
cart_sc_id |
No | StoreConnect ID of the cart to print. Defaults to the active cart. |
print_template_sfid |
No | SFID of a cart-context template to use instead of the default |
print:receipt
Prints a receipt for an order using the default receipt template, or a specified template override.
json
{
"action": "print:receipt",
"params": "order_sc_id={{ record.id }}"
}
With a template override:
json
{
"action": "print:receipt",
"params": "order_sc_id={{ record.id }};print_template_sfid=a2cMn00003s4X88IAE"
}
| Parameter | Required | Description |
|---|---|---|
order_sc_id |
Yes | The order’s StoreConnect ID |
print_template_sfid |
No | SFID of a receipt-context template to use instead of the default |
print:labels
Prints product labels for one or more products using the default label template, or a specified template override.
json
{
"action": "print:labels",
"params": "product_sfids={{ record.sfid }}"
}
Multiple products and custom quantity:
json
{
"action": "print:labels",
"params": "product_sfids=a01xxx,b02yyy;quantity=3"
}
| Parameter | Required | Description |
|---|---|---|
product_sfids |
Yes | Comma-separated Salesforce IDs of products to print labels for |
quantity |
No | Number of labels per product (default: 1) |
print_template_sfid |
No | SFID of a label-context template to use instead of the default |
print:template
Prints using any template by SFID, with optional custom context variables.
json
{
"action": "print:template",
"params": "print_template_sfid=a1b2c3d4e5f6g7h8"
}
With additional context:
json
{
"action": "print:template",
"params": "print_template_sfid=a1b2c3d4e5f6g7h8;order_id={{ record.id }};custom_note=Pick up by 5pm"
}
| Parameter | Required | Description |
|---|---|---|
print_template_sfid |
Yes | SFID of the POS Print Template record |
* |
No | Any additional parameters are passed as Liquid context variables |
:::tip
Use print:template when you need to print a specific template that isn’t the default for its type, or when you want to pass custom variables into the template content.
:::
Supported printers
| Printer type | Supported hardware | Output format |
|---|---|---|
| Receipt | Star Micronics (mPOP, mC-Print2, mC-Print3), Epson TM-T series (T88IV, T90) | ESC-POS or Star PRNT binary |
| Label | Zebra printers (ZPL), Eltron/Datamax printers (EPL) | Raw ZPL or EPL commands |
| Document | Any printer connected to the device (via browser print dialog) |
For hardware connection and configuration, see Connect POS printers.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.