Skip to content
Preview of the Shipping label 4 × 6 in template

4 × 6 in

Shipping labels

Shipping label 4 × 6 in

A carrier-neutral 4 × 6 inch shipping label in high-contrast black and white for thermal printers. It has a large ship-to address, service level, weight, package count, a bold routing code, Code 128 barcodes for the tracking number and postal code, and a QR code with the shipment summary.

PDFCustom sizeLocale en-USHTML + Jinja

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

Template language features

  • Loops
  • Conditionals
  • Macros
  • Filters
  • Barcode
  • QR code
  • Date formatting
  • Number formatting

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

Variables

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

PathTypeExample
shipmentobject
shipment.tracking_numberstring"ND48273019665502"
shipment.service_levelstring"Ground"
shipment.service_codestring"GND"
shipment.transitstring"3–5 business days"
shipment.ship_datedate"2026-09-17"
shipment.weight_lbnumber12.4
shipment.dimensions_inobject
shipment.dimensions_in.lengthnumber14
shipment.dimensions_in.widthnumber10
shipment.dimensions_in.heightnumber8
shipment.package_numbernumber2
shipment.package_countnumber3
shipment.routing_codestring"AZ 860 9-07"
shipment.hubstring"PHX-3"
shipment.referencestring"SO-58213"
shipment.po_numberstring"7730-114"
shipment.billingstring"Prepaid"
shipment.signature_requiredbooleantrue
shipment.localestring"en-US"
senderobject
sender.namestring"Driftwood Supply Co."
sender.attentionstring"Shipping Dept."
sender.address_linesarray<string> · 1"480 Harbor Industrial Way, Unit C"
sender.citystring"Portland"
sender.statestring"OR"
sender.postal_codestring"97217"
sender.phonestring"+1 202-555-0119"
recipientobject
recipient.namestring"Rosalind Achebe-Morrow"
recipient.companystring"Tamarack Ceramics Studio"
recipient.address_linesarray<string> · 2"2215 W Juniper Ave"
recipient.citystring"Flagstaff"
recipient.statestring"AZ"
recipient.postal_codestring"86001"
recipient.countrystring"United States"
recipient.phonestring"+1 202-555-0182"

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": {
    "shipment": {
      "tracking_number": "ND48273019665502",
      "service_level": "Ground",
      "service_code": "GND",
      "transit": "3–5 business days",
      "ship_date": "2026-09-17",
      "weight_lb": 12.4,
      "dimensions_in": {
        "length": 14,
        "width": 10,
        "height": 8
      },
      "package_number": 2,
      "package_count": 3,
      "routing_code": "AZ 860 9-07",
      "hub": "PHX-3",
      "reference": "SO-58213",
      "po_number": "7730-114",
      "billing": "Prepaid",
      "signature_required": true,
      "locale": "en-US"
    },
    "sender": {
      "name": "Driftwood Supply Co.",
      "attention": "Shipping Dept.",
      "address_lines": [
        "480 Harbor Industrial Way, Unit C"
      ],
      "city": "Portland",
      "state": "OR",
      "postal_code": "97217",
      "phone": "+1 202-555-0119"
    },
    "recipient": {
      "name": "Rosalind Achebe-Morrow",
      "company": "Tamarack Ceramics Studio",
      "address_lines": [
        "2215 W Juniper Ave",
        "Suite 110"
      ],
      "city": "Flagstaff",
      "state": "AZ",
      "postal_code": "86001",
      "country": "United States",
      "phone": "+1 202-555-0182"
    }
  },
  "output": {
    "format": "pdf",
    "filename": "shipping-label-4x6.pdf"
  }
}'