Home
cd ../playbooks
Finance & AccountingIntermediate

Invoice Template Designer

Generate professional PDF invoices from templates

10 minutes
By communitySource
#invoice#template#billing

Every invoice looks different because you start from scratch each time — different fonts, different layouts, tax in the wrong place. Your clients get professional invoices from everyone else and a glorified email from you.

Who it's for: freelancers wanting branded, consistent invoices, agencies creating invoice templates for multiple service types, small businesses upgrading from manual invoice creation, consultants who need different templates for different clients, anyone whose invoices don't look as professional as their work

Example

"Design a branded invoice template for my consulting business" → Reusable PDF template with your logo, branded colors, itemized line items, tax calculations, payment terms, and bank details — generate new invoices by just changing the client and line items

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

# Invoice Template

## Overview

This workflow generates professional PDF invoices from structured data and templates. Create invoices with company branding, itemized lists, tax calculations, and payment details.

## How to Use

1. Describe what you want to accomplish
2. Provide any required input data or files
3. I'll execute the appropriate operations

**Example prompts:**
- "Generate invoices from order data"
- "Create recurring invoices"
- "Batch generate monthly invoices"
- "Customize invoice templates per client"

## Domain Knowledge


### Invoice Data Structure

```python
invoice_data = {
    "invoice_number": "INV-2026-001",
    "date": "2026-01-30",
    "due_date": "2026-02-28",
    
    "from": {
        "name": "Your Company",
        "address": "123 Business St",
        "email": "billing@company.com"
    },
    
    "to": {
        "name": "Client Name",
        "address": "456 Client Ave",
        "email": "client@example.com"
    },
    
    "items": [
        {"description": "Consulting", "quantity": 10, "rate": 150.00},
        {"description": "Development", "quantity": 20, "rate": 100.00}
    ],
    
    "tax_rate": 0.08,
    "notes": "Payment due within 30 days"
}
```

### PDF Generation with ReportLab

```python
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch

def create_invoice(data: dict, output_path: str):
    c = canvas.Canvas(output_path, pagesize=letter)
    width, height = letter
    
    # Header
    c.setFont("Helvetica-Bold", 24)
    c.drawString(1*inch, height - 1*inch, "INVOICE")
    
    # Invoice details
    c.setFont("Helvetica", 12)
    c.drawString(1*inch, height - 1.5*inch, f"Invoice #: {data['invoice_number']}")
    c.drawString(1*inch, height - 1.75*inch, f"Date: {data['date']}")
    
    # From/To
    y = height - 2.5*inch
    c.drawString(1*inch, y, f"From: {data['from']['name']}")
    c.drawString(4*inch, y, f"To: {data['to']['name']}")
    
    # Items table
    y = height - 4*inch
    c.setFont("Helvetica-Bold", 10)
    c.drawString(1*inch, y, "Description")
    c.drawString(4*inch, y, "Qty")
    c.drawString(5*inch, y, "Rate")
    c.drawString(6*inch, y, "Amount")
    
    c.setFont("Helvetica", 10)
    subtotal = 0
    for item in data['items']:
        y -= 0.3*inch
        amount = item['quantity'] * item['rate']
        subtotal += amount
        c.drawString(1*inch, y, item['description'])
        c.drawString(4*inch, y, str(item['quantity']))
        c.drawString(5*inch, y, f"${item['rate']:.2f}")
        c.drawString(6*inch, y, f"${amount:.2f}")
    
    # Totals
    tax = subtotal * data['tax_rate']
    total = subtotal + tax
    
    y -= 0.5*inch
    c.drawString(5*inch, y, f"Subtotal: ${subtotal:.2f}")
    y -= 0.25*inch
    c.drawString(5*inch, y, f"Tax ({data['tax_rate']*100}%): ${tax:.2f}")
    y -= 0.25*inch
    c.setFont("Helvetica-Bold", 12)
    c.drawString(5*inch, y, f"Total: ${total:.2f}")
    
    c.save()
    return output_path
```

### HTML Template Approach

