Render a document
Validates data against the template's schema and renders a PDF, or one page as a PNG with format: "png". Answers 200 with the rendered document and its signed URL, or with async: true 202 with the queued document to poll or wait for by webhook. For e-invoice templates data.invoice is an EN 16931 invoice: Druckling computes the totals and VAT breakdown and produces the template's e-invoice format: Factur-X / ZUGFeRD (the CII XML embedded as factur-x.xml in a PDF/A-3), XRechnung 3.0 (UBL or CII XML) or Peppol BIS Billing 3.0 (UBL XML). XRechnung and Peppol templates produce format: "xml" documents (application/xml). A broken business rule answers 422 validation_failed with the offending field: EN 16931 (BR-xx), XRechnung (BR-DE-xx) or Peppol (PEPPOL-EN16931-xxx, PEPPOL-COMMON-xxx, DE-R-xxx between German parties).
AuthorizationBearer <token>Authorization: Bearer dr_live_… or dr_test_…
application/json- body
template*stringTemplate slug, e.g. invoice-standard
version?|Pinned version or latest (default).
filename?stringlength <= 200data*Payload matching the template schema.
async?booleanQueue the render and return 202 immediately.
format?stringOutput format; the template decides the default (xml for XRechnung and Peppol BIS e-invoice templates, pdf otherwise). png renders one page as an image; a template's PDF/A or PDF/UA setting applies to PDFs only. Factur-X templates render to pdf only, XRechnung and Peppol templates to xml only, and xml needs one of those (422 on format).
"pdf""png""xml"image?PNG options; only allowed with format: "png".
language?stringLanguage to render: one of the template's languages (default: its default language). Texts without a translation fall back to the default language; numbers, dates, hyphenation and the PDF's language follow this one. A regional tag such as de-AT uses de. 422 validation_failed on this field for a language the template doesn't have.
length <= 35storage?|Also copy the file to one of your own S3-compatible buckets (AWS S3, Cloudflare R2, Google Cloud Storage, Scaleway, Hetzner, OVHcloud, IONOS, MinIO…). The upload runs after the render (and signing, so the bucket gets the signed PDF), so it never slows the response; follow it in the document's storage or with the document.delivered / document.delivery_failed webhooks. Without this field the template's bucket rule applies, if there is one; false skips it. 422 validation_failed on storage.bucket for an unknown or disabled bucket.
sign?|Digitally sign the PDF (PAdES, invisible signature) with a certificate uploaded in Settings › Signing: true uses the default certificate, { "certificate": "crt_…" } picks one. Unset: as the template says (its "Sign rendered PDFs" setting); false skips signing even then. PDF only (422 on sign for other formats). Signing is an incremental update, so PDF/A-3 (Factur-X) and PDF/UA documents keep their conformance. 404 on sign.certificate for an unknown certificate; 422 signing_failed when the workspace has no certificate, it has expired, or it can't sign.
Rendered
application/json- response
id*stringobject*unknownstatus*string"queued""rendering""rendered""failed""expired"template*stringversion*number|nullfilename*stringformat*stringxml for XRechnung and Peppol BIS e-invoices.
"pdf""png""xml"content_type*stringapplication/pdf, image/png or application/xml.
image*|Set for png documents.
pages*|Pages in the file (a PNG is one page; null for XML).
size_bytes*number|nullurl*|Signed download URL while the document is retained.
expires_at*|nullerror*|nulleinvoice*|Set when the document is or carries an e-invoice (templates with e-invoicing on).
batch*|Set for documents rendered as part of a batch.
language*|Language the document was rendered in (one of the template's languages); null for documents rendered before templates had languages.
signature*|Set when the PDF carries a digital signature (PAdES) applied by Druckling.
storage*|Set when the document is also copied to your own S3-compatible bucket (request storage, or the template's bucket rule).
test_mode*booleancreated_at*stringdate-timecurl -X POST 'https://druckling-nine.vercel.app/v1/documents' \ -H 'Content-Type: application/json' \ -d '{ "template": "string", "data": { "property1": null, "property2": null }}'{ "id": "string", "object": "document", "status": "queued", "template": "string", "version": 0, "filename": "string", "format": "pdf", "content_type": "string", "image": { "page": 0, "scale": 0, "width": 0, "height": 0 }, "pages": 0, "size_bytes": 0, "url": "string", "expires_at": "2019-08-24T14:15:22Z", "error": { "code": "string", "message": "string", "field": "string" }, "einvoice": { "format": "factur-x", "syntax": "cii", "profile": "string", "customization_id": "string", "attachment": "string" }, "batch": { "id": "string", "index": 0 }, "language": "string", "signature": { "certificate": "string", "certificate_name": "string", "subject": "string", "level": "B-B", "signed_at": "2019-08-24T14:15:22Z", "test_certificate": true }, "storage": { "bucket": "string", "status": "pending", "key": "string", "error": "string", "attempts": 0, "delivered_at": "2019-08-24T14:15:22Z" }, "test_mode": true, "created_at": "2019-08-24T14:15:22Z"}