> ## Documentation Index
> Fetch the complete documentation index at: https://zenskar.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Invoice template variables

## Overview

This page documents every Mustache variable used in the invoice HTML template, organized by functional section, with its type and whether it is always present. For how Mustache syntax itself works (`{{variable}}`, sections, inverted sections) and the data type conventions used in the tables below, see the [Templating guide](/docs/20240301/product-modules/more/communications/templating-guide).

***

## 1. Top-level configuration

### 1.1 Branding and assets

| Variable                   | Type         | Description                                                                       | Required |
| -------------------------- | ------------ | --------------------------------------------------------------------------------- | -------- |
| `{{logo}}`                 | String (URL) | Company logo image URL displayed in the invoice header                            | Yes      |
| `{{seller.logo}}`          | String (URL) | Business entity (seller) logo image URL; falls back to `{{logo}}` if not provided | No       |
| `{{zenskar_logo}}`         | String (URL) | Zenskar logo image URL for footer branding                                        | Yes      |
| `{{zenskar_redirect_url}}` | String (URL) | Target URL for the "Powered by Zenskar" link in the footer                        | Yes      |

### 1.2 Invoice metadata

| Variable                                | Type              | Description                                       | Required |
| --------------------------------------- | ----------------- | ------------------------------------------------- | -------- |
| `{{invoice_data.id}}`                   | String            | Unique invoice identifier/number                  | Yes      |
| `{{invoice_data.invoice_date}}`         | String (Date)     | Date the invoice was issued                       | Yes      |
| `{{invoice_data.due_by}}`               | String (Date)     | Payment due date                                  | Yes      |
| `{{invoice_data.payment_link}}`         | String (URL)      | Optional online payment portal URL                | No       |
| `{{invoice_data.invoice_amount_due}}`   | String (Currency) | Total amount due, formatted with currency symbol  | Yes      |
| `{{invoice_data.total}}`                | String (Currency) | Invoice total before balance adjustments          | Yes      |
| `{{invoice_data.show_applied_balance}}` | Boolean           | Whether to display applied customer balance       | No       |
| `{{invoice_data.applied_balance}}`      | String (Currency) | Amount of customer balance applied to the invoice | No       |

### 1.3 General information

| Variable               | Type   | Description                                              | Required |
| ---------------------- | ------ | -------------------------------------------------------- | -------- |
| `{{billing_duration}}` | String | Billing period range, for example "Jan 1 - Jan 31, 2024" | Yes      |

***

## 2. Party information

### 2.1 Customer details

| Variable                 | Type           | Description                                                        | Required |
| ------------------------ | -------------- | ------------------------------------------------------------------ | -------- |
| `{{customer.name}}`      | String         | Customer legal or business name                                    | Yes      |
| `{{{customer.address}}}` | String (HTML)  | Customer mailing address; render with the unescaped `{{{ }}}` form | Yes      |
| `{{customer.email}}`     | String (Email) | Customer contact email address                                     | Yes      |
| `{{customer.tax_id}}`    | String         | Customer tax identification number                                 | No       |

### 2.2 Seller details

| Variable               | Type          | Description                                                      | Required |
| ---------------------- | ------------- | ---------------------------------------------------------------- | -------- |
| `{{seller.name}}`      | String        | Seller/vendor legal or business name                             | Yes      |
| `{{{seller.address}}}` | String (HTML) | Seller mailing address; render with the unescaped `{{{ }}}` form | Yes      |

***

## 3. Invoice summary section

**Wrapper:** `{{#summary.show_invoice_summary}}...{{/summary.show_invoice_summary}}`

This optional section generates a separate summary page before the detailed invoice.

Because a Mustache section extends the surrounding context rather than replacing it, every top-level variable documented elsewhere on this page is also available inside `{{#summary.show_invoice_summary}}`, for example `{{logo}}`, `{{invoice_data.id}}`, `{{billing_duration}}`, `{{invoice_data.invoice_date}}`, `{{invoice_data.due_by}}`, `{{customer.name}}`, `{{{customer.address}}}`, `{{customer.email}}`, `{{customer.tax_id}}`, `{{seller.name}}`, `{{{seller.address}}}`, and the `{{#ach_details}}` block. You don't need to re-declare them under `summary`; only the fields below are unique to this section.

