Skip to content

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.

A5 portraitLocale en-GBHTML + Jinja

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.

PathTypeExample
charityobject
charity.namestring"Fenwhistle Wetlands Trust"
charity.charity_numberstring"1234567"
charity.addressstring"The Boathouse, Reedway Lane, Ely CB7 4XY"
charity.emailstring"supporters@fenwhistle.example.org"
charity.websitestring"fenwhistle.example.org"
donorobject
donor.titlestring"Ms"
donor.first_namestring"Harriet"
donor.last_namestring"Pembleton"
donor.addressstring"14 Larch Crescent ⏎ Norwich ⏎ NR2 3XZ"
donor.supporter_numberstring"FWT-S-048213"
donationobject
donation.receipt_numberstring"FWT-DR-2026-08831"
donation.datedate"2026-09-12"
donation.amountnumber250
donation.methodstring"Bank transfer"
donation.appealstring"Reedbed restoration appeal"
donation.frequencystring"One-off gift"
donation.receipt_datedate"2026-09-14"
donation.currencystring"GBP"
donation.localestring"en-GB"
messagestring"Your gift will help us re-wet **three hectares…"
gift_aidobject
gift_aid.declaredbooleantrue
gift_aid.declaration_datedate"2026-09-12"
gift_aid.reclaim_ratenumber0.25
gift_aid.declaration_textstring"You told us that you pay UK tax and asked us t…"
signatoryobject
signatory.namestring"Dr Olwen Marchetti"
signatory.rolestring"Head of Supporter Care"
no_benefit_statementstring"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.

data.json
{
  "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>

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"
  }
}'