Invoice Generator API — Free API for PDF Invoice Generation
Generate professional PDF invoices programmatically. No sign-up required for the free tier.
Overview
The Invoice Generator API lets you create professionally formatted PDF invoices with a single HTTP request. Send your invoice data as JSON, and receive a ready-to-download PDF in response.
- Free tier: 100 invoices per month, no API key required
- Customizable: Theme colors, logos, payment instructions, and more
- Multi-currency: Supports any currency symbol ($, EUR, GBP, INR, etc.)
- Tax & discounts: Automatic tax calculation, discount, and shipping
- No dependencies: Works with any language or framework that can make HTTP requests
Quick Start
Generate your first invoice in seconds with cURL:
curl -X POST https://www.onlineinvoicemaker.com/api/invoice/generate \
-H "Content-Type: application/json" \
-d '{
"from": "Acme Corp\n123 Business St\nNew York, NY 10001",
"billTo": "Client Inc\n456 Client Ave\nSan Francisco, CA 94102",
"invoiceNumber": "INV-001",
"date": "2026-03-28",
"dueDate": "2026-04-28",
"items": [
{ "id": "1", "item": "Web Development", "qty": 10, "rate": 150 },
{ "id": "2", "item": "UI Design", "qty": 5, "rate": 120 }
],
"tax": "10",
"currency": "$",
"notes": "Thank you for your business!",
"terms": "Net 30"
}' --output invoice.pdfEndpoint Reference
POST/api/invoice/generate
Content-Type: application/json
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | Required | Sender / business name and address (use \n for line breaks) |
| items | array | Required | Array of line items. Each item needs: id (string), item (string), qty (number), rate (number) |
| billTo | string | Optional | Client name and billing address |
| shipTo | string | Optional | Shipping address if different from billing |
| invoiceNumber | string | Optional | Invoice reference number (e.g., INV-001) |
| date | string | Optional | Invoice date (e.g., 2026-03-28) |
| dueDate | string | Optional | Payment due date |
| tax | string | Optional | Tax percentage (e.g., "10" for 10%) |
| currency | string | Optional | Currency symbol (default: "$") |
| discount | string | Optional | Discount amount to subtract from subtotal |
| shipping | string | Optional | Shipping cost to add to total |
| amountPaid | string | Optional | Amount already paid (subtracted from balance due) |
| notes | string | Optional | Additional notes displayed on the invoice |
| terms | string | Optional | Payment terms (e.g., Net 30) |
| poNumber | string | Optional | Purchase order number |
| logo | string | Optional | URL to a logo image to include on the invoice |
| themeColor | string | Optional | Hex color for headings and accents (default: "#1E40AF") |
| labels | object | Optional | Override default labels (e.g., translate to another language). Keys: invoice, billTo, shipTo, date, dueDate, poNumber, notes, terms, subTotal, total, discount, shipping, paid, balanceDue, tax |
Response
200 OK — PDF Generated
- Content-Type: application/pdf
- Content-Disposition: attachment; filename="invoice-INV-001.pdf"
- X-RateLimit-Limit: 100
400 Bad Request — Invalid Input
{ "error": "Missing required field: \"from\" (sender/business information)" }500 Internal Server Error — Generation Failed
{ "error": "Failed to generate PDF. Please check your input data and try again." }Code Examples
Node.js (fetch)
const response = await fetch("https://www.onlineinvoicemaker.com/api/invoice/generate", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
from: "Acme Corp\n123 Business St\nNew York, NY 10001",
billTo: "Client Inc\n456 Client Ave\nSan Francisco, CA 94102",
invoiceNumber: "INV-001",
date: "2026-03-28",
dueDate: "2026-04-28",
items: [
{ id: "1", item: "Web Development", qty: 10, rate: 150 },
{ id: "2", item: "UI Design", qty: 5, rate: 120 },
],
tax: "10",
currency: "$",
notes: "Thank you for your business!",
terms: "Net 30",
}),
});
const pdf = await response.arrayBuffer();
fs.writeFileSync("invoice.pdf", Buffer.from(pdf));Python (requests)
import requests
response = requests.post(
"https://www.onlineinvoicemaker.com/api/invoice/generate",
json={
"from": "Acme Corp\n123 Business St\nNew York, NY 10001",
"billTo": "Client Inc\n456 Client Ave\nSan Francisco, CA 94102",
"invoiceNumber": "INV-001",
"date": "2026-03-28",
"dueDate": "2026-04-28",
"items": [
{"id": "1", "item": "Web Development", "qty": 10, "rate": 150},
{"id": "2", "item": "UI Design", "qty": 5, "rate": 120},
],
"tax": "10",
"currency": "$",
"notes": "Thank you for your business!",
"terms": "Net 30",
},
)
with open("invoice.pdf", "wb") as f:
f.write(response.content)cURL
curl -X POST https://www.onlineinvoicemaker.com/api/invoice/generate \
-H "Content-Type: application/json" \
-d '{
"from": "Acme Corp\n123 Business St",
"billTo": "Client Inc\n456 Client Ave",
"invoiceNumber": "INV-001",
"date": "2026-03-28",
"dueDate": "2026-04-28",
"items": [
{"id": "1", "item": "Web Development", "qty": 10, "rate": 150}
],
"tax": "10",
"currency": "$"
}' --output invoice.pdfRate Limits
100
invoices/month
Free Tier
No API key required. Rate limit tracked via IP address.
The following headers are included in every response:
- X-RateLimit-Limit: 100 (maximum requests per month)
Need higher limits? Contact us for custom enterprise plans.
Use Cases
SaaS Billing
Automatically generate and email invoices to your SaaS customers at the end of each billing cycle.
E-commerce Orders
Create downloadable PDF invoices for each order in your online store, attached to confirmation emails.
ERP Integration
Connect your enterprise resource planning system to generate standardized invoices from existing data.
Automated Invoicing
Set up cron jobs or webhooks to generate recurring invoices for retainer clients and subscription services.
Ready to get started?
Try the API now — no sign-up required. Or create invoices visually with our free tool.