148 × 210 mm
Receipts
Charity donation receipt
An A5 thank-you receipt for charitable donations with donor details, the amount in figures and words, and a signature line. A tax-relief panel with the potential reclaim appears only when the donor has made a declaration; the declaration wording is sample text to replace with your own.
Opens Dynamic Document API with this template preloaded in a free workspace.
Template language features
- Conditionals
- Filters
- Currency formatting
- Date formatting
- Number formatting
- Markdown
Filters such as format_currency and qrcode are described in the template language reference.
Variables
Derived from the sample data: 7 top-level fields, 32 paths in total. Send the same shape as data.
| Path | Type | Example |
|---|---|---|
| charity | object | |
| charity.name | string | "Fenwhistle Wetlands Trust" |
| charity.charity_number | string | "1234567" |
| charity.address | string | "The Boathouse, Reedway Lane, Ely CB7 4XY" |
| charity.email | string | "supporters@fenwhistle.example.org" |
| charity.website | string | "fenwhistle.example.org" |
| donor | object | |
| donor.title | string | "Ms" |
| donor.first_name | string | "Harriet" |
| donor.last_name | string | "Pembleton" |
| donor.address | string | "14 Larch Crescent ⏎ Norwich ⏎ NR2 3XZ" |
| donor.supporter_number | string | "FWT-S-048213" |
| donation | object | |
| donation.receipt_number | string | "FWT-DR-2026-08831" |
| donation.date | date | "2026-09-12" |
| donation.amount | number | 250 |
| donation.method | string | "Bank transfer" |
| donation.appeal | string | "Reedbed restoration appeal" |
| donation.frequency | string | "One-off gift" |
| donation.receipt_date | date | "2026-09-14" |
| donation.currency | string | "GBP" |
| donation.locale | string | "en-GB" |
| message | string | "Your gift will help us re-wet **three hectares…" |
| gift_aid | object | |
| gift_aid.declared | boolean | true |
| gift_aid.declaration_date | date | "2026-09-12" |
| gift_aid.reclaim_rate | number | 0.25 |
| gift_aid.declaration_text | string | "You told us that you pay UK tax and asked us t…" |
| signatory | object | |
| signatory.name | string | "Dr Olwen Marchetti" |
| signatory.role | string | "Head of Supporter Care" |
| no_benefit_statement | string | "No goods or services were provided in return f…" |
Sample data
Fictional records used for previews. Replace them with your own data when you call the API.
{
"charity": {
"name": "Fenwhistle Wetlands Trust",
"charity_number": "1234567",
"address": "The Boathouse, Reedway Lane, Ely CB7 4XY",
"email": "supporters@fenwhistle.example.org",
"website": "fenwhistle.example.org"
},
"donor": {
"title": "Ms",
"first_name": "Harriet",
"last_name": "Pembleton",
"address": "14 Larch Crescent\nNorwich\nNR2 3XZ",
"supporter_number": "FWT-S-048213"
},
"donation": {
"receipt_number": "FWT-DR-2026-08831",
"date": "2026-09-12",
"amount": 250.0,
"method": "Bank transfer",
"appeal": "Reedbed restoration appeal",
"frequency": "One-off gift",
"receipt_date": "2026-09-14",
"currency": "GBP",
"locale": "en-GB"
},
"message": "Your gift will help us re-wet **three hectares** of drained fen at Oxhide Meadows this winter, creating new nesting habitat for bitterns and marsh harriers.",
"gift_aid": {
"declared": true,
"declaration_date": "2026-09-12",
"reclaim_rate": 0.25,
"declaration_text": "You told us that you pay UK tax and asked us to reclaim basic-rate tax on this gift. Please tell us if you stop paying enough tax to cover the amount we reclaim, or if your name or home address changes."
},
"signatory": {
"name": "Dr Olwen Marchetti",
"role": "Head of Supporter Care"
},
"no_benefit_statement": "No goods or services were provided in return for this donation."
}Source
The body markup with Jinja, the stylesheet placed in <head>.
{#- A5 donation acknowledgement. The amount in words is built from whole pounds and pence, and the
tax-relief panel (with the potential reclaim) only appears when the donor has made a declaration.
The declaration wording lives in data.json so each organisation can supply its own text. -#}
{%- set locale = donation.locale | default("en-GB") -%}
{%- set currency = donation.currency -%}
{%- set amount_pence = (donation.amount * 100) | round | int -%}
{%- set pounds = amount_pence // 100 -%}
{%- set pence = amount_pence % 100 -%}
<header class="masthead">
<div class="brand">
<svg class="logo" viewBox="0 0 44 44" aria-hidden="true">
<circle cx="22" cy="22" r="21" fill="#22546b"/>
<path d="M6 29c3.2-2.4 6.4-2.4 9.6 0s6.4 2.4 9.6 0 6.4-2.4 9.6 0 5-1.6 5-1.6" fill="none" stroke="#9fc3d1" stroke-width="1.8" stroke-linecap="round"/>
<path d="M8 34.5c3-2 6-2 9 0s6 2 9 0 6-2 9 0" fill="none" stroke="#6f9fb2" stroke-width="1.6" stroke-linecap="round"/>
<path d="M15 27V12M19 27V8M23 27V14" stroke="#f3e6c4" stroke-width="1.4" stroke-linecap="round"/>
<ellipse cx="15" cy="11" rx="1.4" ry="3.2" fill="#c98b2c"/>
<ellipse cx="19" cy="7" rx="1.4" ry="3.4" fill="#c98b2c"/>
<ellipse cx="23" cy="13" rx="1.4" ry="3" fill="#c98b2c"/>
<path d="M28 20c2-3 5-3.5 7.5-2.5-1.2.3-2.2 1-2.6 2 1.8.8 2.2 2.5 1.2 4-2.6.2-5-1-6.1-3.5z" fill="#ffffff"/>
</svg>
<div>
<div class="charity-name">{{ charity.name }}</div>
<div class="charity-meta">Registered charity no. {{ charity.charity_number }}</div>
</div>
</div>
<div class="receipt-id">
<div class="receipt-label">Donation receipt</div>
<div class="receipt-number">{{ donation.receipt_number }}</div>
</div>
</header>
<section class="thanks">
<h1>Thank you, {{ donor.first_name }}.</h1>
{% if message %}<div class="message">{{ message | markdown }}</div>{% endif %}
</section>
<section class="gift">
<div class="gift-amount">
<div class="label">Your gift</div>
<div class="amount">{{ donation.amount | format_currency(currency, locale) }}</div>
<div class="words">
{{ pounds | number_to_words("en") | capitalize }} pound{{ "s" if pounds != 1 else "" }}{% if pence %} and {{ pence | number_to_words("en") }} pence{% endif %}
</div>
</div>
<dl class="gift-facts">
<dt>Received</dt><dd>{{ donation.date | format_date("long", locale) }}</dd>
<dt>Method</dt><dd>{{ donation.method }}</dd>
<dt>Towards</dt><dd>{{ donation.appeal }}</dd>
<dt>Type</dt><dd>{{ donation.frequency }}</dd>
</dl>
</section>
<section class="donor">
<div>
<div class="label">Received with thanks from</div>
<p class="donor-name">{{ donor.title }} {{ donor.first_name }} {{ donor.last_name }}</p>
<p>{{ donor.address | nl2br }}</p>
</div>
<div>
<div class="label">Supporter number</div>
<p class="mono">{{ donor.supporter_number }}</p>
<div class="label spaced">Receipt issued</div>
<p>{{ donation.receipt_date | format_date("long", locale) }}</p>
</div>
</section>
{% if gift_aid and gift_aid.declared %}
{%- set reclaim = (donation.amount * gift_aid.reclaim_rate) | round(2) -%}
<section class="tax-relief">
<div class="tax-head">
<svg class="tick" viewBox="0 0 20 20" aria-hidden="true">
<circle cx="10" cy="10" r="9.5" fill="#c98b2c"/>
<path d="M5.5 10.4l3 3 6-6.4" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span class="tax-title">Tax relief declaration on file</span>
<span class="tax-boost">+{{ reclaim | format_currency(currency, locale) }}</span>
</div>
<p>{{ gift_aid.declaration_text }}</p>
<p class="tax-meta">
Declaration made {{ gift_aid.declaration_date | format_date("long", locale) }} ·
with tax relief your gift could be worth {{ (donation.amount + reclaim) | format_currency(currency, locale) }}
</p>
</section>
{% endif %}
<section class="sign-off">
<div class="signature">
<div class="sig-line"></div>
<p class="sig-name">{{ signatory.name }}</p>
<p class="sig-role">{{ signatory.role }}, on behalf of {{ charity.name }}</p>
</div>
</section>
<footer class="small-print">
{% if no_benefit_statement %}<p>{{ no_benefit_statement }}</p>{% endif %}
<p>{{ charity.name }} · {{ charity.address }} · {{ charity.email }} · {{ charity.website }}</p>
</footer><title>Donation receipt {{ donation.receipt_number }} – {{ charity.name }}</title>
<style>
:root {
--ink: #1e2a30;
--muted: #5f6d73;
--rule: #d9e1e4;
--water: #22546b;
--water-soft: #e8f0f3;
--ochre: #c98b2c;
--ochre-soft: #f9f0de;
}
* { box-sizing: border-box; }
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body {
margin: 0;
color: var(--ink);
font-family: "Lato", "Liberation Sans", Arial, sans-serif;
font-size: 8.8pt;
line-height: 1.45;
}
p { margin: 0; }
.mono { font-family: "DejaVu Sans Mono", "Liberation Mono", monospace; font-size: 8.2pt; }
.label { font-size: 6.8pt; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.8mm; }
.label.spaced { margin-top: 2.5mm; }
.masthead { display: flex; justify-content: space-between; align-items: center; padding-bottom: 4mm; border-bottom: 0.3mm solid var(--rule); }
.brand { display: flex; align-items: center; gap: 2.8mm; }
.logo { width: 11mm; height: 11mm; }
.charity-name { font-family: "Merriweather", "Liberation Serif", Georgia, serif; font-size: 10.5pt; font-weight: 700; color: var(--water); line-height: 1.25; }
.charity-meta { font-size: 7.2pt; color: var(--muted); }
.receipt-id { text-align: right; }
.receipt-label { font-size: 6.8pt; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ochre); }
.receipt-number { font-family: "DejaVu Sans Mono", "Liberation Mono", monospace; font-size: 7.8pt; }
.thanks { margin: 5mm 0 4mm; }
.thanks h1 {
margin: 0 0 2mm; font-family: "Merriweather", "Liberation Serif", Georgia, serif; font-weight: 700;
font-size: 19pt; line-height: 1.15; color: var(--water);
}
.message { font-size: 8.8pt; color: var(--ink); }
.message p { margin: 0; }
.message strong { color: var(--water); }
.gift {
display: grid; grid-template-columns: 54mm 1fr; gap: 5mm; padding: 4.5mm 5mm; border-radius: 2mm;
background: var(--water-soft); break-inside: avoid; page-break-inside: avoid;
}
.gift-amount { border-right: 0.3mm solid #c5d7de; padding-right: 4mm; }
.amount { font-family: "Merriweather", "Liberation Serif", Georgia, serif; font-size: 23pt; font-weight: 700; line-height: 1.2; color: var(--water); }
.words { margin-top: 1mm; font-size: 8pt; font-style: italic; color: var(--muted); }
.gift-facts { display: grid; grid-template-columns: auto 1fr; gap: 1mm 3mm; margin: 0; align-content: center; font-size: 8.3pt; }
.gift-facts dt { color: var(--muted); }
.gift-facts dd { margin: 0; font-weight: 700; }
.donor { display: grid; grid-template-columns: 1fr 44mm; gap: 5mm; margin: 4mm 0; }
.donor-name { font-weight: 700; }
.tax-relief {
padding: 3.5mm 4.5mm; border: 0.3mm solid var(--ochre); border-radius: 2mm; background: var(--ochre-soft);
font-size: 8pt; break-inside: avoid; page-break-inside: avoid;
}
.tax-head { display: flex; align-items: center; gap: 2mm; margin-bottom: 1.5mm; }
.tick { width: 4.5mm; height: 4.5mm; flex: none; }
.tax-title { flex: 1; font-weight: 700; font-size: 8.8pt; }
.tax-boost { font-weight: 700; font-size: 10pt; color: #8a5a12; }
.tax-meta { margin-top: 1.5mm; color: var(--muted); font-size: 7.5pt; }
.sign-off { margin-top: 5mm; break-inside: avoid; page-break-inside: avoid; }
.signature { width: 70mm; }
.sig-line { height: 8mm; border-bottom: 0.3mm solid var(--ink); }
.sig-name { margin-top: 1.2mm; font-weight: 700; }
.sig-role { font-size: 7.8pt; color: var(--muted); }
.small-print { margin-top: 4mm; padding-top: 2.5mm; border-top: 0.3mm solid var(--rule); font-size: 7pt; color: var(--muted); }
.small-print p + p { margin-top: 0.6mm; }
</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": {
"charity": {
"name": "Fenwhistle Wetlands Trust",
"charity_number": "1234567",
"address": "The Boathouse, Reedway Lane, Ely CB7 4XY",
"email": "supporters@fenwhistle.example.org",
"website": "fenwhistle.example.org"
},
"donor": {
"title": "Ms",
"first_name": "Harriet",
"last_name": "Pembleton",
"address": "14 Larch Crescent\nNorwich\nNR2 3XZ",
"supporter_number": "FWT-S-048213"
},
"donation": {
"receipt_number": "FWT-DR-2026-08831",
"date": "2026-09-12",
"amount": 250,
"method": "Bank transfer",
"appeal": "Reedbed restoration appeal",
"frequency": "One-off gift",
"receipt_date": "2026-09-14",
"currency": "GBP",
"locale": "en-GB"
},
"message": "Your gift will help us re-wet **three hectares** of drained fen at Oxhide Meadows this winter, creating new nesting habitat for bitterns and marsh harriers.",
"gift_aid": {
"declared": true,
"declaration_date": "2026-09-12",
"reclaim_rate": 0.25,
"declaration_text": "You told us that you pay UK tax and asked us to reclaim basic-rate tax on this gift. Please tell us if you stop paying enough tax to cover the amount we reclaim, or if your name or home address changes."
},
"signatory": {
"name": "Dr Olwen Marchetti",
"role": "Head of Supporter Care"
},
"no_benefit_statement": "No goods or services were provided in return for this donation."
},
"output": {
"format": "pdf",
"filename": "receipt-donation.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": {
"charity": {
"name": "Fenwhistle Wetlands Trust",
"charity_number": "1234567",
"address": "The Boathouse, Reedway Lane, Ely CB7 4XY",
"email": "supporters@fenwhistle.example.org",
"website": "fenwhistle.example.org"
},
"donor": {
"title": "Ms",
"first_name": "Harriet",
"last_name": "Pembleton",
"address": "14 Larch Crescent\nNorwich\nNR2 3XZ",
"supporter_number": "FWT-S-048213"
},
"donation": {
"receipt_number": "FWT-DR-2026-08831",
"date": "2026-09-12",
"amount": 250,
"method": "Bank transfer",
"appeal": "Reedbed restoration appeal",
"frequency": "One-off gift",
"receipt_date": "2026-09-14",
"currency": "GBP",
"locale": "en-GB"
},
"message": "Your gift will help us re-wet **three hectares** of drained fen at Oxhide Meadows this winter, creating new nesting habitat for bitterns and marsh harriers.",
"gift_aid": {
"declared": true,
"declaration_date": "2026-09-12",
"reclaim_rate": 0.25,
"declaration_text": "You told us that you pay UK tax and asked us to reclaim basic-rate tax on this gift. Please tell us if you stop paying enough tax to cover the amount we reclaim, or if your name or home address changes."
},
"signatory": {
"name": "Dr Olwen Marchetti",
"role": "Head of Supporter Care"
},
"no_benefit_statement": "No goods or services were provided in return for this donation."
},
"output": {
"format": "pdf",
"filename": "receipt-donation.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": {
"charity": {
"name": "Fenwhistle Wetlands Trust",
"charity_number": "1234567",
"address": "The Boathouse, Reedway Lane, Ely CB7 4XY",
"email": "supporters@fenwhistle.example.org",
"website": "fenwhistle.example.org",
},
"donor": {
"title": "Ms",
"first_name": "Harriet",
"last_name": "Pembleton",
"address": "14 Larch Crescent\nNorwich\nNR2 3XZ",
"supporter_number": "FWT-S-048213",
},
"donation": {
"receipt_number": "FWT-DR-2026-08831",
"date": "2026-09-12",
"amount": 250,
"method": "Bank transfer",
"appeal": "Reedbed restoration appeal",
"frequency": "One-off gift",
"receipt_date": "2026-09-14",
"currency": "GBP",
"locale": "en-GB",
},
"message": "Your gift will help us re-wet **three hectares** of drained fen at Oxhide Meadows this winter, creating new nesting habitat for bitterns and marsh harriers.",
"gift_aid": {
"declared": True,
"declaration_date": "2026-09-12",
"reclaim_rate": 0.25,
"declaration_text": "You told us that you pay UK tax and asked us to reclaim basic-rate tax on this gift. Please tell us if you stop paying enough tax to cover the amount we reclaim, or if your name or home address changes.",
},
"signatory": {
"name": "Dr Olwen Marchetti",
"role": "Head of Supporter Care",
},
"no_benefit_statement": "No goods or services were provided in return for this donation.",
},
"output": {
"format": "pdf",
"filename": "receipt-donation.pdf",
},
},
timeout=90,
)
response.raise_for_status()
print(response.json())