Document generation API
Invoices, quotes, credit notes and custom PDFs from one key, numbered, rendered and delivered.
ASHDOCS is a document generation API for the paperwork a business sends to its customers. Business documents (invoices, quotes and credit notes) are created from data: you send the customer and the line items, and ASHDOCS numbers the document, works out the totals and tax, renders the PDF, publishes a hosted page and, if you ask, emails it.
Everything else, from reports and certificates to statements and packing slips, goes through the PDF tools: send your own HTML template with data, or a URL, and get a PDF back.
curl -X POST https://www.ashdocs.com/api/v1/invoices \
-H "X-API-Key: ash_test_..." \
-H "Content-Type: application/json" \
-d '{
"kind": "quote",
"customer": { "name": "Acme Inc", "email": "ap@acme.com" },
"line_items": [
{ "description": "Website redesign", "quantity": "1", "unit_price": "4800.00", "tax_rate": "8.25" }
],
"currency": "USD",
"valid_until": "2026-11-08",
"issue": true,
"send": { "channels": [{ "type": "email" }] }
}'const res = await fetch("https://www.ashdocs.com/api/v1/invoices", {
method: "POST",
headers: { "X-API-Key": "ash_test_...", "Content-Type": "application/json" },
body: JSON.stringify({
kind: "quote",
customer: { name: "Acme Inc", email: "ap@acme.com" },
line_items: [
{ description: "Website redesign", quantity: "1", unit_price: "4800.00", tax_rate: "8.25" },
],
currency: "USD",
valid_until: "2026-11-08",
issue: true,
send: { channels: [{ type: "email" }] },
}),
});
const quote = await res.json();
console.log(quote.number, quote.hosted_url);import requests
r = requests.post(
"https://www.ashdocs.com/api/v1/invoices",
headers={"X-API-Key": "ash_test_..."},
json={
"kind": "quote",
"customer": {"name": "Acme Inc", "email": "ap@acme.com"},
"line_items": [
{"description": "Website redesign", "quantity": "1", "unit_price": "4800.00", "tax_rate": "8.25"}
],
"currency": "USD",
"valid_until": "2026-11-08",
"issue": True,
"send": {"channels": [{"type": "email"}]},
},
)
quote = r.json()
print(quote["number"], quote["hosted_url"]){
"id": "inv_4b7e0c2a91d34f6e8a10",
"kind": "quote",
"status": "issued",
"number": "QUO-0001",
"customer": { "name": "Acme Inc", "email": "ap@acme.com", "id": "cus_2f9c41d07a6b4e1c9d55" },
"currency": "USD",
"valid_until": "2026-11-08",
"auto_convert": false,
"template": "clean",
"totals": {
"subtotal_formatted": "$4,800.00",
"tax_formatted": "$396.00",
"total_formatted": "$5,196.00"
},
"pdf_url": "https://api.ashdocs.com/api/v1/invoices/inv_4b7e0c2a91d34f6e8a10/pdf",
"hosted_url": "https://api.ashdocs.com/i/<token>",
"credits_cost": 0,
"testing": true
}Response trimmed; values illustrative. Test keys report 0 credits; issuing with a live key uses 1 credit.

Three business document kinds
Invoices, quotes and credit notes share one endpoint and one schema, each with its own number sequence (INV-, QUO-, CN- by default).
Delivered, not just rendered
Every issued document gets a PDF and a hosted page. Add send.channels to email it in the same request, or schedule it for later.
Status you can act on
Customers accept quotes on the hosted page. Webhooks for sent, viewed, paid and overdue invoices reach your server on paid plans.
Document types in one document generation API
The kind field on POST /api/v1/invoices decides what you get. The rules that differ by kind are enforced by the schema, so a malformed request fails with a field-level error rather than producing the wrong document.
- An accepted quote converts to an issued invoice with
POST /api/v1/invoices/{id}/convert. POST /api/v1/invoices/{id}/credit-notestarts a credit note draft from an existing invoice.- Voiding an issued document keeps its number, so the sequence has no gaps.
| Kind | What it is for | Kind-specific fields |
|---|---|---|
| invoice | Requesting payment; Pay button when Stripe or Razorpay is connected | due_date or due_terms, deposit |
| quote | An offer the customer can accept on the hosted page | valid_until, auto_convert |
| credit_note | Reducing what a customer owes on an issued invoice | applies_to_invoice_id (required) |
| PDF tools | Reports, certificates, statements and other layouts | Your HTML and data, or a URL |
How templates work
Business documents use designed templates. Pick one of 16 with the template field (Clean, Modern, Classic, Minimal, Bold, Receipt, Elegant, Corporate and more), and set your look once in a branding profile: logo, accent and text colors, one of eight font stacks, layout, column visibility and your own wording for labels. Paper is Letter or A4. POST /api/v1/invoices/preview renders a watermarked preview for 0 credits while you experiment.
For any other layout, write the template yourself in HTML with {{ variables }} and {% for %} loops and send it to the HTML to PDF endpoint with a data object. Values are escaped, and missing variables are reported before anything is rendered.
Credits and test mode
Issuing a business document uses 1 credit, charged once on the first successful render, and drafts and previews are free. The PDF tools use 1 credit per document. Anything you generate with a test key is free, and test keys do not expire.
Frequently asked questions
What is a document generation API?
A document generation API turns structured data into finished documents, usually PDFs, through an HTTP request instead of a word processor. With ASHDOCS one request can also number the document, host it on a web page and email it to the customer.
Which document types are supported?
The invoicing API creates invoices, quotes and credit notes, each with its own number sequence. Any other document, such as a report, certificate or statement, can be generated from your own HTML template or a URL with the PDF tools; there is no separate receipt document type, though the Receipt design prints on an 80 mm till roll.
Can documents be emailed automatically?
Yes. Add "issue": true and "send": {"channels": [{"type": "email"}]} to the create request and the document is emailed to the customer, with optional to, cc, bcc, subject and body overrides. You can also schedule a send with schedule_at, and invoices get payment reminders by email 3 days before, on, and 7 days after the due date unless you change them.
How do templates work?
Invoices, quotes and credit notes are rendered with one of 16 built-in designs, styled by your branding profile (logo, colors, font, layout and labels). For other documents you supply an HTML template with {{ variable }} placeholders and send the values with each request.
Plans
- 100 credits per month
- 1 seat
- No webhooks
- 1,500 credits per month
- 1 seat
- Webhooks
- 10,000 credits per month
- 3 seats
- Webhooks
- 30,000 credits per month
- 5 seats
- Webhooks
- 100,000 credits per month
- 10 seats
- Webhooks
Test keys are free, never expire and never use credits; plan rate limits apply. Webhooks are on paid plans. Issuing an invoice uses 1 credit. No per-seat fees. See full pricing.