1 creditInvoice PDF API — invoices straight from JSON
Send line items and parties as JSON; get back a finished, correctly-totalled PDF.
The Invoice PDF API turns structured JSON — seller, buyer, line items, tax rates — into a finished invoice PDF in one REST call. Line totals, per-rate tax subtotals and the grand total are computed server-side from the numbers you send, so a Make, Zapier or n8n workflow can bill customers without a template or a form. One credit per invoice. The v2 endpoint (`/api/v2/tools/invoice-pdf`, 3 credits) additionally produces a Factur-X e-invoice: a PDF/A-3b document with an embedded EN 16931 CII XML validated against the official schema, plus the XML itself as a second output. Scope limits: profile `en16931` only — `ubl-2.1` returns 422 `profile_not_available` — and the structured `seller`/`buyer` need a 2-letter `country_code` the plain PDF doesn't require.
How does the Invoice PDF API work?
One HTTP request from any language. Every ASHDOCS endpoint uses the same X-API-Key header.
curl -X POST https://www.ashdocs.com/api/v1/tools/invoice-pdf \
-H "X-API-Key: ash_live_..." \
-H "Content-Type: application/json" \
-d '{"invoice":{"number":"INV-2026-0041","currency":"USD","seller":{"name":"Acme Studio"},"buyer":{"name":"Globex Ltd"},"line_items":[{"description":"Design work","quantity":12,"unit_price":95,"tax_rate":0}]},"options":{"template":"clean","format":"A4"}}'Common use cases
- →Auto-invoice on Stripe payment or Shopify order
- →Monthly billing runs from a cron
- →Invoices from CRM or project-management triggers
Frequently asked questions
How do I generate an invoice PDF from JSON?+
POST your invoice data — parties, line items, tax rates, currency — to the endpoint and receive the rendered PDF. Totals are computed from the numbers you supply.
Does the API handle VAT or country-specific tax rules?+
No. You supply the tax rate per line item and it is applied arithmetically. The API does not implement country-specific tax rules or e-invoicing compliance schemes.
Can I add my logo and choose a layout?+
Yes — pass options.logo_url and options.template (clean or compact), plus format A4 or Letter.
Can I automate invoicing without code?+
Yes. Trigger a Make scenario, Zapier Zap or n8n workflow from a payment or order event, map the data into this endpoint, and email or file the returned PDF.