### 3.1 Summary metadata

| Variable                           | Type              | Description                                       | Required      |
| ---------------------------------- | ----------------- | ------------------------------------------------- | ------------- |
| `{{summary.show_invoice_summary}}` | Boolean           | Controls visibility of the entire summary section | No            |
| `{{summary.amount_due}}`           | String (Currency) | Total amount due, displayed in the summary        | Yes, if shown |
| `{{summary.current_date}}`         | String (Date)     | Date used for the summary calculation             | Yes, if shown |

### 3.2 Summary line items

**Array:** `{{#summary.summary}}...{{/summary.summary}}`

| Variable           | Type              | Description                                                          | Required |
| ------------------ | ----------------- | -------------------------------------------------------------------- | -------- |
| `{{date}}`         | String (Date)     | Transaction date for this summary line                               | Yes      |
| `{{amount_type}}`  | String            | Type of transaction, for example "Invoice", "Payment", "Credit Note" | Yes      |
| `{{reference_id}}` | String            | Reference identifier for the transaction                             | Yes      |
| `{{remarks}}`      | String            | Additional notes or description                                      | No       |
| `{{amount}}`       | String (Currency) | Transaction amount, formatted with currency                          | Yes      |

<Note>
  Zenskar inserts a page break immediately after this section, so when shown, the summary always renders on its own page ahead of the itemized invoice rather than sharing a page with it.
</Note>

***

## 4. Document line items

**Primary array:** `{{#document_lines}}...{{/document_lines}}`

Each line item represents a charge, fee, or adjustment on the invoice.

### 4.1 Basic line item properties

| Variable                | Type         | Description                              | Required |
| ----------------------- | ------------ | ---------------------------------------- | -------- |
| `{{item_name}}`         | String       | Name or title of the line item           | Yes      |
| `{{item_description}}`  | String       | Detailed description of the charge       | No       |
| `{{usage_report_link}}` | String (URL) | Optional link to a detailed usage report | No       |

### 4.2 Common templating data

These properties exist within the `templating_data` object of each line item, regardless of pricing model.

| Variable                                       | Type              | Description                           | Required |
| ---------------------------------------------- | ----------------- | ------------------------------------- | -------- |
| `{{templating_data.indent_level}}`             | Integer           | Visual indentation level (0, 1, or 2) | Yes      |
| `{{templating_data.formatted_service_period}}` | String            | Date range for the service period     | No       |
| `{{templating_data.formatted_amount}}`         | String (Currency) | Total line item amount                | Yes      |
| `{{templating_data.formatted_quantity}}`       | String (Number)   | Quantity value formatted for display  | No       |

***

## 5. Pricing models

Exactly one of the following wrapper sections is truthy for a given line item, based on the pricing model of the underlying charge.

### 5.1 Per-unit pricing

**Wrapper:** `{{#templating_data.per-unit-pricing}}...{{/templating_data.per-unit-pricing}}`

Standard pricing where cost is quantity × unit price.

| Variable                                   | Type              | Description                          | Required |
| ------------------------------------------ | ----------------- | ------------------------------------ | -------- |
| `{{templating_data.formatted_unit_price}}` | String (Currency) | Price per single unit                | Yes      |
| `{{templating_data.formatted_quantity}}`   | String (Number)   | Number of units                      | Yes      |
| `{{templating_data.formatted_amount}}`     | String (Currency) | Total amount (quantity × unit price) | Yes      |

#### Quantity entries breakdown

**Array:** `{{#templating_data.formatted_quantity_entries}}...{{/templating_data.formatted_quantity_entries}}`

Present when usage spans multiple periods or rates within the line item:

| Variable                       | Type              | Description                   | Required |
| ------------------------------ | ----------------- | ----------------------------- | -------- |
| `{{formatted_service_period}}` | String            | Service period for this entry | Yes      |
| `{{formatted_unit_price}}`     | String (Currency) | Unit price for this entry     | Yes      |
| `{{formatted_quantity}}`       | String (Number)   | Quantity for this entry       | Yes      |
| `{{formatted_amount}}`         | String (Currency) | Amount for this entry         | Yes      |

### 5.2 Package pricing

**Wrapper:** `{{#templating_data.package-pricing}}...{{/templating_data.package-pricing}}`

