Business
Purchase order PDF API
A standard purchase order with vendor, ship-to and line items — issued automatically from your procurement system.
Issue purchase orders straight from your procurement or ERP system. Pass the buyer, vendor, ship-to and line items, and PDFgen returns a standard PO PDF with the order total formatted in — no manual document assembly.
One reusable template covers every supplier, so you can automate PO creation across your whole purchasing workflow.
Generate a Purchase Order PDF via the API
POST your data to /api/v1/generate and get a PDF back. Copy-paste an example, swap in your API key, and loop over a list to render thousands — one purchase order per record.
curl -X POST https://pdfgen.com/api/v1/generate \-H "Authorization: Bearer pdfg_live_xxx" \-H "Content-Type: application/json" \-d '{"html": "<div style=\"max-width:760px;margin:0 auto;padding:48px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:#111827;\">\n <div style=\"display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:36px;\">\n <div>\n <h1 style=\"font-size:22px;font-weight:800;margin:0;\">{{buyer.name}}</h1>\n <p style=\"color:#6b7280;margin:6px 0 0;font-size:13px;white-space:pre-line;\">{{buyer.address}}</p>\n </div>\n <div style=\"text-align:right;\">\n <h2 style=\"font-size:24px;letter-spacing:2px;color:#b45309;margin:0;font-weight:800;\">PURCHASE ORDER</h2>\n <p style=\"margin:8px 0 0;color:#6b7280;font-size:13px;\">#{{poNumber}} · {{formatDate date}}</p>\n </div>\n </div>\n <div style=\"display:flex;justify-content:space-between;margin-bottom:28px;font-size:13px;\">\n <div>\n <p style=\"font-size:11px;text-transform:uppercase;letter-spacing:1px;color:#9ca3af;margin:0 0 6px;\">Vendor</p>\n <p style=\"margin:0;font-weight:600;\">{{vendor.name}}</p>\n <p style=\"margin:2px 0 0;color:#6b7280;white-space:pre-line;\">{{vendor.address}}</p>\n </div>\n <div style=\"text-align:right;\">\n <p style=\"font-size:11px;text-transform:uppercase;letter-spacing:1px;color:#9ca3af;margin:0 0 6px;\">Ship to</p>\n <p style=\"margin:0;font-weight:600;\">{{shipTo.name}}</p>\n <p style=\"margin:2px 0 0;color:#6b7280;white-space:pre-line;\">{{shipTo.address}}</p>\n </div>\n </div>\n <table style=\"width:100%;border-collapse:collapse;font-size:14px;\">\n <thead>\n <tr style=\"background:#fffbeb;text-align:left;\">\n <th style=\"padding:12px;border-bottom:1px solid #fef3c7;\">Item</th>\n <th style=\"padding:12px;border-bottom:1px solid #fef3c7;text-align:center;\">Qty</th>\n <th style=\"padding:12px;border-bottom:1px solid #fef3c7;text-align:right;\">Unit</th>\n <th style=\"padding:12px;border-bottom:1px solid #fef3c7;text-align:right;\">Total</th>\n </tr>\n </thead>\n <tbody>\n {{#each items}}\n <tr>\n <td style=\"padding:12px;border-bottom:1px solid #f3f4f6;\">{{name}}</td>\n <td style=\"padding:12px;border-bottom:1px solid #f3f4f6;text-align:center;\">{{quantity}}</td>\n <td style=\"padding:12px;border-bottom:1px solid #f3f4f6;text-align:right;\">{{formatCurrency unitPrice ../currency}}</td>\n <td style=\"padding:12px;border-bottom:1px solid #f3f4f6;text-align:right;\">{{formatCurrency lineTotal ../currency}}</td>\n </tr>\n {{/each}}\n </tbody>\n </table>\n <div style=\"display:flex;justify-content:flex-end;margin-top:20px;\">\n <div style=\"background:#b45309;color:#fff;padding:14px 24px;border-radius:8px;font-size:16px;font-weight:800;\">\n Order total: {{formatCurrency total currency}}\n </div>\n </div>\n</div>","engine": "handlebars","format": "A4","data": {"buyer": {"name": "Northwind Studio","address": "120 Market St\nSan Francisco, CA 94103"},"vendor": {"name": "Pacific Supply Co.","address": "500 Cannery Row\nMonterey, CA 93940"},"shipTo": {"name": "Northwind Warehouse","address": "9 Dock Ave\nOakland, CA 94607"},"poNumber": "PO-2026-0451","date": "2026-06-27","currency": "USD","items": [{"name": "Standing desk (electric)","quantity": 4,"unitPrice": 480,"lineTotal": 1920},{"name": "Ergonomic chair","quantity": 4,"unitPrice": 260,"lineTotal": 1040},{"name": "USB-C dock","quantity": 6,"unitPrice": 145,"lineTotal": 870}],"total": 3830}}' --output purchase-order.pdf
Working in another language? Follow a full guide for your stack:
What you can build
- Auto-issuing POs when a procurement request is approved
- Generating supplier-ready PDFs from an ERP or inventory app
- Standardising purchase orders across departments
- Archiving POs alongside invoices for reconciliation
Frequently asked questions
- Can I generate a PO directly from my ERP?
- Yes — make a single POST to /api/v1/generate with the order data from your system and store or email the returned PDF.
- Does it support separate vendor and ship-to addresses?
- Yes — the template has distinct vendor and ship-to blocks, plus a line-item table with quantity, unit price and line totals.
- Can I add PO terms or approval signatures?
- Edit the template to include payment terms, notes or a signature line, then every PO renders with them.