FoxrFoxr

Template variables and filters

Every variable, filter, schema setting, and query you can use in a GST Pro template.

Templates are Liquid (HTML + CSS), rendered once for each document and each copy. You edit them in the code editor using the Liquid, Query, and Schema tabs.

Variables

VariableWhat it holds
doc.typeinvoice, credit_note, packing_slip, or estimate
doc.number / doc.dateDocument number and issue date (the date uses your date format)
doc.order_name / doc.order_dateShopify order name (#1001) and order date
doc.place_of_supply.text"32 - Kerala", or the country for exports
doc.copy / doc.copy_key"Original for Recipient" and so on / original, duplicate, triplicate
doc.reverse_chargeYes or No (Rule 46(p))
doc.export_noteLUT / IGST endorsement on export invoices
doc.against.number / doc.against.dateCredit notes: the original invoice
doc.reasonCredit notes: the refund note
doc.tracking.number / .company / .urlTracking from the first fulfilment
doc.payment_gateway, doc.shipping_method, doc.po_number, doc.order_note, doc.tagsOrder details
doc.qr_value / doc.barcode_valueThe value chosen in the QR / barcode settings
supplier.legal_name, supplier.gstin, supplier.formatted, supplier.logo, supplier.signatureYour business (the location's GSTIN when you have several)
billing.* / shipping.*name, company, formatted, city, state_name, state_code, zip, phone, email, gstin
buyer.gstin / buyer.company / buyer.is_b2bBuyer GST details from the order, B2B company, or customer
lines[]title, variant_title, sku, hsn, quantity, unit_price, unit_taxable_value, discount, taxable_value, rate, cgst, sgst, igst, cess, tax, total, image, properties, metafields
gst.totals.*quantity, gross, discount, taxable_value, cgst, sgst, igst, cess, tax, shipping, shipping_tax, round_off, grand_total
gst.hsn_summary[] / gst.rate_summary[]hsn, rate, quantity, taxable_value, cgst, sgst, igst, cess, tax, total
gst.same_state / gst.supply_type / gst.state_tax_labeltrue for CGST + SGST; intra, inter, or export; SGST or UTGST
gst.amount_in_words"RUPEES ONE THOUSAND AND FIFTY ONLY"
shop.name / shop.domain / shop.currencyYour Shopify store
order.*The raw Shopify order (Admin GraphQL shape), merged with your template's Query
config.<section>.<setting>Values from the Customize panel, defined in the Schema tab

Filters

FilterOutput
{{ x | money }}Your currency format (Settings → Invoice number & formatting). money: "₹ {{amount}}" overrides it
{{ x | money_plain }}1,23,456.00 (Indian grouping, no symbol)
{{ x | percent }}18%
{{ x | amount_in_words }}RUPEES … ONLY (lakh / crore)
{{ doc.qr_value | qr: 100 }}QR code image URL, size in px
{{ doc.barcode_value | barcode }}Code 128 barcode image URL
{{ line.image | img_url: 80 }}Resized Shopify image

All standard Liquid tags and filters work (if, for, assign, capture, date, upcase, split, and so on). Output is HTML-escaped. Use richtext settings for formatted text.

Schema and click-to-edit

The Schema tab is a JSON array of sections. Each section has settings of type header, text, textarea, number, checkbox, range, select, color, image_picker, font_picker, or richtext. Read a value with {{ config.<section id>.<setting id> }}.

[
  {
    "name": "Overview",
    "id": "overview",
    "settings": [
      { "type": "header", "label": "Title" },
      { "type": "text", "id": "title", "label": "Document title", "default": "Tax Invoice" },
      { "type": "checkbox", "id": "show_po", "label": "Show PO number", "default": true },
      { "type": "range", "id": "logo_size", "label": "Logo size", "min": 40, "max": 200, "step": 4, "suffix": "px", "default": 96 }
    ]
  }
]

Add data-section (and optionally data-edit with a setting id) to an element. Clicking it in the preview opens that setting in the Customize panel:

<h1 data-section="overview" data-edit="title">{{ config.overview.title }}</h1>
<p>Invoice no: {{ doc.number }} · {{ doc.date }}</p>
{% for line in lines %}
  <tr><td>{{ line.title }}</td><td>{{ line.hsn }}</td><td>{{ line.taxable_value | money }}</td></tr>
{% endfor %}
{% if gst.same_state %}CGST {{ gst.totals.cgst | money }} · {{ gst.state_tax_label }} {{ gst.totals.sgst | money }}
{% else %}IGST {{ gst.totals.igst | money }}{% endif %}

Query

The Query tab runs an Admin GraphQL query with $id set to the order ID. The order it returns is merged into order, so an alias like note_attr: customAttributes { key value } becomes {{ order.note_attr }}. Only fields covered by Foxr GST Pro's access scopes can be read.

Pages and printing

Each document prints on its own page. Paper size and margins come from the Global settings (paper_size, page_margin). Use @media print for print-only CSS. Images must be https URLs. Scripts don't run in PDFs or prints.

On this page