
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.
PDFA6 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.
| Path | Type | Example |
|---|---|---|
| retailer | object | |
| retailer.name | string | "Fellside Outfitters" |
| retailer.website | string | "fellside.example.com" |
| retailer.returns_email | string | "returns@fellside.example.com" |
| returns_centre | object | |
| returns_centre.name | string | "Fellside Outfitters Returns" |
| returns_centre.address_lines | array<string> · 2 | "Unit 12, Beckside Distribution Park" |
| returns_centre.town | string | "Kendal" |
| returns_centre.postcode | string | "LA9 6XY" |
| returns_centre.country | string | "United Kingdom" |
| customer | object | |
| customer.name | string | "Oluwaseun Pryce" |
| customer.address_lines | array<string> · 1 | "5 Thistle Row" |
| customer.town | string | "Stirling" |
| customer.postcode | string | "FK8 2XY" |
| rma | object | |
| rma.number | string | "RMA-FSO-083145" |
| rma.order_number | string | "FSO-2026-557102" |
| rma.created_on | date | "2026-09-16" |
| rma.return_window_days | number | 14 |
| rma.service | string | "Prepaid tracked return" |
| rma.reason | string | "Wrong size: too small" |
| rma.resolution | string | "Exchange for size L" |
| rma.parcel_weight_kg | number | 0.9 |
| rma.locale | string | "en-GB" |
| items | array<object> · 1 | |
| items[].sku | string | "FSO-TSJ-M-SLT" |
| items[].name | string | "Trail shell jacket, men's, M, slate" |
| items[].quantity | number | 1 |
| instructions | array<string> · 4 | "Pack the item unworn, with its tags attached." |
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"
}
}'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": {
"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"
}
}),
});
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": {
"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",
},
},
timeout=90,
)
response.raise_for_status()
print(response.json())