Pricing based on predefined packages or bundles.

| Variable                                         | Type              | Description                                                       | Required |
| ------------------------------------------------ | ----------------- | ----------------------------------------------------------------- | -------- |
| `{{templating_data.formatted_package_price}}`    | String (Currency) | Price per package                                                 | Yes      |
| `{{templating_data.formatted_quantity}}`         | String (Number)   | Number of packages purchased                                      | Yes      |
| `{{templating_data.formatted_amount}}`           | String (Currency) | Total amount                                                      | Yes      |
| `{{templating_data.formatted_quantity_entries}}` | Array             | Optional time-based breakdown, same structure as per-unit pricing | No       |

### 5.3 Volume pricing

**Wrapper:** `{{#templating_data.volume-pricing}}...{{/templating_data.volume-pricing}}`

All units priced at the same rate, based on total volume.

| Variable                                   | Type              | Description                     | Required |
| ------------------------------------------ | ----------------- | ------------------------------- | -------- |
| `{{templating_data.formatted_unit_price}}` | String (Currency) | Unit price applied to all units | Yes      |
| `{{templating_data.formatted_quantity}}`   | String (Number)   | Total quantity                  | Yes      |
| `{{templating_data.formatted_amount}}`     | String (Currency) | Total amount                    | Yes      |

### 5.4 Tiered pricing

**Wrapper:** `{{#templating_data.tiered-pricing}}...{{/templating_data.tiered-pricing}}`

Different price rates apply to different quantity ranges.

| Variable                                 | Type            | Description                     | Required |
| ---------------------------------------- | --------------- | ------------------------------- | -------- |
| `{{templating_data.no_tiers}}`           | String (Number) | Total number of pricing tiers   | Yes      |
| `{{templating_data.formatted_quantity}}` | String (Number) | Total quantity across all tiers | Yes      |

#### Tier details

**Array:** `{{#templating_data.tiers}}...{{/templating_data.tiers}}`

| Variable                   | Type              | Description                                                    | Required |
| -------------------------- | ----------------- | -------------------------------------------------------------- | -------- |
| `{{tier_name}}`            | String            | Name or description of the tier, for example "First 100 units" | Yes      |
| `{{indent_level}}`         | Integer           | Indentation level for this tier (1 or 2)                       | Yes      |
| `{{formatted_unit_price}}` | String (Currency) | Unit price for this tier                                       | Yes      |
| `{{formatted_quantity}}`   | String (Number)   | Quantity falling within this tier                              | Yes      |
| `{{formatted_amount}}`     | String (Currency) | Amount for this tier                                           | Yes      |

### 5.5 Two-dimensional tiered pricing

**Wrapper:** `{{#templating_data.2d-tiered-pricing}}...{{/templating_data.2d-tiered-pricing}}`

Pricing based on two dimensions, for example users × storage tiers.

#### Column tiers (current)

**Array:** `{{#templating_data.column_tiers_v2}}...{{/templating_data.column_tiers_v2}}`

| Variable                        | Type            | Description                                    | Required |
| ------------------------------- | --------------- | ---------------------------------------------- | -------- |
| `{{column_dimension}}`          | String          | Name of the column dimension                   | Yes      |
| `{{indent_level}}`              | Integer         | Indentation level for the column header        | Yes      |
| `{{no_tiers}}`                  | String (Number) | Number of tiers in this column                 | Yes      |
| `{{formatted_column_quantity}}` | String (Number) | Total quantity for this column                 | Yes      |
| `{{tiers}}`                     | Array           | Tier objects, same structure as tiered pricing | Yes      |

#### Column tiers (legacy)

**Array:** `{{#templating_data.column_tiers}}...{{/templating_data.column_tiers}}`

Present on older line items instead of `column_tiers_v2`, with the same fields under `column_name` rather than `column_dimension`:

| Variable                        | Type            | Description                                    | Required |
| ------------------------------- | --------------- | ---------------------------------------------- | -------- |
| `{{column_name}}`               | String          | Name of the column                             | Yes      |
| `{{indent_level}}`              | Integer         | Indentation level for the column header        | Yes      |
| `{{no_tiers}}`                  | String (Number) | Number of tiers in this column                 | Yes      |
| `{{formatted_column_quantity}}` | String (Number) | Total quantity for this column                 | Yes      |
| `{{tiers}}`                     | Array           | Tier objects, same structure as tiered pricing | Yes      |

