Finance

Commercial & proforma invoice generator

An export invoice with exporter, consignee, HS codes, Incoterms and ports — switch to proforma with one flag.

Customs and freight forwarders need a commercial invoice with every international shipment. This template includes the exporter and consignee, origin and destination, Incoterms, ports, carrier, goods with HS codes and values, freight, insurance and a signed declaration.

Set proforma to true to issue the same document as a proforma invoice before shipping — handy for quotes, advance payments and import licences.

Generate a Commercial / Proforma Invoice 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 commercial / proforma invoice per record.

curl -X POST https://pdfgen.com/api/v1/generate \
-H "Authorization: Bearer pdfg_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"data": {
"proforma": false,
"invoiceNumber": "CI-2026-0318",
"date": "2026-10-15",
"exporter": {
"name": "Saffron Textiles Pvt. Ltd.",
"address": "Plot 14, SIDCO Industrial Estate\nTiruppur, Tamil Nadu 641604, India",
"taxId": "IEC 0512345678"
},
"consignee": {
"name": "Harbor Home Goods Inc.",
"address": "Unit 5, 200 Pier Avenue\nLong Beach, CA 90802, USA",
"taxId": "EIN 12-3456789"
},
"originCountry": "India",
"destinationCountry": "United States",
"incoterms": "FOB Chennai",
"portOfLoading": "Chennai, India",
"portOfDischarge": "Long Beach, USA",
"carrier": "MSC Aurora / 214E",
"currency": "USD",
"items": [
{
"description": "Cotton bed sheet sets, queen",
"hsCode": "6302.31",
"quantity": 600,
"unit": "sets",
"unitValue": 8.5,
"total": 5100
},
{
"description": "Cotton bath towels",
"hsCode": "6302.60",
"quantity": 1200,
"unit": "pcs",
"unitValue": 3.2,
"total": 3840
},
{
"description": "Cushion covers, printed",
"hsCode": "6304.92",
"quantity": 800,
"unit": "pcs",
"unitValue": 2.75,
"total": 2200
}
],
"subtotal": 11140,
"freight": 850,
"insurance": 120,
"total": 12110,
"declaration": "We declare that this invoice shows the actual price of the goods described and that all particulars are true and correct.",
"signatory": {
"name": "R. Venkatesh",
"title": "Export Manager"
}
},
"format": "A4",
"engine": "handlebars",
"html": "<div style=\"max-width:780px;margin:0 auto;padding:44px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:#111827;font-size:13px;\">\n <div style=\"display:flex;justify-content:space-between;align-items:flex-start;border-bottom:2px solid #111827;padding-bottom:14px;margin-bottom:18px;\">\n <h1 style=\"font-size:24px;font-weight:800;letter-spacing:2px;margin:0;\">{{#if proforma}}PROFORMA INVOICE{{else}}COMMERCIAL INVOICE{{/if}}</h1>\n <div style=\"text-align:right;color:#6b7280;\"><p style=\"margin:0;\">No. <strong style=\"color:#111827;\">{{invoiceNumber}}</strong></p><p style=\"margin:2px 0 0;\">{{formatDate date}}</p></div>\n </div>\n <table style=\"width:100%;border-collapse:collapse;margin-bottom:16px;font-size:inherit;line-height:inherit;\">\n <tr>\n <td style=\"width:50%;vertical-align:top;padding:12px;border:1px solid #e5e7eb;\">\n <p style=\"font-size:11px;text-transform:uppercase;letter-spacing:1.5px;color:#9ca3af;font-weight:700;margin:0 0 8px;\">Exporter</p>\n <p style=\"margin:0;font-weight:700;\">{{exporter.name}}</p>\n <p style=\"margin:2px 0 0;color:#6b7280;white-space:pre-line;\">{{exporter.address}}</p>\n <p style=\"margin:4px 0 0;color:#6b7280;\">{{exporter.taxId}}</p>\n </td>\n <td style=\"width:50%;vertical-align:top;padding:12px;border:1px solid #e5e7eb;\">\n <p style=\"font-size:11px;text-transform:uppercase;letter-spacing:1.5px;color:#9ca3af;font-weight:700;margin:0 0 8px;\">Consignee</p>\n <p style=\"margin:0;font-weight:700;\">{{consignee.name}}</p>\n <p style=\"margin:2px 0 0;color:#6b7280;white-space:pre-line;\">{{consignee.address}}</p>\n <p style=\"margin:4px 0 0;color:#6b7280;\">{{consignee.taxId}}</p>\n </td>\n </tr>\n </table>\n <table style=\"width:100%;border-collapse:collapse;margin-bottom:18px;font-size:inherit;line-height:inherit;\">\n <tr>\n <td style=\"padding:8px 12px;border:1px solid #e5e7eb;\"><span style=\"color:#9ca3af;\">Origin</span><br><strong>{{originCountry}}</strong></td>\n <td style=\"padding:8px 12px;border:1px solid #e5e7eb;\"><span style=\"color:#9ca3af;\">Destination</span><br><strong>{{destinationCountry}}</strong></td>\n <td style=\"padding:8px 12px;border:1px solid #e5e7eb;\"><span style=\"color:#9ca3af;\">Incoterms</span><br><strong>{{incoterms}}</strong></td>\n </tr>\n <tr>\n <td style=\"padding:8px 12px;border:1px solid #e5e7eb;\"><span style=\"color:#9ca3af;\">Port of loading</span><br><strong>{{portOfLoading}}</strong></td>\n <td style=\"padding:8px 12px;border:1px solid #e5e7eb;\"><span style=\"color:#9ca3af;\">Port of discharge</span><br><strong>{{portOfDischarge}}</strong></td>\n <td style=\"padding:8px 12px;border:1px solid #e5e7eb;\"><span style=\"color:#9ca3af;\">Carrier / voyage</span><br><strong>{{carrier}}</strong></td>\n </tr>\n </table>\n <table style=\"width:100%;border-collapse:collapse;font-size:inherit;line-height:inherit;\">\n <thead>\n <tr style=\"background:#f3f4f6;text-align:left;\">\n <th style=\"padding:9px 10px;\">Description of goods</th>\n <th style=\"padding:9px 10px;\">HS code</th>\n <th style=\"padding:9px 10px;text-align:right;\">Qty</th>\n <th style=\"padding:9px 10px;text-align:right;\">Unit value</th>\n <th style=\"padding:9px 10px;text-align:right;\">Total</th>\n </tr>\n </thead>\n <tbody>\n {{#each items}}\n <tr>\n <td style=\"padding:9px 10px;border-bottom:1px solid #f3f4f6;\">{{description}}</td>\n <td style=\"padding:9px 10px;border-bottom:1px solid #f3f4f6;font-family:monospace;\">{{hsCode}}</td>\n <td style=\"padding:9px 10px;border-bottom:1px solid #f3f4f6;text-align:right;\">{{quantity}} {{unit}}</td>\n <td style=\"padding:9px 10px;border-bottom:1px solid #f3f4f6;text-align:right;\">{{formatCurrency unitValue ../currency}}</td>\n <td style=\"padding:9px 10px;border-bottom:1px solid #f3f4f6;text-align:right;\">{{formatCurrency total ../currency}}</td>\n </tr>\n {{/each}}\n </tbody>\n </table>\n <div style=\"display:flex;justify-content:space-between;align-items:flex-start;margin-top:18px;gap:24px;\">\n <p style=\"margin:0;max-width:380px;font-size:12px;color:#6b7280;line-height:1.6;\">{{declaration}}</p>\n <table style=\"min-width:250px;font-size:inherit;line-height:inherit;\">\n <tr><td style=\"padding:3px 0;color:#6b7280;\">Goods value</td><td style=\"padding:3px 0;text-align:right;\">{{formatCurrency subtotal currency}}</td></tr>\n <tr><td style=\"padding:3px 0;color:#6b7280;\">Freight</td><td style=\"padding:3px 0;text-align:right;\">{{formatCurrency freight currency}}</td></tr>\n <tr><td style=\"padding:3px 0;color:#6b7280;\">Insurance</td><td style=\"padding:3px 0;text-align:right;\">{{formatCurrency insurance currency}}</td></tr>\n <tr><td style=\"padding:10px 0 0;font-weight:800;font-size:15px;\">Total ({{currency}})</td><td style=\"padding:10px 0 0;text-align:right;font-weight:800;font-size:15px;\">{{formatCurrency total currency}}</td></tr>\n </table>\n </div>\n <div style=\"margin-top:40px;width:240px;border-top:1px solid #9ca3af;padding-top:6px;font-size:12px;\">\n <strong>{{signatory.name}}</strong><br><span style=\"color:#6b7280;\">{{signatory.title}}, {{exporter.name}}</span>\n </div>\n</div>"
}' --output commercial-invoice.pdf

Working in another language? Follow a full guide for your stack:

What you can build

  • Exporters preparing invoices for each shipment
  • Sending a proforma invoice to request advance payment
  • Freight and logistics platforms generating documents per booking
  • E-commerce sellers shipping cross-border parcels

Frequently asked questions

What is the difference between a proforma and a commercial invoice?
A proforma is a preliminary invoice sent before shipment, often for a quote or advance payment. The commercial invoice is the final document used for customs clearance. Here the same template switches with the proforma field.
Does it include HS codes and Incoterms?
Yes — each line has an HS code, and the shipment block shows the Incoterms, ports of loading and discharge, and the carrier.
Is it accepted by customs?
It contains the fields customs authorities usually expect, but requirements vary by country — check your destination’s rules or ask your freight forwarder.

Related templates

Ship your commercial / proforma invoice PDF endpoint today

Generate this template with AI, tweak it to match your brand, then render at scale with a single API call — no headless browsers to babysit.