PDF Invoice Generator

/api/invoice 2 credit(s) per call

Generate professional PDF invoices with line items, addresses, and custom styling.

Overview

The PDF Invoice Generator creates professional PDF invoices from structured JSON data. Include seller and customer addresses, line items with prices and quantities, custom dates, and comments.

Endpoint

POST /api/invoice

Request Body

Field Type Required Description
invoiceNumber string Yes Unique invoice number
issueDate string Yes Date the invoice was issued (ISO 8601)
dueDate string Yes Payment due date (ISO 8601)
seller object Yes Seller information (name, addressLines, email, phone)
customer object Yes Customer information (same fields as seller)
items array Yes Line items (each: name, price, quantity)
comments string No Optional comments or notes
status string No Invoice status (e.g. "paid", "pending", "overdue")
taxLabel string No Label for the tax line (e.g. "VAT", "GST")
taxRate decimal No Tax rate as a percentage (0–100, e.g. 20 for 20%)
logoUrl string No URL of the logo image (PNG, JPG, SVG) rendered in the header
accentColor string No Hex color for invoice heading and label (default: #3B82F6)
textColor string No Hex color for primary text (default: #1F2937)
mutedTextColor string No Hex color for secondary/muted text (default: #6B7280)
separatorColor string No Hex color for table row borders and address underlines (default: #E5E7EB)
commentsBackgroundColor string No Hex color for the comments box background (default: #F3F4F6)
currency string Yes ISO 4217 currency code (e.g. "USD", "EUR", "GBP")

Example

Generate a PDF invoice:

curl -X POST https://simplewebapis.com/api/invoice \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: swa_your_key" \
  -d '{
    "invoiceNumber": 1001,
    "seller": { "name": "Acme Corp", "addressLines": ["123 Seller St", "San Francisco, CA 94105"], "email": "[email protected]" },
    "customer": { "name": "Globex Inc", "addressLines": ["456 Customer Ave", "New York, NY 10001"], "email": "[email protected]" },
    "items": [
      { "name": "Web Development", "price": 1500.00, "quantity": 1 },
      { "name": "UI Design", "price": 800.00, "quantity": 2 }
    ],
    "comments": "Thank you for your business!",
    "currency": "USD",
    "logoUrl": "https://simplewebapis.com/favicon-32x32.png",
    "accentColor": "#2563EB",
    "separatorColor": "#E5E7EB",
    "commentsBackgroundColor": "#F9FAFB"
  }' --output invoice.pdf

The response is a PDF document (Content-Type: application/pdf).

Try it out

Use the Playground to test this API live.