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.
100
invoices/month
10 req/min
1,000
invoices/month
50 req/min
2,500
invoices/month
75 req/min
5,000
invoices/month
100 req/min
25,000
invoices/month
200 req/min
X-RateLimit-Limit: 50
X-RateLimit-Remaining: 49
X-RateLimit-Reset: 1705312800
X-Monthly-Usage: 45
X-Monthly-Limit: 1000/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": true
}
}
}/api/v1/themes{
"success": true,
"data": {
"themes": [
{
"name": "Classic",
"primaryColor": "#1e293b",
"primaryColorDark": "#0f172a",
"accentColor": "#14b8a6",
"textColor": "#334155",
"secondaryTextColor": "#64748b",
"borderColor": "#e2e8f0",
"backgroundColor": "#ffffff",
"headerTextColor": "#ffffff",
"description": "Traditional professional design with slate and teal accents"
},
// ... more themes
],
"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": "USD", "name": "US Dollar", "fullFormat": "USD (US Dollar)" },
{ "code": "EUR", "symbol": "EUR", "name": "Euro", "fullFormat": "EUR (Euro)" },
{ "code": "GBP", "symbol": "GBP", "name": "British Pound", "fullFormat": "GBP (British Pound)" },
{ "code": "JPY", "symbol": "JPY", "name": "Japanese Yen", "fullFormat": "JPY (Japanese Yen)" },
// ... 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"
},
"invoicesGenerated": 127,
"invoicesLimit": 500,
"invoicesRemaining": 373,
"requestsToday": 1450,
"rateLimitPerMinute": 30,
"tier": "api_growth",
"stats": {
"totalRequests": 1450,
"successfulRequests": 1445,
"failedRequests": 5,
"avgResponseTime": 245,
"requestsByEndpoint": {
"/api/v1/invoices/generate": 127,
"/api/v1/invoices/preview": 450,
"/api/v1/usage": 10
}
}
}
}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.