---
title: Order Invoiced Stylesheet - Liquid Invoice Template Example
description: Render the JSON Order Invoice messages of the Nodinite Order-to-Cash demo as an invoice with bill-to, terms, invoice lines, tax, and totals, using the Liquid Stylesheet O2C - View Order Invoice (7.12).
---

# Order Invoiced Stylesheet

> This page provides the **Liquid** [Stylesheet][Stylesheets] **O2C - View Order Invoice** for the JSON **Order Invoiced** messages (Step 7) in the [Order-to-Cash demo][Generate-Demo].

![O2C BPM Viewer with order ORD-10005 for Tailspin Toys, Action on the Order Invoiced event and View message formatted as O2C - View Order Invoice, ending on the Invoice INV-2025-10005, animated walkthrough (7.12)][1]  
*Animated walkthrough: in the BPM Viewer of [BPM Log Search][Search log events from a BPM], open **Action** on the *Order Invoiced* event of order `ORD-10005` and choose **View message formatted as 'O2C - View Order Invoice'**.*  

**Let finance read the invoice the customer got.** With :Nodinite: [Stylesheets][], the last message of the order reads as an invoice, so finance can answer a billing question without the ERP. On this page, you will:

* ✅ Transform the JSON Order Invoice message into an invoice with Liquid  
* ✅ Show the invoice lines with tax, and the subtotal, shipping, tax, and total rows  
* ✅ Open the invoice from [Log Views][] and from [BPM Log Search][Search log events from a BPM] :new7.11:  

## :fa-diagram-project: Understanding the Order Invoiced Stylesheet

A [Stylesheet][Stylesheets] is tied to a [Message Type][Message Types]. The business [Log Event][] of Step 7, *Order Invoiced*, carries the Message Type `O2C.Order.Invoice/1.0`, so :Nodinite: offers **O2C - View Order Invoice** for it. With **Message Body is Json** checked, :Nodinite: parses the JSON body and hands its properties to the template as variables, such as `invoiceId` and `invoiceItems`.

<div class="mermaid">
graph LR
    A["fa:fa-inbox Order Invoiced<br/>Log Event (JSON)"] --> B{"fa:fa-tags Message Type<br/>O2C.Order.Invoice/1.0"}
    B --> C["fa:fa-file-code O2C - View Order Invoice<br/>(Liquid, Message Body is Json)"]
    C --> D["fa:fa-file-invoice Invoice"]
    D --> E1["fa:fa-search Log Views"]
    D --> E2["fa:fa-sitemap BPM Log Search"]
    style A fill:#2678BD
    style B fill:#9E59BB
    style C fill:#3F827B
    style D fill:#93d16d
    style E1 fill:#2678BD
    style E2 fill:#2678BD
</div>

*The Order Invoiced [Log Event][] (blue) is matched to its [Message Type][Message Types] (purple); the Liquid [Stylesheet][Stylesheets] (teal) renders the invoice (green), which users open from a [Log View][Log Views] or from [BPM Log Search][Search log events from a BPM] (blue).*

### :fa-puzzle-piece: Where Users Open the Invoice

|Where|How|
|---|---|
|[Log Views][]|Search the Log View, open **Action** on the *Order Invoiced* event, and choose **View message formatted as 'O2C - View Order Invoice'**.|
|[Log Search][Search log events from a BPM] on a BPM :new7.11:|Click **Log Search** on the Order-to-Cash [BPM][], search for the order number, and open **Action** on the Order Invoiced event in the BPM Viewer.|

The dialog is titled **View message body formatted as 'O2C - View Order Invoice'** and has the buttons **Open in New Window**, **Print**, and **Close**. The forwarding event of the step, *Invoice Request Received*, logs `O2C.Forwarding/1.0`, so this Stylesheet isn't offered there.

![Invoice INV-2025-10005 for order ORD-10005 and Tailspin Toys rendered by the O2C - View Order Invoice Stylesheet, with status ISSUED, bill-to, dates, terms NET30, one invoice line, and the subtotal, shipping, tax, and total rows (7.13)][2]  
*The JSON Order Invoice message rendered as an invoice: bill-to with e-mail, invoice and due dates, payment terms and method, the invoice lines with tax, and the totals.*  

