Invoice Templates
Customize invoice appearance and branding.
Overview
Invoice templates control how your invoices look:
- 🎨 Custom branding - Logo, colors, fonts
- 📝 Custom fields - Add business-specific information
- 🌍 Localization - Multi-language support
- 📄 PDF styling - Professional document layout
- ✉️ Email templates - Branded email notifications
Get Template
Endpoint
GET /api/v1/invoices/templates/:templateId
curl https://dev.auxcore.net/api/v1/invoices/templates/template_123 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-ID: your-tenant-id"
Response:
{
"success": true,
"data": {
"templateId": "template_123",
"name": "Default Template",
"branding": {
"logoUrl": "https://cdn.example.com/logo.png",
"primaryColor": "#007bff",
"accentColor": "#28a745"
},
"customFields": [
{
"name": "taxId",
"label": "Tax ID",
"required": true
}
],
"footer": "Thank you for your business!"
}
}
Update Template
Endpoint
PUT /api/v1/invoices/templates/:templateId
curl -X PUT https://dev.auxcore.net/api/v1/invoices/templates/template_123 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-ID: your-tenant-id" \
-H "Content-Type: application/json" \
-d '{
"branding": {
"logoUrl": "https://cdn.example.com/new-logo.png",
"primaryColor": "#ff6600",
"accentColor": "#00cc66"
},
"footer": "Questions? Contact support@example.com"
}'
Branding Options
Logo
{
"branding": {
"logoUrl": "https://cdn.example.com/logo.png",
"logoWidth": 200,
"logoHeight": 80
}
}
Colors
{
"branding": {
"primaryColor": "#007bff",
"accentColor": "#28a745",
"textColor": "#333333",
"backgroundColor": "#ffffff"
}
}
Typography
{
"typography": {
"fontFamily": "Helvetica",
"headerSize": 24,
"bodySize": 14
}
}
Custom Fields
Add business-specific fields:
{
"customFields": [
{
"name": "taxId",
"label": "Tax ID",
"type": "text",
"required": true
},
{
"name": "purchaseOrder",
"label": "PO Number",
"type": "text",
"required": false
},
{
"name": "department",
"label": "Department",
"type": "select",
"options": ["Sales", "Marketing", "Engineering"]
}
]
}
Localization
Multi-Language Support
{
"locale": "es",
"translations": {
"invoice": "Factura",
"dueDate": "Fecha de vencimiento",
"amount": "Cantidad",
"total": "Total"
}
}
Currency Formatting
{
"currency": "EUR",
"currencyFormat": {
"symbol": "€",
"position": "after",
"decimalSeparator": ",",
"thousandsSeparator": "."
}
}
Email Template
Customize invoice email notifications:
<!DOCTYPE html>
<html>
<head>
<style>
.invoice-email {
font-family: {{fontFamily}};
color: {{textColor}};
}
.header {
background: {{primaryColor}};
padding: 20px;
text-align: center;
}
</style>
</head>
<body>
<div class="invoice-email">
<div class="header">
<img src="{{logoUrl}}" alt="Logo" />
<h1>New Invoice from {{merchantName}}</h1>
</div>
<div class="content">
<p>Hello {{customerName}},</p>
<p>You have a new invoice for ${{amount}}.</p>
<p>Due date: {{dueDate}}</p>
<a href="{{invoiceUrl}}">View Invoice</a>
</div>
</div>
</body>
</html>
PDF Layout
Customize PDF appearance:
{
"pdfLayout": {
"pageSize": "A4",
"orientation": "portrait",
"margins": {
"top": 20,
"right": 20,
"bottom": 20,
"left": 20
},
"header": {
"enabled": true,
"height": 80
},
"footer": {
"enabled": true,
"height": 40,
"content": "Page {{pageNumber}} of {{totalPages}}"
}
}
}
Template Variables
Available variables for templates:
| Variable | Description |
|---|---|
{{merchantName}} |
Your business name |
{{merchantAddress}} |
Business address |
{{merchantPhone}} |
Business phone |
{{merchantEmail}} |
Business email |
{{invoiceNumber}} |
Invoice number |
{{invoiceDate}} |
Invoice date |
{{dueDate}} |
Payment due date |
{{customerName}} |
Customer name |
{{customerEmail}} |
Customer email |
{{amount}} |
Invoice amount |
{{currency}} |
Currency code |
{{items}} |
Line items array |
{{subtotal}} |
Subtotal |
{{tax}} |
Tax amount |
{{total}} |
Total amount |
{{paymentUrl}} |
Payment link |
Example Templates
Professional Services
{
"name": "Professional Services",
"branding": {
"logoUrl": "https://cdn.example.com/logo.png",
"primaryColor": "#2c3e50",
"accentColor": "#3498db"
},
"customFields": [
{
"name": "projectName",
"label": "Project",
"required": true
},
{
"name": "hoursWorked",
"label": "Hours",
"type": "number"
}
],
"footer": "Payment terms: Net 30"
}
E-Commerce
{
"name": "E-Commerce",
"branding": {
"logoUrl": "https://cdn.example.com/store-logo.png",
"primaryColor": "#ff6600",
"accentColor": "#00cc66"
},
"customFields": [
{
"name": "orderNumber",
"label": "Order #",
"required": true
},
{
"name": "trackingNumber",
"label": "Tracking #"
}
],
"footer": "Return policy: 30 days"
}
Best Practices
✅ DO:
- Use high-res logo - 300 DPI minimum for PDF
- Brand consistently - Match your website colors
- Test all devices - Mobile, tablet, desktop
- Include contact info - Make it easy to reach you
- Localize properly - Respect customer language/culture
- Keep it professional - Clean, readable design
❌ DON'T:
- Don't overdesign - Simple is better
- Don't use tiny fonts - 12pt minimum for body text
- Don't forget accessibility - High contrast colors
- Don't skip testing - Test PDF generation
- Don't hardcode values - Use template variables
Next Steps
Need help? Contact support@auxvault.com