---
title: Order Received Stylesheet - Liquid Template Example
description: Render Order Received JSON messages from the Nodinite Order-to-Cash demo as a business-friendly Order Report with a Liquid Stylesheet. Available from Log Views and BPM Log Search (7.11).
---

# Order Received Stylesheet

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

![Log View Contoso: Orders searched for ORD-10005, the Order Received event opened with Action and View message formatted as O2C - View Order, ending on the Order Report, animated walkthrough (7.12)][1]  
*Animated walkthrough: search a [Log View][Log Views] for the order, open **Action** on the Order Received event, and choose **View message formatted as 'O2C - View Order'**.*  

**Render JSON order data into formatted, business-friendly reports.** With :Nodinite: [Stylesheets][], operators and business users read an order as a document instead of raw JSON, without external tools. On this page, you will:

* ✅ Transform raw JSON order messages into a formatted Order Report  
* ✅ Display the order header, customer, ship-to address, and line items with a total, with Bootstrap styling and a barcode  
* ✅ Open the same Order Report from [Log Views][] and from [BPM Log Search][Search log events from a BPM] :new7.11:  

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

A [Stylesheet][Stylesheets] is tied to a [Message Type][Message Types]. Every Order Received [Log Event][JSON formatted Log Event] in the demo carries the same Message Type, so :Nodinite: offers the **O2C - View Order** Stylesheet for each of them. Because the Stylesheet has **Message Body is Json** checked, :Nodinite: parses the JSON body and hands its properties to the Liquid template as variables.

<div class="mermaid">
graph LR
    A["fa:fa-inbox Order Received<br/>Log Event (JSON)"] --> B{"fa:fa-tags Message Type"}
    B --> C["fa:fa-file-code O2C - View Order<br/>(Liquid, Message Body is Json)"]
    C --> D["fa:fa-file-alt Order Report"]
    D --> E1["fa:fa-search Log Views"]
    D --> E2["fa:fa-sitemap BPM Log Search (7.11)"]
    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 Received [Log Event][] (blue) is matched to its Message Type (purple); the Liquid Stylesheet (teal) renders the Order Report (green), which users open from a Log View or from [BPM Log Search][Search log events from a BPM] (blue).*

### :fa-puzzle-piece: Where Users Open the Order Report