```python
from weasyprint import HTML
from jinja2 import Template

invoice_template = """
<!DOCTYPE html>
<html>
<head>
    <style>
        body { font-family: Arial; margin: 40px; }
        .header { display: flex; justify-content: space-between; }
        table { width: 100%; border-collapse: collapse; margin: 20px 0; }
        th, td { border: 1px solid #ddd; padding: 10px; text-align: left; }
        .total { font-weight: bold; font-size: 18px; }
    </style>
</head>
<body>
    <div class="header">
        <h1>INVOICE</h1>
        <div>
            <p>Invoice #: {{ invoice_number }}</p>
            <p>Date: {{ date }}</p>
        </div>
    </div>
    <table>
        <tr><th>Description</th><th>Qty</th><th>Rate</th><th>Amount</th></tr>
        {% for item in items %}
        <tr>
            <td>{{ item.description }}</td>
            <td>{{ item.quantity }}</td>
            <td>${{ "%.2f"|format(item.rate) }}</td>
            <td>${{ "%.2f"|format(item.quantity * item.rate) }}</td>
        </tr>
        {% endfor %}
    </table>
    <p class="total">Total: ${{ "%.2f"|format(total) }}</p>
</body>
</html>
"""

def create_invoice_html(data: dict, output_path: str):
    template = Template(invoice_template)
    
    # Calculate total
    total = sum(i['quantity'] * i['rate'] for i in data['items'])
    total *= (1 + data.get('tax_rate', 0))
    data['total'] = total
    
    html = template.render(**data)
    HTML(string=html).write_pdf(output_path)
    return output_path
```


## Best Practices

1. **Validate required fields before generation**
2. **Use templates for consistent branding**
3. **Auto-calculate totals (don't trust input)**
4. **Include payment instructions and terms**

## Installation

```bash
# Install required dependencies
pip install python-docx openpyxl python-pptx reportlab jinja2
```

## Resources

- [easy-invoice-pdf Repository](https://github.com/nickmitchko/easy-invoice-pdf)
- [Claude Code Hub](https://github.com/claude-code/workflows)

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

This workflow generates professional PDF invoices from structured data and templates. Create invoices with company branding, itemized lists, tax calculations, and payment details.


Quick Start

Step 1: Create a Project Folder

mkdir -p ~/Documents/InvoiceTemplate

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ~/Documents/InvoiceTemplate/

Step 3: Start Working

cd ~/Documents/InvoiceTemplate
claude

How to Use

  1. Describe what you want to accomplish
  2. Provide any required input data or files
  3. I'll execute the appropriate operations

Example prompts:

  • "Generate invoices from order data"
  • "Create recurring invoices"
  • "Batch generate monthly invoices"
  • "Customize invoice templates per client"

Best Practices

  1. Validate required fields before generation
  2. Use templates for consistent branding
  3. Auto-calculate totals (don't trust input)
  4. Include payment instructions and terms

Installation

# Install required dependencies
pip install python-docx openpyxl python-pptx reportlab jinja2

$Related Playbooks

Finance & Accounting

Minimalist Pricing

Set an initial price, pick cost-based vs. value-based, and plan your tier structure — anchored by the rule that free kills more businesses than high prices do.

5 minutes
Beginner
Finance & Accounting

QuickBooks Automation

Automate QuickBooks accounting workflows including invoicing, expenses, reporting, and bank reconciliation

10 minutes
Advanced
Finance & Accounting

Budget Scenario Modeler

Model multiple budget scenarios side-by-side with trade-off analysis, sensitivity testing, and executive-ready recommendations.

15 minutes
Intermediate
Finance & Accounting

Financial Analysis & Trend Interpreter

Analyze financial data to identify trends, anomalies, and actionable insights with executive-ready commentary.

15 minutes
Intermediate
Finance & Accounting

S&P Global Earnings Preview Generator

Generate concise 4-5 page equity research earnings previews for any public company using S&P Capital IQ data via Kensho MCP.

5 minutes
Advanced
Finance & Accounting

S&P Global Weekly Funding Digest

Generate a polished one-page PowerPoint slide summarizing key takeaways from recent funding rounds and capital markets activity across watched sectors.

5 minutes
Advanced
Finance & Accounting

S&P Global Company Tear Sheet Generator

Generate professional company tear sheets and one-pagers using S&P Capital IQ data, tailored to equity research, M&A, corporate development, or sales audiences.

5 minutes
Intermediate
Finance & Accounting

SOX Testing Workpaper

SOX sample selections, testing workpapers, and internal control assessments

10 minutes
Advanced
Finance & Accounting

VAT Return Automation with Browser Control

Automate HMRC VAT MTD submissions using Claude Code and Playwright MCP to navigate forms, calculate figures, and file returns.

15 minutes
Advanced
Finance & Accounting

Invoice & Tax Document Organizer

Automatically sort, rename, and organize invoices, receipts, and tax documents with consistent naming for easy tax preparation.

5 minutes
Beginner
Finance & Accounting

Account Reconciliation Assistant

GL-to-subledger and bank reconciliation with variance identification

10 minutes
Advanced
Finance & Accounting

Browser-Assisted Tax Filing

Use Claude Cowork with browser automation to prepare and file taxes - organize documents, fill forms, and submit filings.

15 minutes
Advanced

Browse all Finance & Accounting playbooks →