Automate invoice creation in your app with a PDF invoice API. Generate professional invoices with line items, tax, logos. Python & JavaScript examples.
Manual invoice creation is one of the most common time sinks for freelancers, SaaS businesses, and e-commerce platforms. An invoice API eliminates the tedious parts:
The workflow is simple:
No template design needed. No PDF libraries to manage. No font or layout issues to debug.
curl -X POST "https://api.commandsector.in/api/invoice/generate?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"invoice_number": "INV-2026-001",
"from": {
"name": "Acme Corp",
"address": "123 Main St, San Francisco, CA"
},
"to": {
"name": "Client Inc",
"address": "456 Oak Ave, New York, NY"
},
"items": [
{"description": "Web Development", "quantity": 40, "unit_price": 150},
{"description": "UI Design", "quantity": 20, "unit_price": 125}
],
"tax_rate": 8.5,
"notes": "Payment due within 30 days"
}' --output invoice.pdf
import requests
invoice_data = {
"invoice_number": "INV-2026-001",
"from": {"name": "Acme Corp", "address": "123 Main St, SF, CA"},
"to": {"name": "Client Inc", "address": "456 Oak Ave, NY, NY"},
"items": [
{"description": "Web Development", "quantity": 40, "unit_price": 150},
{"description": "UI Design", "quantity": 20, "unit_price": 125},
],
"tax_rate": 8.5,
"currency": "USD",
"notes": "Payment due within 30 days"
}
response = requests.post(
"https://api.commandsector.in/api/invoice/generate",
params={"api_key": "YOUR_KEY"},
json=invoice_data
)
with open("invoice.pdf", "wb") as f:
f.write(response.content)
print("Invoice generated!")
const response = await fetch(
"https://api.commandsector.in/api/invoice/generate?api_key=YOUR_KEY",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
invoice_number: "INV-2026-001",
from: { name: "Acme Corp", address: "123 Main St" },
to: { name: "Client Inc", address: "456 Oak Ave" },
items: [
{ description: "Consulting", quantity: 10, unit_price: 200 }
],
tax_rate: 10
})
}
);
const blob = await response.blob();
// Save or serve the PDF
{
"logo_url": "https://yoursite.com/logo.png",
"from": {"name": "Your Company", "address": "..."},
"items": [...]
}
{
"currency": "EUR",
"discount": 10,
"discount_type": "percentage",
"items": [
{"description": "Annual License", "quantity": 1, "unit_price": 999}
]
}
Trigger invoice generation from Stripe webhooks on each successful payment. Automatically email the PDF to customers.
Track hours in a spreadsheet, then generate monthly invoices with a simple script. Include your logo and payment terms.
Generate invoices for each order. Include itemized products, shipping costs, and tax calculations automatically.
Professional PDF invoices via API. Free tier: 100 invoices/day. No credit card.
Get Free API KeyGet your free API key and start making requests in minutes.
curl "http://147.224.212.116/api/..." \
-H "X-API-Key: YOUR_API_KEY"
Get a free API key with 100 requests/day. No credit card required.
Get Free API Key