PDF
business
A4
Standard Invoice
Professional line-item invoice with company and client details, itemised table, subtotal, configurable tax rate, and total. Supports unlimited line items — the template uses page-break-inside: avoid on each row and repeats the table header on new pages automatically.
Use Cases
- Freelance invoicing
- Small business billing
- SaaS automated invoice generation
- API-driven invoice workflows
Tags
invoice
billing
payment
business
accounting
finance
line-items
tax
Template Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| company_name | string | Acme Corp | Your company name |
| company_address | string | 123 Business St, City, Country | Your company address |
| company_email | string | [email protected] | Your billing contact email |
| company_logo_url | url | Company logo URL (leave blank to omit) | |
| client_name | string | Client Name | Client or customer name |
| client_address | string | Client Address | Client billing address |
| invoice_number | string | INV-0001 | Invoice reference number |
| invoice_date | string | 2026-05-07 | Invoice issue date |
| due_date | string | 2026-06-07 | Payment due date |
| currency_symbol | string | $ | Currency symbol (e.g. $, £, €) |
| tax_rate | number | 20 | Tax percentage as a number (e.g. 20 for 20%). Set to 0 to hide the tax row. |
| notes | string | Thank you for your business. | Footer notes or payment instructions |
| accent_color | color | #4f46e5 | Heading and border accent colour |
| items | array | — | Array of line items. Each item: {name: string, qty: number, unit_price: number} |
API Example
POST to
https://pdf.toolkitapi.io/v1/pdf/from-template
with your template URL and variable values.
curl -X POST "https://pdf.toolkitapi.io/v1/pdf/from-template" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"template_url": "https://toolkitapi.io/static/templates/pdf/invoice.html", "variables": {"company_name": "Acme Corp", "company_address": "123 Business St, City, Country", "company_email": "[email protected]", "company_logo_url": "", "client_name": "Client Name", "client_address": "Client Address", "invoice_number": "INV-0001", "invoice_date": "2026-05-07", "due_date": "2026-06-07", "currency_symbol": "$", "tax_rate": "20", "notes": "Thank you for your business.", "accent_color": "#4f46e5"}, "page_size": "A4"}'
import httpx, base64
resp = httpx.post(
"https://pdf.toolkitapi.io/v1/pdf/from-template",
headers={"X-API-Key": "YOUR_API_KEY"},
json={
"template_url": "https://toolkitapi.io/static/templates/pdf/invoice.html",
"variables": {
"company_name": "Acme Corp",
"company_address": "123 Business St, City, Country",
"company_email": "[email protected]",
"company_logo_url": "",
"client_name": "Client Name",
"client_address": "Client Address",
"invoice_number": "INV-0001",
"invoice_date": "2026-05-07",
"due_date": "2026-06-07",
"currency_symbol": "$",
"tax_rate": "20",
"notes": "Thank you for your business.",
"accent_color": "#4f46e5"
},
"page_size": "A4"
},
)
pdf_bytes = base64.b64decode(resp.json()["pdf"])
with open("result.pdf", "wb") as f:
f.write(pdf_bytes)
const response = await fetch("https://pdf.toolkitapi.io/v1/pdf/from-template", {
method: "POST",
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"template_url": "https://toolkitapi.io/static/templates/pdf/invoice.html",
"variables": {
"company_name": "Acme Corp",
"company_address": "123 Business St, City, Country",
"company_email": "[email protected]",
"company_logo_url": "",
"client_name": "Client Name",
"client_address": "Client Address",
"invoice_number": "INV-0001",
"invoice_date": "2026-05-07",
"due_date": "2026-06-07",
"currency_symbol": "$",
"tax_rate": "20",
"notes": "Thank you for your business.",
"accent_color": "#4f46e5"
},
"page_size": "A4"
}),
});
const data = await response.json();
// data.pdf is a base64-encoded PDF
$body = @{
template_url = "https://toolkitapi.io/static/templates/pdf/invoice.html"
variables = {
"company_name": "Acme Corp",
"company_address": "123 Business St, City, Country",
"company_email": "[email protected]",
"company_logo_url": "",
"client_name": "Client Name",
"client_address": "Client Address",
"invoice_number": "INV-0001",
"invoice_date": "2026-05-07",
"due_date": "2026-06-07",
"currency_symbol": "$",
"tax_rate": "20",
"notes": "Thank you for your business.",
"accent_color": "#4f46e5"
}
page_size = "A4"
} | ConvertTo-Json -Depth 5
Invoke-RestMethod -Method POST `
-Uri "https://pdf.toolkitapi.io/v1/pdf/from-template" `
-Headers @{"X-API-Key" = "YOUR_API_KEY"} `
-ContentType "application/json" `
-Body $body