### 5.6 Matrix pricing

**Wrapper:** `{{#templating_data.matrix-pricing}}...{{/templating_data.matrix-pricing}}`

Pricing determined by the intersection of multiple dimensions.

| Variable                    | Type  | Description                                    | Required |
| --------------------------- | ----- | ---------------------------------------------- | -------- |
| `{{templating_data.tiers}}` | Array | Tier objects, same structure as tiered pricing | Yes      |

### 5.7 Step pricing

**Wrapper:** `{{#templating_data.step-pricing}}...{{/templating_data.step-pricing}}`

Flat fee pricing based on quantity ranges.

| Variable                                 | Type              | Description                         | Required |
| ---------------------------------------- | ----------------- | ----------------------------------- | -------- |
| `{{templating_data.formatted_flat_fee}}` | String (Currency) | Flat fee for the applicable step    | Yes      |
| `{{templating_data.formatted_quantity}}` | String (Number)   | Quantity that triggered this step   | Yes      |
| `{{templating_data.formatted_amount}}`   | String (Currency) | Total amount, equal to the flat fee | Yes      |

### 5.8 Percentage pricing

**Wrapper:** `{{#templating_data.percent-pricing}}...{{/templating_data.percent-pricing}}`

Pricing calculated as a percentage of a base amount.

| Variable                                 | Type              | Description                           | Required |
| ---------------------------------------- | ----------------- | ------------------------------------- | -------- |
| `{{templating_data.formatted_percent}}`  | String            | Percentage rate, for example "10%"    | Yes      |
| `{{templating_data.formatted_quantity}}` | String (Currency) | Base amount being calculated against  | Yes      |
| `{{templating_data.formatted_amount}}`   | String (Currency) | Calculated charge (base × percentage) | Yes      |

### 5.9 Seat-based pricing

**Wrapper:** `{{#templating_data.seat-based-pricing}}...{{/templating_data.seat-based-pricing}}`

Pricing based on active seats or users, with prorated calculations.

#### Seat line items

**Array:** `{{#templating_data.sub_line_items}}...{{/templating_data.sub_line_items}}`

| Variable                   | Type              | Description                              | Required |
| -------------------------- | ----------------- | ---------------------------------------- | -------- |
| `{{days}}`                 | String (Number)   | Number of days the seats were active     | Yes      |
| `{{formatted_unit_price}}` | String (Currency) | Price per seat                           | Yes      |
| `{{formatted_quantity}}`   | String (Number)   | Number of seats active for this duration | Yes      |
| `{{formatted_amount}}`     | String (Currency) | Amount for this seat group               | Yes      |

### 5.10 Custom pricing

**Wrapper:** `{{#templating_data.custom-pricing}}...{{/templating_data.custom-pricing}}`

Custom pricing model with multiple dimensions.

#### Custom sub-line items

**Array:** `{{#templating_data.sub_line_items}}...{{/templating_data.sub_line_items}}`

| Variable                 | Type              | Description                   | Required |
| ------------------------ | ----------------- | ----------------------------- | -------- |
| `{{dimension}}`          | String            | Name of the pricing dimension | Yes      |
| `{{formatted_quantity}}` | String (Number)   | Quantity for this dimension   | Yes      |
| `{{formatted_amount}}`   | String (Currency) | Amount for this dimension     | Yes      |

### 5.11 Custom tiered pricing

**Wrapper:** `{{#templating_data.custom_tiered_pricing}}...{{/templating_data.custom_tiered_pricing}}`

A custom implementation of tiered pricing.

| Variable                                 | Type              | Description      | Required |
| ---------------------------------------- | ----------------- | ---------------- | -------- |
| `{{templating_data.price}}`              | String (Currency) | Applicable price | Yes      |
| `{{templating_data.formatted_quantity}}` | String (Number)   | Total quantity   | Yes      |
| `{{templating_data.formatted_amount}}`   | String (Currency) | Total amount     | Yes      |

### 5.12 Free units

**Wrapper:** `{{#templating_data.free-units}}...{{/templating_data.free-units}}`