|Where|How|
|---|---|
|[Log Views][]|Search the Log View, open **Action** on the Order Received event, and choose **View message formatted as 'O2C - View Order'**.|
|[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 Received event in the BPM Viewer. The same option appears there.|

Users only see the Order Report for events in Log Views their role can use; BPM Log Search searches in those same Log Views. The dialog is titled **View message body formatted as 'O2C - View Order'** and has the buttons **Open in New Window**, **Print**, and **Close**.

![Order ORD-10005 for Tailspin Toys in Stockholm rendered as an Order Report by the O2C - View Order Stylesheet, with the Order Date, the Ship to address, the order lines, and the Total row (7.12)][2]  
*The Order Received JSON message rendered as an Order Report: order header with barcode, customer, ship-to address, and order lines with the total. The order lines vary per demo run. Amounts print as the plain number from the message, such as 199.9; see [Amounts with two decimals](#fa-coins-amounts-with-two-decimals). The **Order Date** prints as ISO `yyyy-MM-dd HH:mm:ss`, whatever the culture of the server.*  

### :fa-gear: Stylesheet Settings

|Setting|Value|Why|
|---|---|---|
|Type|Liquid|The Order Received body is JSON|
|Message Body is Json|**Checked**|Exposes `orderId`, `customer.name`, `shipTo`, `orderRows`, and the other properties directly as Liquid variables|
|Message Types|`O2C.Order.Received/1.0` and `O2C.Forwarding/1.0`|Associates the Stylesheet with every Order Received Log Event, and with the forwarding event of the same step, *Order Forwarded to ERP*, which carries the same JSON. Every step's forwarding event logs `O2C.Forwarding/1.0`, so the Stylesheet is offered on all of them, but it renders an empty Order Report on every forwarding event except Step 1's.|

>[!IMPORTANT]
>**Message Body is Json** is a setting on the Stylesheet, not on the Log View. With it unchecked, the variables are empty and the Order Report shows blank fields.

## :fa-file-code: Input JSON

The Order Received body of order 1 as logged by the [demo data script][Generate-Demo]. `generatedAt` and `orderDate` are set to the day of the run at 06:00 UTC. Other orders carry another customer, ship-to address, product, quantity, and total ([the six demo customers][Demo Customers]).

```json
{
  "batchId": "batch-2025-10-14-001",
  "generatedAt": "2026-11-07T06:00:00.0000000Z",
  "orderId": "ORD-10001",
  "customer": {
    "customerId": "CUST-001",
    "name": "Contoso Corporation",
    "email": "orders@Contoso.example.com"
  },
  "shipTo": {
    "street": "100 Commerce Drive, Suite 100",
    "city": "Springfield",
    "region": "IL",
    "zip": "62701",
    "country": "US"
  },
  "orderDate": "2026-11-07T06:00:00.0000000Z",
  "orderRows": [
    {
      "rowId": 1,
      "sku": "SKU-DEMO-001",
      "description": "Demo Widget",
      "quantity": 1,
      "unitPrice": 99.95,
      "lineTotal": 99.95
    }
  ],
  "orderTotal": 99.95,
  "currency": "USD"
}
```

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

### :fa-table: JSON to Order Report Mapping

|JSON property|Liquid variable|Shown in the Order Report as|
|---|---|---|
|`orderId`|`{{ orderId }}`|**Order ID** in the title and the header, and as a Code 39 barcode in **OCR**|
|`customer.name`, `customer.customerId`, `customer.email`|`{{ customer.name }}` …|**Customer**, with a mailto link|
|`shipTo.street`, `shipTo.zip`, `shipTo.city`, `shipTo.region`, `shipTo.country`|`{{ shipTo.city }}` …|**Ship to**, as an address block|
|`orderDate`|`{{ orderDate }}`|**Order Date**|
|`orderRows`|`{{ orderRows \| size }}`|**Rows** (number of order lines)|
|`orderTotal`, `currency`|`{{ orderTotal }}`, `{{ currency }}`|**Amount**, and the **Total** row under the order lines|
|`batchId`|`{{ batchId }}`|**Batch ID** in the footer|
|`orderRows[]`|`{% for row in orderRows %}`|**Order Lines** table: Line, SKU, Description, Qty, Unit Price, Line Total|

`generatedAt` is not displayed. An order logged before the `shipTo` object was added shows no **Ship to** block: the template skips it when `shipTo` is missing.

## :fa-code: Liquid Template

The template uses Bootstrap 4 for the layout and the Libre Barcode 39 Text font for the barcode.

```liquid
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" />
<link href="https://fonts.googleapis.com/css2?family=Libre+Barcode+39+Text&display=swap" rel="stylesheet">
<style>
  .barcode {
    font-family: 'Libre Barcode 39 Text', cursive;
    font-size: 22px;
  }
</style>

<div class="container mt-4">
  <div class="row align-items-center mb-3">
    <div class="col">
      <h1 class="mb-0">Order {{ orderId }}</h1>
      <span class="text-muted">Order Report</span>
    </div>
    <div class="col text-right">
      <img src="https://download.nodinite.com/public/logogoeshere.png" style="width: 200px;" alt="Company Logo" />
    </div>
  </div>

  <table class="table">
    <thead>
      <tr>
        <th>Order ID</th>
        <th>OCR</th>
        <th>Customer</th>
        <th>Order Date</th>
        <th>Rows</th>
        <th class="text-right">Amount ({{ currency }})</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><strong>{{ orderId }}</strong></td>
        <td class="barcode">{{ orderId }}</td>
        <td>
          <strong>{{ customer.name }}</strong><br/>
          <span class="text-muted">{{ customer.customerId }}</span><br/>
          <a href="mailto:{{ customer.email }}">{{ customer.email }}</a>
        </td>
        <td>{{ orderDate }}</td>
        <td>{{ orderRows | size }}</td>
        <td class="text-right"><strong>{{ orderTotal }}</strong></td>
      </tr>
    </tbody>
  </table>

  {%- if shipTo -%}
  <div class="card mb-3" style="max-width: 22rem;">
    <div class="card-body py-2">
      <h6 class="card-subtitle mb-1 text-muted">Ship to</h6>
      <strong>{{ customer.name }}</strong><br/>
      {{ shipTo.street }}<br/>
      {{ shipTo.zip }} {{ shipTo.city }}{% if shipTo.region %}, {{ shipTo.region }}{% endif %}<br/>
      {{ shipTo.country }}
    </div>
  </div>
  {%- endif -%}

  {%- if orderRows.size > 0 -%}
  <h5 class="mt-4">Order 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">Line Total</th>
      </tr>
    </thead>
    <tbody>
      {%- for row in orderRows -%}
      <tr>
        <td>{{ row.rowId }}</td>
        <td>{{ row.sku }}</td>
        <td>{{ row.description }}</td>
        <td class="text-center">{{ row.quantity }}</td>
        <td class="text-right">{{ row.unitPrice }}</td>
        <td class="text-right">{{ row.lineTotal }}</td>
      </tr>
      {%- endfor -%}
    </tbody>
    <tfoot>
      <tr>
        <th colspan="5" class="text-right">Total ({{ currency }})</th>
        <th class="text-right">{{ orderTotal }}</th>
      </tr>
    </tfoot>
  </table>
  {%- endif -%}

  <div class="mt-5 pt-3 border-top text-center text-muted">
    <small>Batch ID: {{ batchId }} · Rendered by a Nodinite Stylesheet from the Order Received message</small>
  </div>
</div>
```

### :fa-coins: Amounts with two decimals

`{{ orderTotal }}` prints the number as the message holds it: `1245`, not `1245.00`. The Liquid engine in :Nodinite: has no number-format filter, and `round: 2` doesn't add decimals either. To always show two decimals, use the `currency` filter with a fixed culture, and drop the currency sign if you don't want it:

```liquid
<th class="text-right">{{ orderTotal | currency: "en-US" | remove: "$" }}</th>
```

`{{ orderTotal | currency: "en-US" }}` gives `$1,245.00`; with `remove: "$"` it gives `1,245.00`. Use the same filter on `row.unitPrice` and `row.lineTotal`.

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

* :fa-palette: [Order Entry Stylesheet][Next-Stylesheet] — The XML message of Step 2, rendered with XSLT  
* :fa-palette: [View all O2C stylesheets][Overview] — Complete stylesheet reference for all demo messages  
* :fa-play: [Generate O2C Demo Data][Generate-Demo] — Create test messages for this stylesheet  
* :fa-sitemap: [Search log events from a BPM][] — Open the Order Report from BPM Log Search  

## :fa-link-horizontal: Related Topics

* :fa-file-lines: [What is a Stylesheet?][Stylesheets]  
* :fa-file-circle-plus: [Add or manage Stylesheet][]  
* :fa-search: [Log Views][]  
* :fa-tags: [Message Types][]  
* :fa-inbox: [Order Received Message Type][Order-Received-Message] — First message in the order-to-cash call chain  

[1]:{ndm}/Documentation%20Pictures/IM/WebClient/Repository/BPMs/O2C/O2C_Stylesheet_ViewOrder.gif
[2]:{ndm}/Documentation%20Pictures/IM/WebClient/Repository/BPMs/O2C/OrderReceived_StylesheetView.png

[Add or manage Stylesheet]:{ndr}/Administration/4.%20Customize/2.%20Stylesheets/Features/Add%20or%20manage%20Stylesheet.md
[BPM]:{ndr}/Repository%20Model/BPMs/Overview.md
[Demo Customers]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data.md#fa-users-customers-products-and-grouping
[Generate-Demo]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data.md
[JSON formatted Log Event]:{ndr}/Core%20Services/Log%20Event/Features/JSON%20Log%20Event.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
[Next-Stylesheet]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Stylesheets/2-Order-Entry.md
[Order-Received-Message]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/1-Order-Received.md
[Overview]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Stylesheets/Overview.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