Compose many documents from one template
Renders the same template once per item — a run of invoices, contracts or letters from one call.
Every item's data is validated first. If ANY item fails, nothing renders and the call answers 422 with an errors[] naming the failing item indexes and instance paths: a half-finished batch is worse than none.
{
"template": "invoice",
"items": [
{ "name": "acme-0042", "data": { "customer": "Acme", "total": 1240 } },
{ "name": "globex-0043", "data": { "customer": "Globex", "total": 990 } }
]
}
output decides what comes back:
files(the default) stores each PDF and returns the list. An item'snamenames its file (<name>.pdf); without one the files are numbered from the template slug.zipstores ONE archive holding every PDF and returns that single file.
A name must be a bare file name — no /, no \, no .., no leading dot — and two items may not end up with the same file name.
Learn more: Compose
POST
https://api.cloudraker.com/v1/compose/batch