REST API · async · metered
The PDF generation API for teams that ship.
Built like an infrastructure product, not a wrapper around a PDF library. Async-first, parallel by default, HMAC-signed webhooks, Stripe metered billing. From sandbox to production in one afternoon.
// Submit values for an existing template
POST /api/v1/compilations/
Authorization: Bearer pdf_live_•••
Content-Type: application/json
{
"template": "3f0e4b2a-21c2-4d34-9c8d-9b0a5d6b3f11",
"values": {
"full_name": "Jordan Rivera",
"effective_date": "2026-06-01",
"agrees_to_terms": true
}
} // Response — 201 Created, rendering queued
HTTP/1.1 201 Created
{
"id": "c2a1...e9",
"status": "pending",
"download_url": null
} - Async-native
Submit, get an ID, move on.
Single compilations and batches are queued on dedicated Celery workers. The API responds immediately with a stable resource ID; final state arrives via webhook or a `GET` you control. No 30-second HTTP holds, no timeouts in your gateway.
- Parallel batches
5 000 rows shouldn't be slower than 50.
Batch jobs fan out across a parallel worker pool. We expose `succeeded`, `failed`, `expected_total` on the batch object so you can plot real progress, not just a spinner.
- Stripe metered billing
Per-PDF pricing. Live in your Stripe dashboard.
Every rendered PDF over your plan's included quota is reported to Stripe as a metered usage event. No proprietary credit system, no end-of-month reconciliation.
- Cheaper as you grow
Overage per PDF goes down at every tier.
Starter €0.03 / Pro €0.02 / Business €0.01 per PDF over quota. Transparent slope baked into the price list.
Render one PDF
curl -X POST 'https://api.datapdfengine.com/api/v1/compilations/' \
-H 'Authorization: Bearer pdf_live_...' \
-H 'Content-Type: application/json' \
-d '{
"template": "3f0e4b2a-21c2-4d34-9c8d-9b0a5d6b3f11",
"name": "NDA — Acme Corp",
"values": {
"full_name": "Jordan Rivera",
"effective_date": "2026-06-01",
"agrees_to_terms": true,
"annual_fee": 12000
}
}' Submit a 5 000-row batch
curl -X POST 'https://api.datapdfengine.com/api/v1/batches/json/' \
-H 'Authorization: Bearer pdf_live_...' \
-H 'Content-Type: application/json' \
-d '{
"template": "3f0e4b2a-21c2-4d34-9c8d-9b0a5d6b3f11",
"rows": [
{ "full_name": "Jordan Rivera", "hire_date": "2025-09-01" },
{ "full_name": "Sasha Park", "hire_date": "2025-10-14" }
],
"completion_webhook_endpoint": "e9d8...c1"
}' Verify the HMAC-SHA256 signature
import crypto from "node:crypto";
export function verify(req, secret) {
const header = req.headers["x-datapdfengine-signature"]; // "sha256=<hex>"
const [scheme, sig] = header?.split("=") ?? [];
if (scheme !== "sha256" || !sig) return false;
const expected = crypto
.createHmac("sha256", secret)
.update(req.rawBody)
.digest("hex");
const a = Buffer.from(sig, "hex");
const b = Buffer.from(expected, "hex");
return a.length === b.length && crypto.timingSafeEqual(a, b);
} Want every endpoint, payload and error code?
The full API reference lives on a dedicated page. Bookmark it next to your editor.