/// REFERENCE

How do I generate documents and images with the ASHDOCS API?

Reference for the six generation endpoints: invoice-pdf (1 credit), barcode (1), qr-code (1), og-image (1), screenshot (2) and pdf-to-html (2) — request shapes and curl examples.

Published: Last updated:

Answer: ASHDOCS ships six generation endpoints under the same REST scheme as every other tool — same X-API-Key auth, same job/response shape, same sandbox behaviour (test keys never bill), and failed jobs are never charged.

POST /api/v1/tools/invoice-pdf — 1 credit

Generates an invoice PDF from JSON. Line totals, per-rate tax subtotals and the grand total are computed from the numbers supplied. Options: logo_url, template (clean|compact), format (A4|Letter).

curl -X POST https://www.ashdocs.com/api/v1/tools/invoice-pdf \
  -H "X-API-Key: ash_test_xxxxxxxx" -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 }] } }'

POST /api/v1/tools/barcode — 1 credit

Generates Code 128, EAN-13, EAN-8, UPC-A, ITF-14, Code 39, DataMatrix, PDF417 or GS1-128 as PNG or SVG. Check digits are validated for EAN/UPC/ITF-14. Pass attach_to_pdf to stamp the code onto an existing PDF.

curl -X POST https://www.ashdocs.com/api/v1/tools/barcode \
  -H "X-API-Key: ash_test_xxxxxxxx" -H "Content-Type: application/json" \
  -d '{ "data": "5901234123457", "symbology": "ean13", "options": { "format": "svg", "height_mm": 25 } }'

POST /api/v1/tools/qr-code — 1 credit per code

Static QR codes for url, text, wifi, vcard, email, phone or sms payloads. PNG or SVG, custom colors, error_correction L|M|Q|H. Send content as an array of up to 100 objects to receive a ZIP.

curl -X POST https://www.ashdocs.com/api/v1/tools/qr-code \
  -H "X-API-Key: ash_test_xxxxxxxx" -H "Content-Type: application/json" \
  -d '{ "content": { "type": "url", "value": "https://example.com" }, "options": { "format": "svg", "error_correction": "Q" } }'

POST /api/v1/tools/screenshot — 2 credits

Captures a public webpage as PNG or JPEG. Options: full_page, viewport, scale (1|2), block_ads, wait_for (load|networkidle|CSS selector), delay_ms, hide_selectors. Private and metadata IPs are refused (ssrf_blocked).

curl -X POST https://www.ashdocs.com/api/v1/tools/screenshot \
  -H "X-API-Key: ash_test_xxxxxxxx" -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com", "options": { "viewport": { "width": 1280, "height": 800 }, "scale": 2, "wait_for": "networkidle" } }'

POST /api/v1/tools/og-image — 1 credit

Renders a 1200×630 Open Graph card from a template (basic|split|quote) and your fields (title, subtitle, eyebrow, logo_url, background). Long titles auto-shrink to fit.

curl -X POST https://www.ashdocs.com/api/v1/tools/og-image \
  -H "X-API-Key: ash_test_xxxxxxxx" -H "Content-Type: application/json" \
  -d '{ "template": "basic", "fields": { "eyebrow": "GUIDE", "title": "Static vs Dynamic QR Codes" } }'

POST /api/v1/tools/pdf-to-html — 2 credits

Multipart upload. mode=responsive rebuilds semantic HTML (headings, tables, lists, links); mode=fixed preserves absolute positioning. inline_images=true embeds images as data URIs; false returns a ZIP with assets.

curl -X POST https://www.ashdocs.com/api/v1/tools/pdf-to-html \
  -H "X-API-Key: ash_test_xxxxxxxx" \
  -F "files=@annual-report.pdf" \
  -F 'options={"mode":"responsive","inline_images":true}'

Prefer a UI? Three of these have free browser versions: the invoice generator, QR code generator and barcode generator.