DocuStream
Invoice PDF Generator

Automate Invoice PDF Generation with an API

Design your invoice template once, then generate pixel-perfect invoice PDFs from billing data with a single API call — and optionally email them to clients automatically.

How the invoice PDF generator works

1

Design your invoice template

Build an HTML or Word invoice template with your branding, logo, and Handlebars {{variable}} placeholders for line items, amounts, client details, and dates.

2

Upload once, use forever

POST your template to DocuStream. It's stored in your account and reused every time you generate a new invoice — no re-uploads needed.

3

POST billing data, receive a PDF

Send a JSON payload with invoice number, client name, line items, and totals. DocuStream renders the PDF and returns a signed URL instantly.

4

Deliver automatically

Include an email object in the same request to have DocuStream send the invoice directly to your client. Or pass the signed URL back through your billing system.

Generate and send an invoice in one request

DocuStream's API lets you generate the PDF and email it to your client in a single call. No separate email step, no manual attachment — it just works.

// Generate an invoice PDF from a template
const response = await fetch('https://your-docustream.app/api/pdfs/generate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'YOUR_API_KEY',
  },
  body: JSON.stringify({
    templateId: 'tmpl_invoice',
    variables: {
      invoiceNumber: 'INV-2026-0042',
      issueDate: 'May 5, 2026',
      dueDate: 'May 19, 2026',
      clientName: 'Acme Corp',
      lineItems: [
        { description: 'Consulting – April', qty: 10, rate: '$150', total: '$1,500' },
        { description: 'Platform fee', qty: 1, rate: '$99', total: '$99' },
      ],
      subtotal: '$1,599',
      tax: '$127.92',
      total: '$1,726.92',
    },
    // Optionally send to the client by email in the same request
    email: {
      to: 'billing@acmecorp.com',
      subject: 'Invoice INV-2026-0042 from Your Company',
    },
  }),
});

const { signedUrl } = await response.json();

Why automate invoice PDF generation with DocuStream

🎨

Fully branded invoices

Your logo, colors, and typography — rendered exactly as designed. No generic invoice layouts.

Instant generation

Invoice PDFs are generated in seconds, not minutes. Deliver professional documents the moment a payment is due.

📧

Automatic email delivery

Send invoices to clients directly from DocuStream. Every send is logged so you have a full delivery audit trail.

🔗

Signed download links

Share invoices via time-limited signed URLs — secure, trackable, and accessible without logging in.

📦

Bulk invoice runs

Run your entire monthly billing cycle in one API call. Generate all invoices at once and send each one to the right client.

🔑

Easy integration

Works with any language or platform. If your billing tool can make an HTTP request, it can generate DocuStream invoices.

Automate your invoice generation today

Free plan available — no credit card required. Start generating professional invoice PDFs in minutes.

Get started free