rustedf.cloud
Menu

Free purchase order template: HTML and PDF you can copy

Published 2 min read

Free purchase order template as a PDF: buyer, supplier, ship-to address, payment terms, an items table with totals and an approval line

Free template

Use this template for free

Create a free account, make a new template in the Code mode and paste the HTML below. Then send your own data from the API.

Download the HTMLDownload the sample data

A purchase order is how a business asks a supplier for goods and fixes what was agreed: what, how many, at what price, where and when. This one is a clean, neutral layout in HTML and CSS, with the buyer, the supplier, the delivery address, the payment terms, a table of items with the totals and a line for the approval. Below you can download the sample PDF, copy the code and see the data it takes.

What is in the template

  • The buyer’s company block with name, address and tax number, and the title and number of the order.
  • Three blocks: the supplier, the ship to address, and the order and delivery dates.
  • A bar with the payment terms, the shipping method and the buyer who placed the order.
  • A table of items with a code, a description, a quantity, a unit price and an amount. It grows with your data, and its header row repeats if the table runs onto another page.
  • Subtotal, shipping, tax and total, with the currency formatted for the locale.
  • A notes paragraph, and two lines for who approved the order and the date.

How to use it

In the portal. Create a free account, click New template, switch to the Code mode and paste the HTML below. You get a live preview.

From the API. Download the HTML and the sample data and send both in one request. This example uses jq to put the files in the body:

Terminal window
curl -X POST https://api.rustedf.com/v1/render \
-H "Authorization: Bearer $RUSTEDF_KEY" \
-H "Content-Type: application/json" \
-d "$(jq -n --rawfile html purchase-order.html --slurpfile data purchase-order-data-en.json \
'{html: $html, data: $data[0], locale: $data[0].locale}')" \
-o purchase-order.pdf

Once you like the result, save the HTML as a template and call it by its id from your code.

Make it yours

  • Look. The only color is a deep teal, #0f5f66, used for the title, the rules and the labels, with grays for the rest. Change that one value in the CSS and the document follows.
  • Amounts. Send them as strings, such as "480.00". Work the subtotal, the shipping, the tax and the total out in your own system and send the results.
  • Codes and notes. The item code, the payment terms, the shipping method and the notes are free text, so use whatever your purchasing process needs.
  • Logo. Add your logo as <img src="asset:<id>" width="120"> after uploading a PNG or JPEG once.
  • Fonts. The template names PT Sans, and any Google Fonts family works by name; there is nothing to link.
  • Language. Every label comes from the t object of the data, so the same template issues documents in any language you can write.

A note on what an order is

A purchase order is a commercial document between two companies. What it binds, and what the law of your country asks of it, depend on your contract and your country. Check what applies before you rely on it.

See Templates and Locales and formatting.

The template code

