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.pdf

Endpoint Reference

POST/api/invoice/generate

Content-Type: application/json

Request Body

ParameterTypeRequiredDescription
fromstringRequiredSender / business name and address (use \n for line breaks)
itemsarrayRequiredArray of line items. Each item needs: id (string), item (string), qty (number), rate (number)
billTostringOptionalClient name and billing address
shipTostringOptionalShipping address if different from billing
invoiceNumberstringOptionalInvoice reference number (e.g., INV-001)
datestringOptionalInvoice date (e.g., 2026-03-28)
dueDatestringOptionalPayment due date
taxstringOptionalTax percentage (e.g., "10" for 10%)
currencystringOptionalCurrency symbol (default: "$")
discountstringOptionalDiscount amount to subtract from subtotal
shippingstringOptionalShipping cost to add to total
amountPaidstringOptionalAmount already paid (subtracted from balance due)
notesstringOptionalAdditional notes displayed on the invoice
termsstringOptionalPayment terms (e.g., Net 30)
poNumberstringOptionalPurchase order number
logostringOptionalURL to a logo image to include on the invoice
themeColorstringOptionalHex color for headings and accents (default: "#1E40AF")
labelsobjectOptionalOverride 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.pdf

Rate 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.