Pricing with an allocation of free units before charges apply.

| Variable                                           | Type              | Description                                   | Required |
| -------------------------------------------------- | ----------------- | --------------------------------------------- | -------- |
| `{{templating_data.formatted_unit_price}}`         | String (Currency) | Price per unit after free units are exhausted | Yes      |
| `{{templating_data.formatted_free_units_granted}}` | String (Number)   | Number of free units consumed                 | Yes      |
| `{{templating_data.formatted_total_free_units}}`   | String (Number)   | Total free units available                    | Yes      |
| `{{templating_data.formatted_amount}}`             | String (Currency) | Charge for units beyond the free allocation   | Yes      |
| `{{templating_data.formatted_quantity_entries}}`   | Array             | Optional time-based breakdown                 | No       |

### 5.13 Deduct entitlement

**Wrapper:** `{{#templating_data.deduct-entitlement}}...{{/templating_data.deduct-entitlement}}`

Charges based on consumption from a prepaid balance or entitlement.

| Variable                                            | Type              | Description                       | Required |
| --------------------------------------------------- | ----------------- | --------------------------------- | -------- |
| `{{templating_data.initial_quantity}}`              | String (Number)   | Starting entitlement balance      | Yes      |
| `{{templating_data.quantity_consumed}}`             | String (Number)   | Amount consumed during the period | Yes      |
| `{{templating_data.overages}}`                      | String (Number)   | Usage beyond the entitlement      | No       |
| `{{templating_data.quantity_left_after_deduction}}` | String (Number)   | Remaining entitlement balance     | Yes      |
| `{{templating_data.formatted_unit_price}}`          | String (Currency) | Price per unit for overages       | Yes      |
| `{{templating_data.formatted_quantity}}`            | String (Number)   | Billable quantity                 | Yes      |
| `{{templating_data.formatted_amount}}`              | String (Currency) | Total overage charge              | Yes      |

### 5.14 Minimum amount overages

**Wrapper:** `{{#templating_data.minimum-amount-overages}}...{{/templating_data.minimum-amount-overages}}`

Charges applied when a minimum commitment is not met.

| Variable                                       | Type              | Description                         | Required |
| ---------------------------------------------- | ----------------- | ----------------------------------- | -------- |
| `{{templating_data.formatted_quantity}}`       | String (Currency) | Actual usage amount                 | Yes      |
| `{{templating_data.formatted_minimum_amount}}` | String (Currency) | Minimum commitment amount           | Yes      |
| `{{templating_data.formatted_amount}}`         | String (Currency) | Shortfall charge (minimum − actual) | Yes      |

### 5.15 Subscription charges

**Wrapper:** `{{#templating_data.subscription}}...{{/templating_data.subscription}}`

Fixed recurring subscription fees.

| Variable                               | Type              | Description             | Required |
| -------------------------------------- | ----------------- | ----------------------- | -------- |
| `{{templating_data.formatted_amount}}` | String (Currency) | Subscription fee amount | Yes      |

### 5.16 Subscription with proration

**Wrapper:** `{{#templating_data.subscription-with-proration}}...{{/templating_data.subscription-with-proration}}`

Prorated subscription charges for partial periods.

| Variable                               | Type              | Description                  | Required |
| -------------------------------------- | ----------------- | ---------------------------- | -------- |
| `{{templating_data.formatted_amount}}` | String (Currency) | Prorated subscription amount | Yes      |

### 5.17 Prorated fixed charge

**Wrapper:** `{{#templating_data.prorated-fixed-charge}}...{{/templating_data.prorated-fixed-charge}}`

Fixed charges prorated for partial billing periods.

| Variable                               | Type              | Description            | Required |
| -------------------------------------- | ----------------- | ---------------------- | -------- |
| `{{templating_data.formatted_amount}}` | String (Currency) | Prorated charge amount | Yes      |

### 5.18 Custom line item

**Wrapper:** `{{#templating_data.custom_line_item_data}}...{{/templating_data.custom_line_item_data}}`

Arbitrary custom charges.

| Variable                               | Type              | Description          | Required |
| -------------------------------------- | ----------------- | -------------------- | -------- |
| `{{templating_data.formatted_amount}}` | String (Currency) | Custom charge amount | Yes      |

### 5.19 Maximum pricing