### :fa-gear: Stylesheet Settings

|Setting|Value|Why|
|---|---|---|
|Name|`O2C - View Order Invoice`|The name users pick in the **Action** menu|
|Type|Liquid|The Order Invoice body is JSON|
|Render as HTML|**Checked**|The template outputs HTML|
|Message Body is Json|**Checked**|Exposes `invoiceId`, `invoiceItems`, `invoiceTotal`, and the other properties as Liquid variables|
|Message Types|`O2C.Order.Invoice/1.0`|Only the Step 7 business event gets the Stylesheet|

>[!IMPORTANT]
>With **Message Body is Json** unchecked, the template still renders, but every field is empty: the heading reads *Invoice*, the subtitle *Order · PO*, and the total row *Total ()*.

## :fa-file-code: Input JSON

The Order Invoice body of order 1 as logged by the [demo data script][Generate-Demo], the same message as on the [Step 7 page][Order-Invoiced-Message].

```json
{
  "invoiceId": "INV-2025-10001",
  "orderId": "ORD-10001",
  "customerId": "CUST-001",
  "customerName": "Contoso Corporation",
  "customerEmail": "orders@Contoso.example.com",
  "invoiceDate": "2025-10-21T09:15:00Z",
  "dueDate": "2025-11-20",
  "paymentTerms": "NET30",
  "invoiceStatus": "ISSUED",
  "invoiceItems": [
    {
      "lineNumber": 1,
      "description": "Demo Widget",
      "sku": "SKU-DEMO-001",
      "quantity": 1,
      "unitPrice": 99.95,
      "lineTotal": 99.95,
      "taxCode": "STANDARD",
      "taxRate": 0.0,
      "taxAmount": 0.0
    }
  ],
  "subtotal": 99.95,
  "taxTotal": 0.0,
  "shippingCharge": 0.0,
  "invoiceTotal": 99.95,
  "currency": "USD",
  "paymentMethod": "INVOICE",
  "purchaseOrder": "PO-2025-10001",
  "trackingNumber": "TRK-20251016-10001",
  "gl_account": "4100-Sales-Revenue",
  "revenue_recognition_date": "2025-10-20"
}
```

The property order varies between runs, because the script serializes a PowerShell hashtable; Liquid reads properties by name, so the order doesn't matter.

### :fa-table: JSON to Invoice Mapping

|JSON property|Shown in the invoice as|
|---|---|
|`invoiceId`|The title|
|`orderId`, `purchaseOrder`|*Order · PO* under the title|
|`invoiceStatus`|A badge at the top right|
|`customerName`, `customerId`, `customerEmail`|**Bill to**, with a mailto link|
|`invoiceDate`, `dueDate`, `paymentTerms`, `paymentMethod`|**Invoice Date**, **Due Date**, **Terms**, **Payment**|
|`invoiceItems[]`|**Invoice Lines** table: Line, SKU, Description, Qty, Unit Price, Tax (`taxAmount`), Line Total|
|`subtotal`, `shippingCharge`, `taxTotal`, `invoiceTotal`, `currency`|The *Subtotal*, *Shipping*, *Tax*, and **Total** rows|

The JSON parser normalizes dates and numbers before Liquid sees them: `2025-10-21T09:15:00Z` shows as `2025-10-21 09:15:00`, and `1245.0` shows as `1245`. To print amounts with two decimals, see [Amounts with two decimals][Amounts]. `trackingNumber`, `gl_account`, `revenue_recognition_date`, and the tax code and rate are not displayed.

## :fa-code: Liquid Template

