210 × 297 mm
Delivery notes
Standard delivery note
An A4 delivery note with a consignment barcode, delivery address, order and carrier details, lines comparing ordered and delivered quantities with a back-ordered badge and expected date, a list of items to follow, and received-by and driver signature blocks.
Opens Dynamic Document API with this template preloaded in a free workspace.
Template language features
- Loops
- Conditionals
- Macros
- Filters
- Number formatting
- Date formatting
- Barcode
- Repeating table headers
- Header & footer
- Page numbers
Filters such as format_currency and qrcode are described in the template language reference.
Variables
Derived from the sample data: 5 top-level fields, 31 paths in total. Send the same shape as data.
| Path | Type | Example |
|---|---|---|
| supplier | object | |
| supplier.name | string | "Calderbank Office Interiors Ltd" |
| supplier.address | string | "Calder Works, 2 Tanyard Road ⏎ Halifax HX3 5AL…" |
| supplier.phone | string | "+44 20 7946 0615" |
| supplier.email | string | "deliveries@calderbank.example.com" |
| supplier.vat_id | string | "GB 135 7924 68" |
| customer | object | |
| customer.name | string | "Tarnside Architects LLP" |
| customer.account | string | "C-10457" |
| customer.delivery_address | string | "3rd Floor, Wharfside House ⏎ 18 Navigation Wal…" |
| customer.contact | string | "Farida Ellingham" |
| customer.phone | string | "+44 20 7946 0642" |
| delivery | object | |
| delivery.note_number | string | "DN-240613" |
| delivery.consignment_number | string | "CBK4471093026GB" |
| delivery.date | date | "2026-09-16" |
| delivery.order_number | string | "SO-58217" |
| delivery.customer_reference | string | "TA-PO-1193" |
| delivery.carrier | string | "Brackenfield Logistics" |
| delivery.service | string | "Two-person delivery and installation" |
| delivery.vehicle | string | "Van 12" |
| delivery.driver | string | "Kwame Holloway" |
| delivery.packages | number | 14 |
| delivery.total_weight_kg | number | 412.5 |
| items | array<object> · 9 | |
| items[].code | string | "CB-DSK-1600-OAK" |
| items[].description | string | "Sit-stand desk, 1600 × 800 mm, oak-effect top" |
| items[].ordered | number | 6 |
| items[].delivered | number | 6 |
| items[].back_order_date | date | "2026-09-30" |
| notes | string | "Installation team on site from 08:00 to 13:00.…" |
Sample data
Fictional records used for previews. Replace them with your own data when you call the API.
{
"supplier": {
"name": "Calderbank Office Interiors Ltd",
"address": "Calder Works, 2 Tanyard Road\nHalifax HX3 5AL\nUnited Kingdom",
"phone": "+44 20 7946 0615",
"email": "deliveries@calderbank.example.com",
"vat_id": "GB 135 7924 68"
},
"customer": {
"name": "Tarnside Architects LLP",
"account": "C-10457",
"delivery_address": "3rd Floor, Wharfside House\n18 Navigation Walk\nLeeds LS10 1JR\nUnited Kingdom",
"contact": "Farida Ellingham",
"phone": "+44 20 7946 0642"
},
"delivery": {
"note_number": "DN-240613",
"consignment_number": "CBK4471093026GB",
"date": "2026-09-16",
"order_number": "SO-58217",
"customer_reference": "TA-PO-1193",
"carrier": "Brackenfield Logistics",
"service": "Two-person delivery and installation",
"vehicle": "Van 12",
"driver": "Kwame Holloway",
"packages": 14,
"total_weight_kg": 412.5
},
"items": [
{ "code": "CB-DSK-1600-OAK", "description": "Sit-stand desk, 1600 × 800 mm, oak-effect top", "ordered": 6, "delivered": 6, "back_order_date": null },
{ "code": "CB-CHR-ERG-GRY", "description": "Ergonomic task chair, grey mesh back", "ordered": 8, "delivered": 5, "back_order_date": "2026-09-30" },
{ "code": "CB-PED-3D-WHT", "description": "Mobile pedestal, three drawers, white", "ordered": 6, "delivered": 6, "back_order_date": null },
{ "code": "CB-SCR-1600-SGE", "description": "Desk-mounted acoustic screen, 1600 mm, sage felt", "ordered": 6, "delivered": 4, "back_order_date": "2026-10-07" },
{ "code": "CB-TBL-MTG-2400", "description": "Meeting table, 2400 × 1200 mm, oak-effect", "ordered": 1, "delivered": 1, "back_order_date": null },
{ "code": "CB-CHR-MTG-BLK", "description": "Meeting chair, stackable, black", "ordered": 10, "delivered": 10, "back_order_date": null },
{ "code": "CB-CAB-TALL-WHT", "description": "Tall storage cabinet, lockable, white", "ordered": 2, "delivered": 2, "back_order_date": null },
{ "code": "CB-LMP-TASK-LED", "description": "LED task lamp with USB-C port", "ordered": 6, "delivered": 0, "back_order_date": "2026-10-14" },
{ "code": "CB-CBL-TRAY-1600", "description": "Under-desk cable tray, 1600 mm", "ordered": 6, "delivered": 6, "back_order_date": null }
],
"notes": "Installation team on site from 08:00 to 13:00. All packaging taken away for recycling. Back-ordered items are delivered free of charge and do not need a new order."
}Source
The body markup with Jinja, the stylesheet placed in <head> and the header and footer settings.
{#- Delivery note. A line is back-ordered when fewer units were delivered than ordered. -#}
{%- set locale = "en-GB" -%}
{%- set total_ordered = items | sum_by("ordered") | int -%}
{%- set total_delivered = items | sum_by("delivered") | int -%}
{%- set total_outstanding = total_ordered - total_delivered -%}
{%- set back_orders = items | rejectattr("back_order_date", "none") | list -%}
{%- macro tick(label) -%}
<span class="tick"><span class="box"></span>{{ label }}</span>
{%- endmacro %}
<header class="masthead">
<div class="brand">
<svg class="logo" viewBox="0 0 40 40" aria-hidden="true">
<rect x="2" y="2" width="36" height="36" rx="4" fill="#0b4dbd"/>
<path d="M9 27h22M11 27V17h18v10M14 17v-4h12v4" fill="none" stroke="#ffffff" stroke-width="2.4" stroke-linejoin="round"/>
</svg>
<div>
<p class="brand-name">{{ supplier.name }}</p>
<p class="brand-meta">{{ supplier.address | replace("\n", " · ") }}</p>
<p class="brand-meta">{{ supplier.phone }} · {{ supplier.email }}</p>
</div>
</div>
<div class="doc">
<h1>Delivery note</h1>
<p class="doc-number">{{ delivery.note_number }}</p>
</div>
</header>
<section class="consignment">
<div class="code">
{{ delivery.consignment_number | barcode("code128", alt="Barcode " ~ delivery.consignment_number) }}
</div>
<dl>
<div><dt>Consignment</dt><dd>{{ delivery.consignment_number }}</dd></div>
<div><dt>Delivery date</dt><dd>{{ delivery.date | format_date("long", locale) }}</dd></div>
<div><dt>Packages</dt><dd>{{ delivery.packages }}</dd></div>
<div><dt>Gross weight</dt><dd>{{ delivery.total_weight_kg | format_number(locale, 1) }} kg</dd></div>
</dl>
</section>
<section class="info">
<div>
<p class="label">Deliver to</p>
<p class="strong">{{ customer.name }}</p>
<p>{{ customer.delivery_address | nl2br }}</p>
<p class="muted">Contact: {{ customer.contact }}, {{ customer.phone }}</p>
</div>
<div>
<p class="label">Order</p>
<dl class="pairs">
<dt>Our order</dt><dd>{{ delivery.order_number }}</dd>
<dt>Your reference</dt><dd>{{ delivery.customer_reference }}</dd>
<dt>Account</dt><dd>{{ customer.account }}</dd>
</dl>
</div>
<div>
<p class="label">Carrier</p>
<dl class="pairs">
<dt>Carrier</dt><dd>{{ delivery.carrier }}</dd>
<dt>Service</dt><dd>{{ delivery.service }}</dd>
<dt>Vehicle</dt><dd>{{ delivery.vehicle }} · {{ delivery.driver }}</dd>
</dl>
</div>
</section>
<table class="items">
<thead>
<tr>
<th class="idx" scope="col">#</th>
<th class="code-col" scope="col">Item code</th>
<th scope="col">Description</th>
<th class="num" scope="col">Ordered</th>
<th class="num" scope="col">Delivered</th>
<th class="status" scope="col">Status</th>
</tr>
</thead>
<tbody>
{%- for item in items %}
{%- set short = item.ordered - item.delivered %}
<tr{% if short > 0 %} class="short"{% endif %}>
<td class="idx">{{ loop.index }}</td>
<td class="code-col">{{ item.code }}</td>
<td>{{ item.description }}</td>
<td class="num">{{ item.ordered }}</td>
<td class="num delivered">{{ item.delivered }}</td>
<td class="status">
{%- if short > 0 %}
<span class="badge back">Back-ordered {{ short }}</span>
{%- if item.back_order_date %}<span class="eta">Due {{ item.back_order_date | format_date("%d %b", locale) }}</span>{% endif %}
{%- else %}
<span class="badge full">Complete</span>
{%- endif %}
</td>
</tr>
{%- endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="3">{{ items | length }} lines</td>
<td class="num">{{ total_ordered }}</td>
<td class="num">{{ total_delivered }}</td>
<td class="status">{% if total_outstanding > 0 %}{{ total_outstanding }} to follow{% else %}All delivered{% endif %}</td>
</tr>
</tfoot>
</table>
<section class="after-table">
{%- if back_orders %}
<div class="followup">
<p class="label">To follow</p>
<ul>
{%- for item in back_orders %}
<li><strong>{{ item.ordered - item.delivered }} × {{ item.description }}</strong><span>expected {{ item.back_order_date | format_date("long", locale) }}</span></li>
{%- endfor %}
</ul>
</div>
{%- endif %}
{%- if notes %}
<div class="notes">
<p class="label">Delivery notes</p>
<p>{{ notes }}</p>
</div>
{%- endif %}
</section>
<section class="signoff">
<div class="sign-box received">
<p class="sign-title">Received by</p>
<div class="checks">
{{ tick("Received in good condition") }}
{{ tick("Damage noted below") }}
{{ tick("Packages missing") }}
</div>
<div class="fields">
<div class="field wide"><span>Name (capitals)</span></div>
<div class="field"><span>Date</span></div>
<div class="field wide tall"><span>Signature</span></div>
<div class="field tall"><span>Time</span></div>
<div class="field full"><span>Damage or discrepancies</span></div>
</div>
</div>
<div class="sign-box">
<p class="sign-title">Delivered by</p>
<p class="driver">{{ delivery.driver }}, {{ delivery.carrier }}</p>
<div class="fields single">
<div class="field tall"><span>Driver signature</span></div>
<div class="field"><span>Time on site</span></div>
</div>
<p class="hint">Please check the number of packages before signing. Report hidden damage within 48 hours, quoting {{ delivery.note_number }}.</p>
</div>
</section><title>Delivery note {{ delivery.note_number }}</title>
<style>
:root {
--ink: #172033;
--muted: #5f6a7d;
--rule: #dfe4ec;
--cobalt: #0b4dbd;
--cobalt-soft: #eaf1fc;
--amber: #b54708;
--amber-soft: #fef0c7;
--green: #067647;
--green-soft: #dcfae6;
}
* { box-sizing: border-box; }
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body {
margin: 0;
color: var(--ink);
font-family: "Roboto", "Liberation Sans", Arial, sans-serif;
font-size: 8.7pt;
line-height: 1.42;
}
p, h1, dl, dd { margin: 0; }
.strong { font-weight: 700; }
.muted { color: var(--muted); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.label {
margin-bottom: 1.2mm;
font-family: "Poppins", "Liberation Sans", Arial, sans-serif;
font-size: 6.8pt;
font-weight: 600;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--cobalt);
}
.masthead { display: flex; justify-content: space-between; align-items: flex-start; }
.brand { display: flex; gap: 3mm; }
.logo { flex: none; width: 11mm; height: 11mm; }
.brand-name { font-family: "Poppins", "Liberation Sans", Arial, sans-serif; font-size: 11pt; font-weight: 600; line-height: 1.3; }
.brand-meta { font-size: 7.4pt; color: var(--muted); }
.doc { text-align: right; }
.doc h1 { font-family: "Poppins", "Liberation Sans", Arial, sans-serif; font-size: 22pt; font-weight: 700; line-height: 1.05; color: var(--cobalt); }
.doc-number { font-family: "Poppins", "Liberation Sans", Arial, sans-serif; font-size: 11pt; font-weight: 500; }
.consignment {
display: grid;
grid-template-columns: 74mm 1fr;
gap: 9mm;
align-items: center;
margin: 5mm 0;
padding: 3.5mm 5mm;
border-radius: 2mm;
background: var(--cobalt-soft);
}
.consignment .code { padding: 2mm 3mm; border-radius: 1.2mm; background: #ffffff; }
.consignment .code img, .consignment .code svg { display: block; width: 100%; height: 13mm; }
.consignment dl { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 1.6mm 9mm; }
.consignment dt { font-size: 6.6pt; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.consignment dd { font-family: "Poppins", "Liberation Sans", Arial, sans-serif; font-size: 10.5pt; font-weight: 600; white-space: nowrap; }
.info { display: grid; grid-template-columns: 1.1fr 0.9fr 1fr; gap: 7mm; margin-bottom: 5mm; }
.info .muted { margin-top: 1.2mm; font-size: 7.8pt; }
.pairs { display: grid; grid-template-columns: auto 1fr; gap: 0.6mm 3mm; }
.pairs dt { color: var(--muted); }
table.items { width: 100%; border-collapse: collapse; }
table.items thead { display: table-header-group; }
table.items th {
padding: 2mm;
border-top: 0.5mm solid var(--ink);
border-bottom: 0.25mm solid var(--ink);
font-family: "Poppins", "Liberation Sans", Arial, sans-serif;
font-size: 6.8pt;
font-weight: 600;
letter-spacing: 0.06em;
text-align: left;
text-transform: uppercase;
color: var(--muted);
}
table.items th.num { text-align: right; }
table.items td { padding: 2.3mm 2mm; border-bottom: 0.2mm solid var(--rule); vertical-align: middle; }
table.items tr { break-inside: avoid; page-break-inside: avoid; }
table.items tr.short td { background: #fffbf2; }
.idx { width: 7mm; color: var(--muted); }
.code-col { width: 34mm; font-family: "DejaVu Sans Mono", "Liberation Mono", monospace; font-size: 7.2pt; }
td.delivered { font-weight: 700; }
.status { width: 36mm; }
table.items tfoot td { padding-top: 2.6mm; border-top: 0.5mm solid var(--ink); border-bottom: none; font-weight: 700; }
.badge { display: inline-block; padding: 0.3mm 2mm; border-radius: 3mm; font-size: 7pt; font-weight: 700; white-space: nowrap; }
.badge.back { background: var(--amber-soft); color: var(--amber); }
.badge.full { background: var(--green-soft); color: var(--green); }
.eta { display: block; margin-top: 0.4mm; font-size: 7pt; color: var(--muted); }
.after-table { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; margin-top: 5mm; break-inside: avoid; page-break-inside: avoid; }
.followup { padding: 3mm 4mm; border-left: 1mm solid var(--amber); background: #fffaf0; }
.followup .label { color: var(--amber); }
.followup ul { margin: 0; padding: 0; list-style: none; }
.followup li { margin-bottom: 1mm; }
.followup li span { display: block; font-size: 7.6pt; color: var(--muted); }
.notes { padding: 3mm 0; font-size: 8.2pt; }
.signoff { display: grid; grid-template-columns: 1.45fr 1fr; gap: 6mm; margin-top: 6mm; break-inside: avoid; page-break-inside: avoid; }
.sign-box { padding: 3.5mm 4.5mm 4.5mm; border: 0.35mm solid var(--ink); border-radius: 2mm; }
.sign-box.received { border: 0.6mm solid var(--cobalt); }
.sign-title { font-family: "Poppins", "Liberation Sans", Arial, sans-serif; font-size: 10.5pt; font-weight: 600; }
.received .sign-title { color: var(--cobalt); }
.checks { display: flex; flex-wrap: wrap; gap: 1.5mm 5mm; margin: 2mm 0 1mm; }
.tick { display: inline-flex; align-items: center; gap: 1.5mm; font-size: 8pt; }
.box { display: inline-block; width: 3.8mm; height: 3.8mm; border: 0.35mm solid var(--ink); border-radius: 0.6mm; }
.fields { display: grid; grid-template-columns: 1fr 1fr 28mm; gap: 1mm 4mm; }
.fields.single { grid-template-columns: 1fr; }
.field { position: relative; height: 10mm; border-bottom: 0.3mm solid var(--ink); }
.field.wide { grid-column: span 2; }
.field.tall { height: 15mm; }
.field.full { grid-column: 1 / -1; height: 11mm; border-bottom-style: dotted; }
.field span { position: absolute; bottom: 0.6mm; right: 0; font-size: 6.2pt; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.driver { margin-top: 1mm; font-size: 8.2pt; color: var(--muted); }
.hint { margin-top: 3mm; font-size: 7.4pt; color: var(--muted); }
</style>Render it with the API
After adding the template to your workspace, render it by ID and pass your data. Arrays are shortened here.
curl -X POST https://api-eu.dynamicdocumentapi.com/v1/renders \
-H "Authorization: Bearer $DYNAMIC_DOCUMENT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"input": {
"type": "template",
"template_id": "tpl_01J9ZK3M7Q8V5W2X4Y6Z8A0B1C"
},
"data": {
"supplier": {
"name": "Calderbank Office Interiors Ltd",
"address": "Calder Works, 2 Tanyard Road\nHalifax HX3 5AL\nUnited Kingdom",
"phone": "+44 20 7946 0615",
"email": "deliveries@calderbank.example.com",
"vat_id": "GB 135 7924 68"
},
"customer": {
"name": "Tarnside Architects LLP",
"account": "C-10457",
"delivery_address": "3rd Floor, Wharfside House\n18 Navigation Walk\nLeeds LS10 1JR\nUnited Kingdom",
"contact": "Farida Ellingham",
"phone": "+44 20 7946 0642"
},
"delivery": {
"note_number": "DN-240613",
"consignment_number": "CBK4471093026GB",
"date": "2026-09-16",
"order_number": "SO-58217",
"customer_reference": "TA-PO-1193",
"carrier": "Brackenfield Logistics",
"service": "Two-person delivery and installation",
"vehicle": "Van 12",
"driver": "Kwame Holloway",
"packages": 14,
"total_weight_kg": 412.5
},
"items": [
{
"code": "CB-DSK-1600-OAK",
"description": "Sit-stand desk, 1600 × 800 mm, oak-effect top",
"ordered": 6,
"delivered": 6,
"back_order_date": null
},
{
"code": "CB-CHR-ERG-GRY",
"description": "Ergonomic task chair, grey mesh back",
"ordered": 8,
"delivered": 5,
"back_order_date": "2026-09-30"
}
],
"notes": "Installation team on site from 08:00 to 13:00. All packaging taken away for recycling. Back-ordered items are delivered free of charge and do not need a new order."
},
"output": {
"format": "pdf",
"filename": "delivery-note-standard.pdf"
}
}'const response = await fetch("https://api-eu.dynamicdocumentapi.com/v1/renders", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.DYNAMIC_DOCUMENT_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
"input": {
"type": "template",
"template_id": "tpl_01J9ZK3M7Q8V5W2X4Y6Z8A0B1C"
},
"data": {
"supplier": {
"name": "Calderbank Office Interiors Ltd",
"address": "Calder Works, 2 Tanyard Road\nHalifax HX3 5AL\nUnited Kingdom",
"phone": "+44 20 7946 0615",
"email": "deliveries@calderbank.example.com",
"vat_id": "GB 135 7924 68"
},
"customer": {
"name": "Tarnside Architects LLP",
"account": "C-10457",
"delivery_address": "3rd Floor, Wharfside House\n18 Navigation Walk\nLeeds LS10 1JR\nUnited Kingdom",
"contact": "Farida Ellingham",
"phone": "+44 20 7946 0642"
},
"delivery": {
"note_number": "DN-240613",
"consignment_number": "CBK4471093026GB",
"date": "2026-09-16",
"order_number": "SO-58217",
"customer_reference": "TA-PO-1193",
"carrier": "Brackenfield Logistics",
"service": "Two-person delivery and installation",
"vehicle": "Van 12",
"driver": "Kwame Holloway",
"packages": 14,
"total_weight_kg": 412.5
},
"items": [
{
"code": "CB-DSK-1600-OAK",
"description": "Sit-stand desk, 1600 × 800 mm, oak-effect top",
"ordered": 6,
"delivered": 6,
"back_order_date": null
},
{
"code": "CB-CHR-ERG-GRY",
"description": "Ergonomic task chair, grey mesh back",
"ordered": 8,
"delivered": 5,
"back_order_date": "2026-09-30"
}
],
"notes": "Installation team on site from 08:00 to 13:00. All packaging taken away for recycling. Back-ordered items are delivered free of charge and do not need a new order."
},
"output": {
"format": "pdf",
"filename": "delivery-note-standard.pdf"
}
}),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const result = await response.json();
console.log(result);import os
import uuid
import requests
response = requests.post(
"https://api-eu.dynamicdocumentapi.com/v1/renders",
headers={
"Authorization": f"Bearer {os.environ['DYNAMIC_DOCUMENT_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"input": {
"type": "template",
"template_id": "tpl_01J9ZK3M7Q8V5W2X4Y6Z8A0B1C",
},
"data": {
"supplier": {
"name": "Calderbank Office Interiors Ltd",
"address": "Calder Works, 2 Tanyard Road\nHalifax HX3 5AL\nUnited Kingdom",
"phone": "+44 20 7946 0615",
"email": "deliveries@calderbank.example.com",
"vat_id": "GB 135 7924 68",
},
"customer": {
"name": "Tarnside Architects LLP",
"account": "C-10457",
"delivery_address": "3rd Floor, Wharfside House\n18 Navigation Walk\nLeeds LS10 1JR\nUnited Kingdom",
"contact": "Farida Ellingham",
"phone": "+44 20 7946 0642",
},
"delivery": {
"note_number": "DN-240613",
"consignment_number": "CBK4471093026GB",
"date": "2026-09-16",
"order_number": "SO-58217",
"customer_reference": "TA-PO-1193",
"carrier": "Brackenfield Logistics",
"service": "Two-person delivery and installation",
"vehicle": "Van 12",
"driver": "Kwame Holloway",
"packages": 14,
"total_weight_kg": 412.5,
},
"items": [
{
"code": "CB-DSK-1600-OAK",
"description": "Sit-stand desk, 1600 × 800 mm, oak-effect top",
"ordered": 6,
"delivered": 6,
"back_order_date": None,
},
{
"code": "CB-CHR-ERG-GRY",
"description": "Ergonomic task chair, grey mesh back",
"ordered": 8,
"delivered": 5,
"back_order_date": "2026-09-30",
},
],
"notes": "Installation team on site from 08:00 to 13:00. All packaging taken away for recycling. Back-ordered items are delivered free of charge and do not need a new order.",
},
"output": {
"format": "pdf",
"filename": "delivery-note-standard.pdf",
},
},
timeout=90,
)
response.raise_for_status()
print(response.json())