Skip to content

105 × 148 mm

Shipping labels

Return label (A6)

An A6 prepaid return label for online retailers. The upper part carries the returns centre address, the sender and a Code 128 barcode of the RMA number; below a cut line, the customer keeps a summary with the return reason, return-by date and packing instructions.

A6 portraitLocale en-GBHTML + Jinja

Opens Dynamic Document API with this template preloaded in a free workspace.

Template language features

  • Loops
  • Conditionals
  • Filters
  • Barcode
  • Date formatting
  • Number formatting

Filters such as format_currency and qrcode are described in the template language reference.

Variables

Derived from the sample data: 6 top-level fields, 30 paths in total. Send the same shape as data.

PathTypeExample
retailerobject
retailer.namestring"Fellside Outfitters"
retailer.websitestring"fellside.example.com"
retailer.returns_emailstring"returns@fellside.example.com"
returns_centreobject
returns_centre.namestring"Fellside Outfitters Returns"
returns_centre.address_linesarray<string> · 2"Unit 12, Beckside Distribution Park"
returns_centre.townstring"Kendal"
returns_centre.postcodestring"LA9 6XY"
returns_centre.countrystring"United Kingdom"
customerobject
customer.namestring"Oluwaseun Pryce"
customer.address_linesarray<string> · 1"5 Thistle Row"
customer.townstring"Stirling"
customer.postcodestring"FK8 2XY"
rmaobject
rma.numberstring"RMA-FSO-083145"
rma.order_numberstring"FSO-2026-557102"
rma.created_ondate"2026-09-16"
rma.return_window_daysnumber14
rma.servicestring"Prepaid tracked return"
rma.reasonstring"Wrong size: too small"
rma.resolutionstring"Exchange for size L"
rma.parcel_weight_kgnumber0.9
rma.localestring"en-GB"
itemsarray<object> · 1
items[].skustring"FSO-TSJ-M-SLT"
items[].namestring"Trail shell jacket, men's, M, slate"
items[].quantitynumber1
instructionsarray<string> · 4"Pack the item unworn, with its tags attached."

Sample data

Fictional records used for previews. Replace them with your own data when you call the API.

data.json
{
  "retailer": {
    "name": "Fellside Outfitters",
    "website": "fellside.example.com",
    "returns_email": "returns@fellside.example.com"
  },
  "returns_centre": {
    "name": "Fellside Outfitters Returns",
    "address_lines": [
      "Unit 12, Beckside Distribution Park",
      "Heronbrook Way"
    ],
    "town": "Kendal",
    "postcode": "LA9 6XY",
    "country": "United Kingdom"
  },
  "customer": {
    "name": "Oluwaseun Pryce",
    "address_lines": [
      "5 Thistle Row"
    ],
    "town": "Stirling",
    "postcode": "FK8 2XY"
  },
  "rma": {
    "number": "RMA-FSO-083145",
    "order_number": "FSO-2026-557102",
    "created_on": "2026-09-16",
    "return_window_days": 14,
    "service": "Prepaid tracked return",
    "reason": "Wrong size: too small",
    "resolution": "Exchange for size L",
    "parcel_weight_kg": 0.9,
    "locale": "en-GB"
  },
  "items": [
    { "sku": "FSO-TSJ-M-SLT", "name": "Trail shell jacket, men's, M, slate", "quantity": 1 }
  ],
  "instructions": [
    "Pack the item unworn, with its tags attached.",
    "Cut along the dashed line and keep this lower part.",
    "Stick the label to the parcel, covering any old barcodes.",
    "Drop the parcel at a parcel shop or post office by the return date."
  ]
}

Source

The body markup with Jinja, the stylesheet placed in <head>.

{#- A6 return label in two parts: the upper part goes on the parcel (returns centre address, sender and
    an RMA barcode), the lower part stays with the customer (return summary and instructions).
    The return-by date is calculated from the date the return was created. -#}
{%- set locale = rma.locale | default("en-GB") -%}
{%- set return_by = rma.created_on | date_add(days=rma.return_window_days) -%}
{%- set item_count = items | sum_by("quantity") | int -%}

