Start a batch
Renders one template for many payloads. Every item's data is validated first: if any item is invalid nothing is rendered and the answer is 422 with data.errors listing the first invalid items' index, field and message (data.invalidItems counts them all). Otherwise each item becomes an asynchronous document (its batch set) and the answer is 202. Poll GET /batches/{id} or subscribe to batch.completed; a completed batch has a zip_url with every rendered PDF. Up to 1,000 items and 4 MB per request. Live batches must fit in the plan's documents left today and this month (429 quota_exceeded).
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).
items*array<>1 <= items <= 1000language?stringLanguage of every item without its own language: one of the template's languages (default: its default language). Unknown languages are rejected with 422 on language or items.{n}.language.
length <= 35filename_pattern?stringFile names from each item's data, e.g. invoice-{{invoice.number}}.pdf. Names are made unique within the batch; default {template}-{n}.pdf. XRechnung and Peppol templates produce XML e-invoices, named .xml.
length <= 200storage?|Copy every item's file to one of your own buckets, as for a single render.
OK
application/json- response
id*stringobject*unknownstatus*stringqueued → running → completed (ZIP ready), failed (nothing rendered, or the ZIP couldn't be built) or canceled.
"queued""running""completed""failed""canceled"template*stringversion*numberfilename_pattern*string|nullcounts*Items by outcome; pending is queued or rendering.
zip_url*|Signed download URL of the ZIP with every rendered file (PDFs, or XML e-invoices), once the batch completed and while the ZIP is retained.
zip_size_bytes*number|nullzip_expires_at*|When the ZIP is deleted (the file retention period).
error*|nulltest_mode*booleancreated_at*stringdate-timefinished_at*|nullcurl -X POST 'https://druckling-nine.vercel.app/v1/batches' \ -H 'Content-Type: application/json' \ -d '{ "template": "string", "items": [ { "data": { "property1": null, "property2": null } } ]}'{ "id": "string", "object": "batch", "status": "queued", "template": "string", "version": 0, "filename_pattern": "string", "counts": { "total": 0, "pending": 0, "rendered": 0, "failed": 0, "canceled": 0 }, "zip_url": "string", "zip_size_bytes": 0, "zip_expires_at": "2019-08-24T14:15:22Z", "error": { "code": "string", "message": "string" }, "test_mode": true, "created_at": "2019-08-24T14:15:22Z", "finished_at": "2019-08-24T14:15:22Z"}