---
title: Configuring invoices
related:
  - https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/orders.md
  - https://docs.kentico.com/13/macro-expressions.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Invoices (receipts) are commercial documents that you issue to [customers](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/customers.md) to indicate purchase-related details:

- [Products](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/products.md)
- Quantities
- Prices
- Other purchase-related details

The Xperience E-commerce Solution allows you to customize the invoice design. After configuring invoices, you can work with them while editing an order in the **Orders** application on the **Invoice** tab.

![Editing an order - Invoice tab](https://docs.kentico.com/docsassets/13/configuring-invoices/editing_order_invoice_tab.png "Editing an order - Invoice tab")

## Numbering invoices

With the default invoice number pattern, the system displays the invoice number equal to the order number. If you want to change the format of the invoice number, change the corresponding setting:

1. Open the **Store configuration** application (if you want to set up the invoice number pattern for the current site) or the **Multistore configuration** application (if you want to set up the invoice [globally](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/choosing-site-or-global-e-commerce-configuration.md)).
2. In the **Invoice number pattern** field in the **Invoice** category, type the required pattern.

   > **Tip:** You can use macros. For example, the default pattern is: _{% Order.OrderID %}_

   - If you are in the **Store configuration** application, clear the _Inherit from global settings_ option first.
3. Click **Save**.

The system generates new invoices with their numbers formatted according to the specified setting.

## Formatting invoices

You can configure the invoice template in the **Store configuration** application (if you want to set up the invoice for the current site) or in the **Multistore configuration** (if you want to set up the invoice [globally](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/choosing-site-or-global-e-commerce-configuration.md)) on the **Invoice** tab.

> **Info:** This configuration sets only the invoice which is displayed in the administration user interface and which you can print. If you want to send the invoice via email, [configure the corresponding email notification](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/configuring-e-commerce-email-notifications.md).

Use HTML markup for the basic formatting, and add [macros](https://docs.kentico.com/13/macro-expressions.md) to insert dynamic parts of the invoice. For example, you can use the _{% Order.OrderInvoiceNumber %}_ expression to insert the invoice number.

### Macro examples

The following table contains macro expressions that you can use in the invoice template.

| Macro                          | Description and examples                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Prices                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| {%Currency.__%}                | Displays a value from a column in the [currency](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/configuring-currencies.md) database table (_COM\_Currency_).<br>{%Currency.CurrencyCode%} – displays the currency's code (e.g. USD)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| {%GrandTotal%}                 | Displays the order's final overall price.<br>{%GrandTotal.Format(Currency.CurrencyFormatString)%} – displays the overall price formatted as specified in the [currency's format string](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/configuring-currencies.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| {%TotalShipping%}              | Displays the order's shipping price.<br>{%TotalShipping.Format(Currency.CurrencyFormatString)%} – displays the total shipping of the order formatted as specified in the currency's format string                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| {%TotalTax%}                   | Displays the total sum of all taxes that apply to the order.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| {%TaxSummary%}                 | Returns a collection of taxes ([tax classes](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/configuring-taxes.md)) that apply to the order (products and shipping).<br>To format the appearance of the taxes, use one of the following options:<br>[Iterate through the collection](https://docs.kentico.com/13/macro-expressions/macro-syntax.md) and manually generate the output<br>Call the _ApplyTransformation_ macro method and define a [transformation](https://docs.kentico.com/13/macro-expressions/writing-transformations-for-macros.md) for the tax items<br>For example, the following HTML code and macros display a basic table of tax class names and values:<br>`  <table>
{% foreach(taxItem in TaxSummary) { %}   <tr>     <td>{% taxItem.Name\|(encode)true %}</td>     <td>{% taxItem.Value.Format(Currency.CurrencyFormatString)\|(encode)true %}</td>   </tr>
{% } %} </table>
 ` |
| Order data                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| {%ContentTable%}               | Returns a collection of the ordered products.<br>To format the appearance of the products, use one of the following options:<br>[Iterate through the collection](https://docs.kentico.com/13/macro-expressions/macro-syntax.md) and manually generate the output<br>Call the _ApplyTransformation_ macro method and define a [transformation](https://docs.kentico.com/13/macro-expressions/writing-transformations-for-macros.md) for the tax items<br>For example, the following HTML code and macros display a basic table of product data:<br>`  <table>
{% foreach(item in ContentTable) { %}   <tr>     <td>{% item.SKUName\|(encode)true %}</td>     <td>{% item.Units %}</td>     <td>{% item.TotalPrice.Format(Currency.CurrencyFormatString)\|(encode)true %}</td>   </tr>
{% } %} </table>
 `                                                                                                                               |
| {%Order.\*%}                   | Displays a value from a column in the [order](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/orders.md) database table (_COM\_Order_).<br>{%Order.OrderInvoiceNumber%} – displays the invoice number<br>{%Order.OrderNote\|(encode)%} – displays [encoded](https://docs.kentico.com/13/macro-expressions/macro-syntax.md) order note<br>{%Order.OrderIsPaid%} – displays the paid status of the order<br>{%Format(Order.OrderDate, "{0:d}")%} – displays the formatted order date                                                                                                                                                                                                                                                                                                                                                                                                                             |
| {%OrderStatus.__%}             | Displays a value from a column in the [order status](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/orders/order-statuses.md) database table (_COM\_OrderStatus_).<br>{%OrderStatus.StatusDisplayName%} – displays the order status's display name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| {%ShippingOption.__%}          | Displays a value from a column in the [shipping option](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/configuring-shipping-options.md) database table (_COM\_ShippingOption_).<br>{%ShippingOption.ShippingOptionDisplayName%} – displays the shipping option's display name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| {%PaymentOption.__%}           | Displays a value from a column in the [payment method](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/configuring-payment-methods.md) database table (_COM\_PaymentOption_).<br>{%PaymentOption.PaymentOptionDisplayName%} – displays the payment method's display name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| {%ShoppingCart.__%}            | Displays a value from a column in the shopping cart database table (_COM\_ShoppingCart_). With the shopping cart, you can get to any other mentioned macro, for example:<br>{%ShoppingCart.ShoppingCartCurrency.CurrencyCode%} – displays the currency's code (e.g. USD)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Order discounts and gift cards |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| {%OrderDiscount%}              | Displays the total value of all applied [order discounts](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/discounts/working-with-order-discounts.md).<br>{%OrderDiscount.Format(Currency.CurrencyFormatString)%} – displays the order discount total formatted according to the format string of the set [currency](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/configuring-currencies.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| {%OrderDiscountSummary%}       | Returns a collection of the order discounts applied to the order.<br>To format the appearance of the order discounts, use one of the following options:<br>[Iterate through the collection](https://docs.kentico.com/13/macro-expressions/macro-syntax.md) and manually generate the output<br>Call the _ApplyTransformation_ macro method and define a [transformation](https://docs.kentico.com/13/macro-expressions/writing-transformations-for-macros.md) for the tax items                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| {%OtherPayments%}              | Displays the total value of applied [gift cards](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/discounts/working-with-gift-cards.md).<br>{%OtherPayments.Format(Currency.CurrencyFormatString)%} – displays the gift card total formatted according to the format string of the set [currency](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/configuring-currencies.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| {%OtherPaymentsSummary%}       | Returns a collection of the gift cards applied to the order.<br>To format the appearance of the gift cards, use one of the following options:<br>[Iterate through the collection](https://docs.kentico.com/13/macro-expressions/macro-syntax.md) and manually generate the output<br>Call the _ApplyTransformation_ macro method and define a [transformation](https://docs.kentico.com/13/macro-expressions/writing-transformations-for-macros.md) for the tax items                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Customer data                  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| {%Customer.__%}                | Displays a value from a column in the customer database table (_COM\_Customer_).<br>{%Customer.CustomerEmail%} – displays the customer's email address<br>{%Customer.CustomerOrganizationID%} – displays the customer's organization ID (for company accounts)<br>{%Customer.CustomerTaxRegistrationID%} – displays the customer's tax registration ID (for company accounts)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| {%BillingAddress.__%}          | Displays a value from a column in the billing address database table (_COM\_OrderAddress_).<br>{%BillingAddress.AddressLine1%} – displays the first line of the billing address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| {%BillingAddress.Country.__%}  | Displays a value from a column in the billing address country database table (_CMS\_Country_).<br>{%BillingAddress.Country.CountryDisplayName%} – displays the billing address's country display name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| {%BillingAddress.State.__%}    | Displays a value from a column in the billing address state database table (_CMS\_State_).<br>{%BillingAddress.State.StateDisplayName%} – displays the billing address's state display name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| {%ShippingAddress.__%}         | Displays a value from a column in the shipping address database table (_COM\_OrderAddress_).<br>{%ShippingAddress.AddressLine1%} – displays the first line of the shipping address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| {%ShippingAddress.Country.__%} | Displays a value from a column in the shipping address country database table (_CMS\_Country_).<br>{%ShippingAddress.Country.CountryDisplayName%} – displays the shipping address's country display name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| {%ShippingAddress.State.__%}   | Displays a value from a column in the shipping address state database table (_CMS\_State_).<br>{%ShippingAddress.State.StateDisplayName%} – displays the shipping address's state display name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

> **Tip:** Learn more about macros in [Macro expressions](https://docs.kentico.com/13/macro-expressions.md).