<!doctype html>
<html>
  <head>
    <meta charset="utf-8" />
    <style>
      @page { size: A4; margin: 18mm; }
      body { font-family: "PT Sans", sans-serif; font-size: 10pt; color: #1d2b2e; line-height: 1.45; }
      table { width: 100%; border-collapse: collapse; }
      td, th { vertical-align: top; }
      p { margin: 0; }
      .muted { color: #5d6b6e; }
      .right { text-align: right; }

      .name { font-size: 15pt; font-weight: bold; margin-bottom: 1.5mm; }
      .kind { font-size: 22pt; font-weight: bold; text-align: right; color: #0f5f66; text-transform: uppercase; letter-spacing: 1pt; }
      .ref { text-align: right; margin-top: 1.5mm; }
      .rule { border-top: 3px solid #0f5f66; margin: 5mm 0 5mm 0; }

      .label { font-size: 8pt; font-weight: bold; letter-spacing: 1.2pt; text-transform: uppercase; color: #0f5f66; margin-bottom: 1.5mm; }
      .parties td { padding-right: 6mm; }
      .parties td.dates { width: 26%; padding-right: 0; }

      .terms { margin-top: 5mm; background: #f1f5f5; padding: 3mm 4mm; }
      .terms td { width: 33.3%; padding-right: 4mm; }

      .items { margin-top: 6mm; }
      .items th { background: #e3ecec; text-align: left; font-size: 8.5pt; text-transform: uppercase; letter-spacing: 0.8pt; padding: 2.4mm 2.5mm; border-bottom: 2px solid #0f5f66; }
      .items th.right { text-align: right; }
      .items td { padding: 2.2mm 2.5mm; border-bottom: 1px solid #d3dcdd; }
      .items small { display: block; color: #5d6b6e; font-size: 8.5pt; }

      .totals { width: 50%; margin-left: 50%; margin-top: 5mm; }
      .totals td { padding: 1.8mm 2.5mm; }
      .grand td { border-top: 2px solid #0f5f66; font-size: 12pt; font-weight: bold; padding-top: 3mm; }

      .notes { margin-top: 6mm; }
      .sign { margin-top: 12mm; }
      .sign td { width: 45%; padding-top: 2mm; border-top: 1px solid #1d2b2e; }
      .sign .gap { width: 10%; border-top: 0; }
    </style>
  </head>
  <body>
    <table>
      <tr>
        <td style="width: 55%">
          <p class="name">{{ company.name }}</p>
          <p class="muted">{{ company.line1 }}<br />{{ company.line2 }}<br />{{ company.tax }}</p>
        </td>
        <td>
          <p class="kind">{{ t.title }}</p>
          <p class="ref">{{ t.number }} {{ number }}</p>
        </td>
      </tr>
    </table>

    <div class="rule"></div>

    <table class="parties">
      <tr>
        <td>
          <p class="label">{{ t.supplier }}</p>
          <p><strong>{{ supplier.name }}</strong><br />{{ supplier.line1 }}<br />{{ supplier.line2 }}</p>
        </td>
        <td>
          <p class="label">{{ t.ship_to }}</p>
          <p><strong>{{ ship_to.name }}</strong><br />{{ ship_to.line1 }}<br />{{ ship_to.line2 }}</p>
        </td>
        <td class="dates">
          <p class="label">{{ t.issued }}</p>
          <p>{{ issued | date(style="long") }}</p>
          <p class="label" style="margin-top: 3mm">{{ t.delivery }}</p>
          <p>{{ delivery | date(style="long") }}</p>
        </td>
      </tr>
    </table>

    <div class="terms"><table>
      <tr>
        <td><p class="label">{{ t.payment_terms }}</p><p>{{ payment_terms }}</p></td>
        <td><p class="label">{{ t.shipping_method }}</p><p>{{ shipping_method }}</p></td>
        <td><p class="label">{{ t.buyer }}</p><p>{{ buyer }}</p></td>
      </tr>
    </table></div>

    <table class="items">
      <thead>
        <tr>
          <th style="width: 14%">{{ t.code }}</th>
          <th style="width: 40%">{{ t.description }}</th>
          <th class="right" style="width: 10%">{{ t.qty }}</th>
          <th class="right" style="width: 18%">{{ t.unit }}</th>
          <th class="right" style="width: 18%">{{ t.amount }}</th>
        </tr>
      </thead>
      <tbody>
        {% for item in items %}
        <tr>
          <td class="muted">{{ item.code }}</td>
          <td>{{ item.name }}<small>{{ item.detail }}</small></td>
          <td class="right">{{ item.qty | number }}</td>
          <td class="right">{{ item.unit | currency(code=currency) }}</td>
          <td class="right">{{ item.amount | currency(code=currency) }}</td>
        </tr>
        {% endfor %}
      </tbody>
    </table>

    <table class="totals">
      <tr>
        <td class="muted">{{ t.subtotal }}</td>
        <td class="right">{{ subtotal | currency(code=currency) }}</td>
      </tr>
      <tr>
        <td class="muted">{{ t.shipping }}</td>
        <td class="right">{{ shipping | currency(code=currency) }}</td>
      </tr>
      <tr>
        <td class="muted">{{ t.tax }} ({{ tax_rate | number(digits=0) }}%)</td>
        <td class="right">{{ tax | currency(code=currency) }}</td>
      </tr>
      <tr class="grand">
        <td>{{ t.total }}</td>
        <td class="right">{{ total | currency(code=currency) }}</td>
      </tr>
    </table>

    <div class="notes">
      <p class="label">{{ t.notes }}</p>
      <p class="muted">{{ notes }}</p>
    </div>

    <table class="sign">
      <tr>
        <td>{{ t.approved_by }}</td>
        <td class="gap"></td>
        <td>{{ t.date }}</td>
      </tr>
    </table>
  </body>
</html>

The sample data

{
  "locale": "en-US",
  "currency": "USD",
  "number": "PO-2025-0316",
  "issued": "2025-03-14",
  "delivery": "2025-03-28",
  "tax_rate": 8,
  "company": {
    "name": "Northwind Traders Inc.",
    "line1": "1500 Congress Avenue, Suite 82",
    "line2": "Austin, TX 78701",
    "tax": "EIN 98-7654321"
  },
  "supplier": {
    "name": "Aurora Supplies Inc.",
    "line1": "482 Acacia Street",
    "line2": "Austin, TX 78702"
  },
  "ship_to": {
    "name": "Northwind Traders, warehouse",
    "line1": "9100 Industrial Boulevard",
    "line2": "Austin, TX 78744"
  },
  "payment_terms": "Net 30 days",
  "shipping_method": "Delivery by the supplier",
  "buyer": "Daniel Reyes",
  "items": [
    {
      "code": "PA-080",
      "name": "A4 paper, 80 g",
      "detail": "Box of 5 reams",
      "qty": 20,
      "unit": "24.00",
      "amount": "480.00"
    },
    {
      "code": "TN-110",
      "name": "Black toner cartridge",
      "detail": "High yield",
      "qty": 6,
      "unit": "68.00",
      "amount": "408.00"
    },
    {
      "code": "LB-150",
      "name": "Adhesive labels 100 x 150 mm",
      "detail": "Roll of 500",
      "qty": 12,
      "unit": "14.50",
      "amount": "174.00"
    },
    {
      "code": "PT-036",
      "name": "Packing tape",
      "detail": "Pack of 36 rolls",
      "qty": 4,
      "unit": "31.00",
      "amount": "124.00"
    }
  ],
  "subtotal": "1186.00",
  "shipping": "45.00",
  "tax": "94.88",
  "total": "1325.88",
  "notes": "Please confirm the order and the delivery date by email. Deliveries are accepted from 8 AM to 4 PM on weekdays.",
  "t": {
    "title": "Purchase order",
    "number": "No.",
    "supplier": "Supplier",
    "ship_to": "Ship to",
    "issued": "Order date",
    "delivery": "Delivery date",
    "payment_terms": "Payment terms",
    "shipping_method": "Shipping",
    "buyer": "Buyer",
    "code": "Code",
    "description": "Description",
    "qty": "Qty",
    "unit": "Unit price",
    "amount": "Amount",
    "subtotal": "Subtotal",
    "shipping": "Shipping",
    "tax": "Sales tax",
    "total": "Total",
    "notes": "Notes",
    "approved_by": "Approved by",
    "date": "Date"
  }
}

← All posts