```liquid
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<div class="container mt-4">
  <div class="row align-items-center mb-3">
    <div class="col">
      <h1 class="mb-0">Invoice {{ invoiceId }}</h1>
      <span class="text-muted">Order {{ orderId }} &middot; PO {{ purchaseOrder }}</span>
    </div>
    <div class="col text-right">
      <span class="badge badge-info">{{ invoiceStatus }}</span>
    </div>
  </div>
  <table class="table">
    <thead>
      <tr><th>Bill to</th><th>Invoice Date</th><th>Due Date</th><th>Terms</th><th>Payment</th></tr>
    </thead>
    <tbody>
      <tr>
        <td><strong>{{ customerName }}</strong><br/><span class="text-muted">{{ customerId }}</span><br/><a href="mailto:{{ customerEmail }}">{{ customerEmail }}</a></td>
        <td>{{ invoiceDate }}</td>
        <td>{{ dueDate }}</td>
        <td>{{ paymentTerms }}</td>
        <td>{{ paymentMethod }}</td>
      </tr>
    </tbody>
  </table>
  <h5 class="mt-4">Invoice Lines</h5>
  <table class="table table-sm">
    <thead>
      <tr><th>Line</th><th>SKU</th><th>Description</th><th class="text-center">Qty</th><th class="text-right">Unit Price</th><th class="text-right">Tax</th><th class="text-right">Line Total</th></tr>
    </thead>
    <tbody>
      {%- for item in invoiceItems -%}
      <tr><td>{{ item.lineNumber }}</td><td>{{ item.sku }}</td><td>{{ item.description }}</td><td class="text-center">{{ item.quantity }}</td><td class="text-right">{{ item.unitPrice }}</td><td class="text-right">{{ item.taxAmount }}</td><td class="text-right">{{ item.lineTotal }}</td></tr>
      {%- endfor -%}
    </tbody>
    <tfoot>
      <tr><td colspan="6" class="text-right">Subtotal</td><td class="text-right">{{ subtotal }}</td></tr>
      <tr><td colspan="6" class="text-right">Shipping</td><td class="text-right">{{ shippingCharge }}</td></tr>
      <tr><td colspan="6" class="text-right">Tax</td><td class="text-right">{{ taxTotal }}</td></tr>
      <tr><th colspan="6" class="text-right">Total ({{ currency }})</th><th class="text-right">{{ invoiceTotal }}</th></tr>
    </tfoot>
  </table>
  <div class="mt-5 pt-3 border-top text-center text-muted"><small>Rendered by a Nodinite Stylesheet (Liquid) from the Order Invoice message</small></div>
</div>
```

## :fa-hand-point-right: Next Steps

* :fa-palette: [View all O2C stylesheets][Overview] — Every demo Stylesheet and its settings  
* :fa-play: [Generate O2C Demo Data][Generate-Demo] — Create test messages for this Stylesheet  
* :fa-sitemap: [Search log events from a BPM][] — Read the whole order, step by step  

## :fa-link-horizontal: Related Topics

* :fa-arrow-left: [Order Shipped Stylesheet][Previous-Stylesheet]  
* :fa-file-invoice-dollar: [7. Order Invoiced][Order-Invoiced-Message] — The step this message belongs to  
* :fa-file-lines: [What is a Stylesheet?][Stylesheets]  
* :fa-file-circle-plus: [Add or manage Stylesheet][]  
* :fa-tags: [Message Types][]  

[1]:{ndm}/Documentation%20Pictures/IM/WebClient/Repository/BPMs/O2C/O2C_Stylesheet_7-Order-Invoiced_Open.gif
[2]:{ndm}/Documentation%20Pictures/IM/WebClient/Repository/BPMs/O2C/O2C_Stylesheet_7-Order-Invoiced.png

[Add or manage Stylesheet]:{ndr}/Administration/4.%20Customize/2.%20Stylesheets/Features/Add%20or%20manage%20Stylesheet.md
[Amounts]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Stylesheets/1-Order-Received.md#fa-coins-amounts-with-two-decimals
[BPM]:{ndr}/Repository%20Model/BPMs/Overview.md
[Generate-Demo]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data.md
[Log Event]:{ndr}/Core%20Services/Log%20Event/Overview.md
[Log Views]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/What%20is%20a%20Log%20View.md
[Message Types]:{ndr}/Repository%20Model/Message%20Types/Overview.md
[Order-Invoiced-Message]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/7-Order-Invoiced.md
[Overview]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Stylesheets/Overview.md
[Previous-Stylesheet]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Stylesheets/6-Order-Shipped.md
[Search log events from a BPM]:{ndr}/Getting%20Started/4.%20Repository/BPMs/Search%20log%20events%20from%20a%20BPM.md
[Stylesheets]:{ndr}/Administration/4.%20Customize/2.%20Stylesheets/Features/What%20is%20a%20Stylesheet.md