Generate

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.

POST /api/v1/invoices
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" }] }
  }'
Response
{
  "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.

Thumbnail of the Modern invoice design with a blue accent
The Modern design, one of the 16 designs that invoices, quotes and credit notes can use.

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-note starts a credit note draft from an existing invoice.
  • Voiding an issued document keeps its number, so the sequence has no gaps.
KindWhat it is forKind-specific fields
invoiceRequesting payment; Pay button when Stripe or Razorpay is connecteddue_date or due_terms, deposit
quoteAn offer the customer can accept on the hosted pagevalid_until, auto_convert
credit_noteReducing what a customer owes on an issued invoiceapplies_to_invoice_id (required)
PDF toolsReports, certificates, statements and other layoutsYour 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

Free
$0/mo
  • 100 credits per month
  • 1 seat
  • No webhooks
Starter
$15/mo
or $150/year
  • 1,500 credits per month
  • 1 seat
  • Webhooks
Growth
$49/mo
or $490/year
  • 10,000 credits per month
  • 3 seats
  • Webhooks
Pro
$99/mo
or $990/year
  • 30,000 credits per month
  • 5 seats
  • Webhooks
Scale
$249/mo
or $2,490/year
  • 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.