<div class="sheet">
  <section class="parcel-part">
    <header class="banner">
      <span class="banner-title">Return</span>
      <span class="banner-service">{{ rma.service }}</span>
    </header>

    <div class="deliver">
      <p class="small-label">Deliver to</p>
      <p class="deliver-name">{{ returns_centre.name }}</p>
      {% for line in returns_centre.address_lines %}<p class="deliver-line">{{ line }}</p>{% endfor %}
      <p class="deliver-town">{{ returns_centre.town | upper }} {{ returns_centre.postcode }}</p>
    </div>

    <div class="from-row">
      <div class="from">
        <p class="small-label">From</p>
        <p>{{ customer.name }}, {{ customer.address_lines | join(", ") }}</p>
        <p>{{ customer.town }} {{ customer.postcode }}</p>
      </div>
      <div class="weight">
        <p class="small-label">Weight</p>
        <p class="weight-value">{{ rma.parcel_weight_kg | format_number(locale, 1) }} kg</p>
      </div>
    </div>

    <div class="rma">
      <div class="rma-barcode">{{ rma.number | barcode("code128", alt="Barcode " ~ rma.number) }}</div>
      <p class="rma-text">{{ rma.number }}</p>
    </div>

    <div class="parcel-foot">
      <span>Order {{ rma.order_number }}</span>
      <span>Return by {{ return_by | format_date("medium", locale) }}</span>
    </div>
  </section>

  <div class="cut">
    <svg class="scissors" viewBox="0 0 24 24" aria-hidden="true">
      <circle cx="5" cy="7" r="3" fill="none" stroke="#000000" stroke-width="1.6"/>
      <circle cx="5" cy="17" r="3" fill="none" stroke="#000000" stroke-width="1.6"/>
      <path d="M7.5 8.5L22 17M7.5 15.5L22 7" stroke="#000000" stroke-width="1.6" stroke-linecap="round"/>
    </svg>
    <span>Cut here · keep the lower part</span>
  </div>

  <section class="keep-part">
    <div class="keep-head">
      <p class="keep-title">Your return summary</p>
      <p class="keep-brand">{{ retailer.name }}</p>
    </div>
    <dl class="summary">
      <div><dt>RMA</dt><dd>{{ rma.number }}</dd></div>
      <div><dt>Return by</dt><dd>{{ return_by | format_date("long", locale) }}</dd></div>
      <div><dt>Reason</dt><dd>{{ rma.reason }}</dd></div>
      <div><dt>We will</dt><dd>{{ rma.resolution }}</dd></div>
      <div class="wide">
        <dt>Item{{ "s" if item_count != 1 else "" }}</dt>
        <dd>{% for item in items %}{{ item.quantity }} × {{ item.name }} <span class="sku">{{ item.sku }}</span>{% if not loop.last %}<br>{% endif %}{% endfor %}</dd>
      </div>
    </dl>
    <ol class="steps">
      {% for step in instructions %}<li><span class="step-no">{{ loop.index }}</span>{{ step }}</li>{% endfor %}
    </ol>
    <p class="help">Questions? {{ retailer.returns_email }} · quote {{ rma.number }}</p>
  </section>
</div>

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": {
    "retailer": {
      "name": "Fellside Outfitters",
      "website": "fellside.example.com",
      "returns_email": "returns@fellside.example.com"
    },
    "returns_centre": {
      "name": "Fellside Outfitters Returns",
      "address_lines": [
        "Unit 12, Beckside Distribution Park",
        "Heronbrook Way"
      ],
      "town": "Kendal",
      "postcode": "LA9 6XY",
      "country": "United Kingdom"
    },
    "customer": {
      "name": "Oluwaseun Pryce",
      "address_lines": [
        "5 Thistle Row"
      ],
      "town": "Stirling",
      "postcode": "FK8 2XY"
    },
    "rma": {
      "number": "RMA-FSO-083145",
      "order_number": "FSO-2026-557102",
      "created_on": "2026-09-16",
      "return_window_days": 14,
      "service": "Prepaid tracked return",
      "reason": "Wrong size: too small",
      "resolution": "Exchange for size L",
      "parcel_weight_kg": 0.9,
      "locale": "en-GB"
    },
    "items": [
      {
        "sku": "FSO-TSJ-M-SLT",
        "name": "Trail shell jacket, men'\''s, M, slate",
        "quantity": 1
      }
    ],
    "instructions": [
      "Pack the item unworn, with its tags attached.",
      "Cut along the dashed line and keep this lower part."
    ]
  },
  "output": {
    "format": "pdf",
    "filename": "shipping-label-return-a6.pdf"
  }
}'