Generate professional PDF invoices programmatically. Full customization with themes, custom labels, logos, and 52 supported currencies.
https://invoicepig.com/api/v1All API requests require authentication via an API key. Include your key in the request headers.
x-api-key: ipig_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxOr use the Authorization header with Bearer token:
Authorization: Bearer ipig_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxGenerate your first invoice in seconds with this simple example.
curl -X POST https://invoicepig.com/api/v1/invoices/generate \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"companyName": "Acme Corporation",
"billTo": "John Doe\n123 Main Street\nNew York, NY 10001",
"invoiceNumber": "INV-2025-001",
"date": "2025-01-15",
"currency": "USD",
"theme": "Corporate",
"lineItems": [
{
"description": "Web Development Services",
"quantity": 40,
"rate": 150
},
{
"description": "UI/UX Design",
"quantity": 20,
"rate": 125
}
]
}' --output invoice.pdfAPI rate limits vary by subscription tier. Rate limit headers are included in all responses.
20
invoices/month
5 req/min
500
invoices/month
30 req/min
2,000
invoices/month
60 req/min
Unlimited
invoices/month
120 req/min
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
X-RateLimit-Reset: 1705312800
X-Monthly-Usage: 45
X-Monthly-Limit: 500/api/v1/invoices/generateRequires API Key/api/v1/invoices/previewRequires API Key{
"success": true,
"data": {
"valid": true,
"preview": {
"companyName": "Acme Corporation",
"invoiceNumber": "INV-2025-001",
"date": "2025-01-15",
"currency": "USD",
"currencySymbol": "$",
"theme": "Corporate",
"lineItemCount": 2,
"financial": {
"subtotal": 8500,
"discount": 850,
"tax": 650.25,
"shipping": 25,
"total": 8325.25,
"amountPaid": 1000,
"balanceDue": 7325.25
},
"hasWatermark": false
}
}
}/api/v1/themes{
"success": true,
"data": {
"themes": [
{
"name": "Classic",
"primaryColor": "#1e293b",
"accentColor": "#14b8a6",
"description": "Traditional professional design"
},
{
"name": "Corporate",
"primaryColor": "#2563eb",
"accentColor": "#3b82f6",
"description": "Modern business style"
},
{
"name": "Formal",
"primaryColor": "#2c3338",
"accentColor": "#8b7355",
"description": "Elegant official design"
},
{
"name": "Minimal",
"primaryColor": "#374151",
"accentColor": "#6b7280",
"description": "Clean simple design"
},
{
"name": "Creative",
"primaryColor": "#7c3aed",
"accentColor": "#8b5cf6",
"description": "Bold modern style"
},
{
"name": "Futuristic",
"primaryColor": "#0ea5e9",
"accentColor": "#06b6d4",
"description": "Tech-forward design"
},
{
"name": "Luxury",
"primaryColor": "#1e293b",
"accentColor": "#d4af37",
"description": "Premium high-end design"
}
],
"defaultTheme": "Classic"
}
}Instead of using a preset theme, you can provide custom colors:
{
"customTheme": {
"primaryColor": "#2563eb",
"primaryColorDark": "#1e40af",
"accentColor": "#3b82f6",
"textColor": "#1e2937",
"secondaryTextColor": "#64748b",
"borderColor": "#e0e7ff",
"backgroundColor": "#ffffff",
"headerTextColor": "#ffffff"
}
}/api/v1/currencies{
"success": true,
"data": {
"currencies": [
{ "code": "USD", "symbol": "$", "name": "US Dollar", "fullFormat": "USD ($)" },
{ "code": "EUR", "symbol": "€", "name": "Euro", "fullFormat": "EUR (€)" },
{ "code": "GBP", "symbol": "£", "name": "British Pound", "fullFormat": "GBP (£)" },
{ "code": "JPY", "symbol": "¥", "name": "Japanese Yen", "fullFormat": "JPY (¥)" },
// ... 48 more currencies
],
"defaultCurrency": "USD"
}
}/api/v1/labels/defaults{
"success": true,
"data": {
"labels": {
"invoice": "INVOICE",
"billTo": "Bill To",
"shipTo": "Ship To",
"invoiceNumber": "Invoice #",
"date": "Date",
"paymentTerms": "Payment Terms",
"dueDate": "Due Date",
"poNumber": "P.O. Number",
"item": "Item",
"hsCode": "HS Code",
"quantity": "Qty",
"rate": "Rate",
"amount": "Amount",
"subtotal": "Subtotal",
"discount": "Discount",
"tax": "Tax",
"shipping": "Shipping",
"total": "Total",
"amountPaid": "Amount Paid",
"balanceDue": "Balance Due",
"notes": "Notes",
"terms": "Terms & Conditions"
}
}
}Translate labels for different languages:
{
"labels": {
"invoice": "FACTURA",
"billTo": "Facturar A",
"date": "Fecha",
"dueDate": "Fecha de Vencimiento",
"total": "Total",
"balanceDue": "Saldo Pendiente"
}
}/api/v1/usageRequires API Key{
"success": true,
"data": {
"currentPeriod": {
"start": "2025-01-01T00:00:00Z",
"end": "2025-02-01T00:00:00Z"
},
"usage": {
"invoicesGenerated": 127,
"invoicesLimit": 500,
"invoicesRemaining": 373,
"percentUsed": 25.4
},
"rateLimit": {
"requestsPerMinute": 30,
"currentMinuteUsage": 3
},
"subscription": {
"tier": "Premium",
"status": "active"
}
}
}Complete reference of all available request fields.
API errors follow a consistent format with error codes.
| Code | HTTP Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid API key |
FORBIDDEN | 403 | API key doesn't have permission |
VALIDATION_ERROR | 400 | Invalid request data |
RATE_LIMIT_EXCEEDED | 429 | Too many requests |
MONTHLY_LIMIT_EXCEEDED | 429 | Monthly quota exceeded |
INTERNAL_ERROR | 500 | Server error |
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request data",
"details": [
{
"field": "lineItems[0].rate",
"message": "Rate must be a positive number"
},
{
"field": "date",
"message": "Invalid date format. Use YYYY-MM-DD"
}
]
}
}Create your API key and start generating professional invoices programmatically.