/// USE CASE

How do I automate invoice generation with a REST API?

Turn Airtable / Sheets / CRM records into signed, branded invoice PDFs — then post them straight to accounting.

Published:
Last updated:
By The ASHDOCS Team
ANSWER

You automate invoice generation by templating an HTML invoice, rendering it to PDF with ASHDOCS's html-to-pdf endpoint (1 credit), and delivering the file to your accounting system through a webhook or destination. A typical run costs 1–3 credits, takes under 800ms end-to-end, and requires no code once the pipeline template is instantiated.

What is the problem this solves?

Most teams still generate invoices by hand: copy line items out of a CRM or spreadsheet, paste them into a Word or Google Docs template, export to PDF, upload to accounting, and email the client. That works for ten invoices a month and breaks at a hundred — every step is a place a typo, a stale template, or a missed send can slip through. Even automated exports from accounting tools usually deliver a single fixed layout, so branded or custom-formatted invoices go back to being manual.

How does ASHDOCS solve it?

ASHDOCS replaces the manual chain with a three-step pipeline: a trigger (new Airtable row, Zapier event, CRM webhook) hands data to the html-to-pdf endpoint, which renders your branded HTML invoice template, and a destination step posts the finished PDF into Drive, S3, QuickBooks or Xero. The whole pipeline is built visually — no code — and every step is verified by reading the result back before it turns green, so a silent failure at the accounting end shows up in the run log instead of the client's inbox.

What is the end-to-end workflow?

  1. 1. Trigger the pipeline
    Start the flow from an Airtable record change, a Zapier or Make trigger, or a webhook from your CRM. The trigger passes the invoice's fields (line items, customer, totals) into the flow's data context.
  2. 2. Render the invoice HTML → PDF
    Use POST /api/v1/tools/html-to-pdf with your Handlebars-style template. 1 credit per invoice. A4 by default; landscape and custom margins supported.
  3. 3. Deliver to accounting
    Use the Google Drive, S3, Dropbox or webhook destination step to push the finished PDF into your accounting system's inbox. Every delivery is read back from the destination before the step turns green.
  4. 4. Notify the client
    Chain a Gmail or Outlook step to email the invoice from your own address, or a Slack/Discord step to post a link into a channel on job.completed.

Which ASHDOCS tools does it use?

ToolRole in this workflow
html-to-pdfRenders your templated HTML invoice into a signed PDF (1 credit).
destinationsDelivers the finished PDF to Google Drive, S3, Slack, or Discord without code.
webhooksNotifies your CRM / billing system on job.completed with the invoice URL.

What outcomes do teams see?

Time per invoice
Manual: 3–5 minutes of copy/paste and export. Automated: under 800ms end-to-end from trigger to delivered PDF.
Manual touchpoints
Manual: 5–8 clicks per invoice across three tools. Automated: zero — the flow runs on its trigger.
Failed deliveries
Signed webhooks are retried three times with exponential backoff; every attempt is logged on the Deliveries page.
EXAMPLE
# Render an invoice, deliver to Google Drive on job.completed
curl -X POST https://www.ashdocs.com/api/v1/tools/html-to-pdf \
  -H "X-API-Key: ash_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>Invoice #{{ invoice_id }}</h1> ...",
    "options": { "format": "A4", "margin_mm": 20 }
  }'

Frequently asked questions

How much does it cost per invoice with ASHDOCS?+

One credit per HTML-to-PDF render. On the Free tier that's included in your 100 monthly credits. On Starter, credits work out to roughly $0.01 per invoice — pricing details on the pricing page.

Can I generate 10,000 invoices in a single batch?+

Yes — POST /api/v1/batch accepts up to 50 files concurrently per call; chain calls or use pipelines for larger volumes.

Does ASHDOCS support signed PDF invoices?+

Digital signature on invoice PDFs is on the roadmap; today ASHDOCS returns a signed download URL and HMAC-signs every webhook so the payload itself is tamper-evident. Ask on the contact page for a beta invite when signing ships.

How do I keep customer data out of ASHDOCS storage?+

Set `options.retention="zero"` on the request or toggle account-wide zero-retention. Confidence and delivery metadata are still returned inline; the source PDF is never persisted.

MORE USE CASES