Liquid recipes

Templates for the changes ERP teams most often ask for. Each is rendered by the app’s own Preview Sample in a test, and the box under it is exactly what it produces for the sample order: ORD-0001 for Kestrel Wine Bar, two lines of six, going to the United Kingdom.

Paste one into Advanced Liquid, press Preview Sample, and change the column names to the ones your ERP expects.

One row per order instead of per line

A header row written once, outside the loop, then one row for each order with its totals. -%} after the for stops a blank line appearing under the header; see whitespace control on Liquid tags.

Liquid
OrderId,Date,Customer,Lines,Net,Tax,Total
{% for order in orders -%}
{{ order.orderId }},{{ order.dateCreated }},"{{ order.customerCompanyNameSnapshot | csv_escape }}",{{ order.lineItems | size }},{{ order.subtotal }},{{ order.taxTotal }},{{ order.grandTotal }}
{% endfor %}
Text
OrderId,Date,Customer,Lines,Net,Tax,Total
ORD-0001,2026-08-09 14:32:00,"Kestrel Wine Bar",2,168.0,32.72,196.32

subtotal is before the order discount. If your ERP wants the net after it, write {{ order.subtotal | minus: order.promotionDiscount | round: 2 }} in its place; see Liquid filters.

Leaving out zero-quantity lines

A line is written only when its quantity is more than nothing, so your ERP never receives a line it would reject.

Liquid
OrderId,SKU,Qty
{% for order in orders -%}
{% for item in order.lineItems -%}
{% if item.qty > 0 -%}
{{ order.orderId }},{{ item.sku }},{{ item.qty }}
{% endif -%}
{% endfor -%}
{% endfor %}
Text
OrderId,SKU,Qty
ORD-0001,WH001,6
ORD-0001,GN002,6

Both sample lines have a quantity of six, so both are written. With the second line at zero, the test checks that only ORD-0001,WH001,6 is.

A different code for export orders

An ERP that books home and export sales to different nominal codes can have the template choose, from the country the order is going to. Here 4000 is a home sale and 4100 an export.

There is no or in this engine (Preview and Save refuse it), so a second home country is a second elseif with the same code:

Liquid
OrderId,Nominal
{% for order in orders -%}
{{ order.orderId }},{%- if order.shippingAddressSnapshot.country == "United Kingdom" -%}
4000
{%- elseif order.shippingAddressSnapshot.country == "Isle of Man" -%}
4000
{%- else -%}
4100
{%- endif %}
{% endfor %}
Text
OrderId,Nominal
ORD-0001,4000

For the same order going to Ireland, the test checks it writes ORD-0001,4100.

Compare against the country exactly as your customer records hold it. If your ERP sends GB rather than United Kingdom, test for GB. Preview Sample shows what the sample holds; a real order from your own data is the check that matters.

Your own delivery codes

When your ERP has its own codes for the delivery methods, translate them. There is no case tag, so this is if and elseif:

Liquid
{% for order in orders %}{% if order.carriageCode == "NEXT" %}24HR{% elseif order.carriageCode == "PALLET" %}PLT{% else %}STD{% endif %}{% endfor %}
Text
STD

A settlement discount

The order’s total is what the customer agreed to and signed for, so send it as it is and add the settlement figures beside it. Here, 2.5% for prompt payment: the discount, and what is due if it is taken.

Liquid
OrderId,Total,Settlement,DueIfPromptly
{% for order in orders -%}
{{ order.orderId }},{{ order.grandTotal | round: 2 }},{{ order.grandTotal | times: 0.025 | round: 2 }},{{ order.grandTotal | times: 0.975 | round: 2 }}
{% endfor %}
Text
OrderId,Total,Settlement,DueIfPromptly
ORD-0001,196.32,4.91,191.41

round: 2 always writes two decimals, and rounds a half away from zero as the app does for the order’s own figures. The rate is the same for every order; a template cannot look up an account’s own terms, so if they differ by customer, send the total and let your ERP apply them.

A different date format

Dates are written 2026-08-09 14:32:00 unless you change them. The date filter takes the layout your ERP wants, using % codes: %d the day, %m the month, %Y the year. The full list is on Liquid filters.

Liquid
OrderId,OrderDate,DeliveryDate
{% for order in orders -%}
{{ order.orderId }},{{ order.dateCreated | date: "%d/%m/%Y" }},{{ order.requestedDate | date: "%d/%m/%Y" }}
{% endfor %}
Text
OrderId,OrderDate,DeliveryDate
ORD-0001,09/08/2026,16/08/2026

An order with no delivery date asked for leaves that column empty.

Before you rely on one

Take one real order on a tablet, sync it, and put the file through your ERP’s importer. Preview Sample shows what the template writes; your ERP is the only judge of whether that is right. The full list of what a template can read is on Liquid objects.