**Wrapper:** `{{#templating_data.max}}...{{/templating_data.max}}`

Pricing capped at a maximum amount.

| Variable                               | Type              | Description           | Required |
| -------------------------------------- | ----------------- | --------------------- | -------- |
| `{{templating_data.formatted_amount}}` | String (Currency) | Capped maximum amount | Yes      |

***

## 6. Adjustments (discounts, taxes, surcharges)

These sections apply within a single line item, as opposed to the invoice-level adjustments in [section 7](#7-invoice-level-calculations).

### 6.1 Discount line items

**Wrapper:** `{{#templating_data.discount}}...{{/templating_data.discount}}`

| Variable                                         | Type              | Description                                       | Required |
| ------------------------------------------------ | ----------------- | ------------------------------------------------- | -------- |
| `{{templating_data.formatted_quantity}}`         | String (Number)   | Quantity being discounted                         | Yes      |
| `{{templating_data.formatted_discount_to_show}}` | String            | Discount rate or description                      | Yes      |
| `{{templating_data.formatted_discount_given}}`   | String (Currency) | Total discount amount, shown as a positive number | Yes      |

### 6.2 Tax line items

**Wrapper:** `{{#templating_data.tax}}...{{/templating_data.tax}}`

| Variable                                   | Type              | Description           | Required |
| ------------------------------------------ | ----------------- | --------------------- | -------- |
| `{{templating_data.formatted_quantity}}`   | String (Currency) | Taxable amount        | Yes      |
| `{{templating_data.formatted_percent}}`    | String            | Tax percentage rate   | Yes      |
| `{{templating_data.formatted_tax_amount}}` | String (Currency) | Calculated tax amount | Yes      |

### 6.3 Surcharge line items

**Wrapper:** `{{#templating_data.surcharge_data}}...{{/templating_data.surcharge_data}}`

| Variable                                 | Type              | Description                               | Required |
| ---------------------------------------- | ----------------- | ----------------------------------------- | -------- |
| `{{templating_data.formatted_quantity}}` | String (Currency) | Base amount for the surcharge calculation | Yes      |
| `{{templating_data.surcharge_percent}}`  | String            | Surcharge percentage rate                 | Yes      |
| `{{templating_data.surcharge_total}}`    | String (Currency) | Total surcharge amount                    | Yes      |

***

## 7. Invoice-level calculations

### 7.1 Discount summary

**Wrapper:** `{{#discount_data.discount_data}}...{{/discount_data.discount_data}}`

An invoice-level discount applied after line items.

| Variable                                  | Type              | Description                              | Required |
| ----------------------------------------- | ----------------- | ---------------------------------------- | -------- |
| `{{discount_data.total_before_discount}}` | String (Currency) | Subtotal before the invoice discount     | Yes      |
| `{{discount_data.discount_percent}}`      | String            | Discount percentage, if percentage-based | No       |
| `{{discount_data.discount_total}}`        | String (Currency) | Total discount amount                    | Yes      |

### 7.2 Surcharge summary

**Wrapper:** `{{#surcharge_data.surcharge_data}}...{{/surcharge_data.surcharge_data}}`

An invoice-level surcharge applied after line items.

| Variable                                    | Type              | Description                   | Required |
| ------------------------------------------- | ----------------- | ----------------------------- | -------- |
| `{{surcharge_data.total_before_surcharge}}` | String (Currency) | Subtotal before the surcharge | Yes      |
| `{{surcharge_data.surcharge_percent}}`      | String            | Surcharge percentage rate     | Yes      |
| `{{surcharge_data.surcharge_total}}`        | String (Currency) | Total surcharge amount        | Yes      |

### 7.3 Tax summary

**Wrapper:** `{{#tax_data_new.tax_data}}...{{/tax_data_new.tax_data}}`

An invoice-level tax calculation with a breakdown by tax item.

| Variable                            | Type              | Description           | Required |
| ----------------------------------- | ----------------- | --------------------- | -------- |
| `{{tax_data_new.total_before_tax}}` | String (Currency) | Subtotal before taxes | Yes      |

#### Tax items

**Array:** `{{#tax_data_new.taxes}}...{{/tax_data_new.taxes}}`

| Variable                   | Type              | Description                                                                      | Required                             |
| -------------------------- | ----------------- | -------------------------------------------------------------------------------- | ------------------------------------ |
| `{{tax_item_name}}`        | String            | Name of the tax, for example "Sales Tax" or "VAT"                                | Yes                                  |
| `{{tax_percent}}`          | String            | Tax percentage rate                                                              | Yes, unless `is_avalara_tax` is true |
| `{{formatted_tax_amount}}` | String (Currency) | Tax amount                                                                       | Yes                                  |
| `{{is_avalara_tax}}`       | Boolean           | Whether this tax was calculated by Avalara, in which case no percentage is shown | No                                   |

### 7.4 Avalara tax (legacy)

**Wrapper:** `{{#avalara_tax_data.formatted_amount_after_tax}}...{{/avalara_tax_data.formatted_amount_after_tax}}`

Legacy Avalara tax integration, superseded by [section 7.3](#73-tax-summary) on newer invoices.

| Variable                                    | Type              | Description           | Required |
| ------------------------------------------- | ----------------- | --------------------- | -------- |
| `{{avalara_tax_data.tax_item_name}}`        | String            | Tax name from Avalara | Yes      |
| `{{avalara_tax_data.formatted_tax_amount}}` | String (Currency) | Tax amount            | Yes      |

### 7.5 Custom totals

**Array:** `{{#custom_data}}...{{/custom_data}}`

Additional custom line items shown in the totals section.

| Variable               | Type              | Description                   | Required |
| ---------------------- | ----------------- | ----------------------------- | -------- |
| `{{item_name}}`        | String            | Name of the custom total item | Yes      |
| `{{formatted_amount}}` | String (Currency) | Amount for the custom item    | Yes      |

### 7.6 Customer balance

**Wrapper:** `{{#customer_balance.balance_is_non_zero}}...{{/customer_balance.balance_is_non_zero}}`

Application of an existing customer credit balance.

| Variable                                   | Type              | Description                                   | Required |
| ------------------------------------------ | ----------------- | --------------------------------------------- | -------- |
| `{{customer_balance.balance_is_non_zero}}` | Boolean           | Whether a balance exists to apply             | Yes      |
| `{{customer_balance.balance}}`             | String (Currency) | Applied balance amount, as a negative value   | Yes      |
| `{{customer_balance.amount_due}}`          | String (Currency) | Final amount due after the balance is applied | Yes      |

***

## 8. Payment information

### 8.1 ACH/wire transfer details

**Wrapper:** `{{#ach_details}}...{{/ach_details}}`

Bank account information for direct payment.

| Variable             | Type   | Description                                | Required |
| -------------------- | ------ | ------------------------------------------ | -------- |
| `{{bank_name}}`      | String | Name of the bank                           | Yes      |
| `{{routing_number}}` | String | Bank routing number (ABA number)           | Yes      |
| `{{account_number}}` | String | Bank account number                        | Yes      |
| `{{swift_code}}`     | String | SWIFT/BIC code for international transfers | No       |

### 8.2 Custom payment instructions

**Wrapper:** `{{#payment_instructions}}...{{/payment_instructions}}`

An alternative payment instruction format, used when ACH details aren't provided.

| Variable          | Type   | Description                              | Required |
| ----------------- | ------ | ---------------------------------------- | -------- |
| `{{title}}`       | String | Payment instructions title               | Yes      |
| `{{description}}` | String | Descriptive text for the payment process | Yes      |

#### Payment details list

**Array:** `{{#details_list}}...{{/details_list}}`

| Variable    | Type   | Description                | Required |
| ----------- | ------ | -------------------------- | -------- |
| `{{key}}`   | String | Detail label or field name | Yes      |
| `{{value}}` | String | Detail value or content    | Yes      |

***

## 9. Invoice notes

**Wrapper:** `{{#invoice_note}}...{{/invoice_note}}`

Optional notes or terms displayed at the bottom of the invoice.

| Variable                  | Type          | Description                                            | Required |
| ------------------------- | ------------- | ------------------------------------------------------ | -------- |
| `{{invoice_note.title}}`  | String        | Note section title                                     | Yes      |
| `{{{invoice_note.note}}}` | String (HTML) | Note content; render with the unescaped `{{{ }}}` form | Yes      |
