RistmarkStart free

Guide

One document per row from Make, n8n or Zapier

A common job: a spreadsheet (Google Sheets, Excel, Airtable) has one row per invoice, certificate or letter, and each row should become its own PDF. Ristmark does the rendering; Make, n8n or Zapier reads the rows, calls Ristmark once per row, and puts each PDF where it belongs (a Drive folder, an email, a CRM record).

Every request and response on this page was run against Ristmark with curl before it was written down. The screens of Make, n8n and Zapier change often and were not driven here, so each recipe says which value goes into which field rather than showing screenshots.

Before you start

You need three things:

  1. An approved template. Only approved templates can be generated (see Approval and versions).
  2. A generation API key with Generate documents switched on, and List templates if you want to look up the template's id with the key. See API keys. Keep the key in the tool's own secret or credential store, never in a step's visible text.
  3. The template's id. List your approved templates with the key. The curl examples on this page read the key from a shell variable, so set it first with export RISTMARK_API_KEY= followed by your key:
curl https://api.ristmark.app/v1/templates \
  -H "Authorization: Bearer $RISTMARK_API_KEY"

The answer is a list of the key's team's approved templates:

{
  "items": [
    { "id": "cd5f2067-31de-476f-8a63-d600366f9da2", "name": "Invoice — Classic" }
  ]
}

Copy the id of the template you want. It stays the same when you approve a new version; the call generates the latest approved one unless you send version.

The request every recipe sends

Each recipe sends this one call per row: POST https://api.ristmark.app/v1/documents, with the key in the Authorization header and a JSON body. The body names the template, the output format and the row's values under data, arranged the way the template's fields expect them (the field names are shown in the editor's data panel). This is the request that was run, for an invoice template:

curl https://api.ristmark.app/v1/documents \
  -H "Authorization: Bearer $RISTMARK_API_KEY" \
  -H "Content-Type: application/json" \
  -o invoice-2026-0101.pdf \
  -d '{
    "templateId": "cd5f2067-31de-476f-8a63-d600366f9da2",
    "format": "pdf",
    "strict": true,
    "data": {
      "seller": {
        "name": "Northwind Studio GmbH", "street": "Ottostraße 14", "postcode": "80333",
        "city": "München", "country": "Germany", "vatId": "DE 811 234 567",
        "registration": "HRB 123456, Amtsgericht München",
        "email": "billing@northwind-studio.example", "website": "northwind-studio.example",
        "bank": { "name": "Commerzbank München", "iban": "DE89 3704 0044 0532 0130 00", "bic": "COBADEFFXXX" }
      },
      "customer": {
        "name": "Acme Manufacturing GmbH", "contact": "Jana Weber", "street": "Hauptstraße 12",
        "postcode": "80331", "city": "München", "country": "Germany", "vatId": "DE 298 765 432"
      },
      "invoice": { "number": "2026-0101", "issueDate": "2026-11-28", "dueDate": "2026-12-12", "paymentTermsDays": 14 },
      "items": [
        { "description": "Website maintenance, November", "qty": 1, "unitPrice": 480,
          "vatRate": 0.19, "amount": 480, "vat": 91.2 }
      ]
    }
  }'

In a spreadsheet, the seller block is usually the same on every row, so it is typed into the step once; the customer, invoice number, dates and line come from the row's columns.

The answer is the PDF itself, not JSON:

HTTP/2 200
content-type: application/pdf
content-disposition: inline; filename="invoice-classic.pdf"
x-ratelimit-limit: 30
x-ratelimit-remaining: 29

The file name in content-disposition comes from the template's name, so it is the same for every row. Name each file yourself in the next step, for example from the invoice number.

"strict": true is worth keeping on in an automation: if a row is missing a value the template needs, the call is refused instead of producing a document with a blank in it, and nothing is charged. The refusal is JSON with status 422 and names what is missing:

{
  "code": "render_unresolved",
  "diagnostics": [
    { "code": "unresolved-path", "message": "cannot resolve '$data.invoice' — no such key",
      "expr": "$data.invoice.number", "path": "$data.invoice" }
  ]
}

(the real answer lists one entry per place the missing value is used).

Make

A scenario with three modules: the spreadsheet's Watch rows or Search rows module, the HTTP → Make a request module, and the module that stores or sends the file (Google Drive Upload a file, Gmail Send an email with an attachment, and so on). Make runs the HTTP module once per row the first module gives it. The field names below are those of Make's current HTTP app (version 4).

First make a keychain for the key: in Make a request, set Authentication type to API key and add a keychain under Credentials that puts the key in the header named x-api-key. Ristmark accepts the key in x-api-key as well as in Authorization: Bearer, so the keychain needs no Bearer prefix.

Field Value
Authentication type API key, with the keychain above
URL https://api.ristmark.app/v1/documents
Method POST
Body content type application/JSON
Body input method JSON string
Body content the JSON body above, with the row's columns mapped into data
Parse response No (the answer is a PDF, not JSON)

The module's output then holds the PDF as binary data. In the upload or email module, map that output as the file's data (run the scenario once to see the mappable items) and type the file name yourself, for example invoice- followed by the row's invoice-number column and .pdf.

Map text values inside the JSON with quotes around them, numbers without. A column that can contain a quotation mark or a line break breaks a hand-typed JSON string; choose Body input method Data structure instead and map each column into its own field, so Make writes the JSON.

n8n

A workflow with the spreadsheet node (Google Sheets → Get row(s), Airtable → Search, or a Read/Write Files node for a CSV), an HTTP Request node, and the node that stores or sends the file. n8n runs the HTTP Request node once for every item, and each row is one item.

In HTTP Request:

Field Value
Method POST
URL https://api.ristmark.app/v1/documents
Authentication Generic credential type → Header Auth, name x-api-key, value plk_live_xxx
Send Body on, Body Content Type JSON, Specify Body: Using JSON
JSON the body above, with the row's columns as expressions, for example "number": "{{ $json.invoice_number }}"
Options → Response → Response Format File
Put Output in Field data

The PDF comes out as the item's binary field data. The next node (Google Drive Upload, Send Email with an attachment, Write Files to disk) takes that field name as its input binary field. Set the file name there, for example from {{ $json.invoice_number }}.

Older n8n versions show Response Format directly under Options; it is the same setting.

Zapier

A Zap with the spreadsheet's trigger (Google Sheets → New or Updated Spreadsheet Row, Airtable → New Record) and a Webhooks by Zapier → Custom Request action runs once for each new row and asks Ristmark for that row's document. What Zapier can do with the answer is the limit here, and it is Zapier's, not Ristmark's.

A Zapier file field takes only a file object from an earlier step, a public direct-download link, or text (which it turns into a .txt file). Ristmark answers with the PDF itself, or, from the batch address, with the PDF as base64 text inside JSON; Zapier documents no way to turn either into a file object, and Ristmark does not hand out download links. So a Zap can make the document and pass its base64 text to an app whose own field takes base64 (many document, e-signature and storage APIs called from a second Custom Request do), but it cannot put the PDF into a Zapier file field such as Google Drive's Upload File or Gmail's attachment. For a PDF in Drive or an email, use the Make or n8n recipe above.

The Custom Request for one row:

Field Value
Method POST
URL https://api.ristmark.app/v1/documents/batch
Data Pass-Through? False
Data {"items": [ { "templateId": "…", "format": "pdf", "data": { … } } ]}, with the row's fields inserted into data
Unflatten No
Headers x-api-key = plk_live_xxx, Content-Type = application/json

This is that request with one item, as run (one-row.json holds the body of the single request shown earlier, inside "items": [ … ] and without strict, which the batch address does not take):

curl https://api.ristmark.app/v1/documents/batch \
  -H "x-api-key: $RISTMARK_API_KEY" \
  -H "Content-Type: application/json" \
  -d @one-row.json

The answer, status 201:

{
  "requested": 1,
  "succeeded": 1,
  "results": [
    { "index": 0, "status": "ok", "format": "pdf", "document": "JVBERi0xLjcKJYGBgYEK…" }
  ]
}

In the Zap's later steps, results → document is the PDF as base64 (shortened here) and succeeded is 1 when the document was made. Add a Filter by Zapier step on succeeded before the step that sends it, so a refused row sends nothing.

Many rows in one call

POST https://api.ristmark.app/v1/documents/batch makes up to 25 documents in one call. Each item is the same as a single request's body (templateId, data, and optionally format, version, language); items can use different templates. Use it when the tool collects rows first (Make's Array aggregator, n8n's Aggregate node) and you want one call per 25 rows instead of one per row. (Zapier's Looping runs the steps after it once per row, so it does not collect rows into one call.)

This request was run: two invoices, and a third item with a template id that does not exist. Save the body as batch.json, replace the template id with your own and the key with yours:

curl https://api.ristmark.app/v1/documents/batch \
  -H "x-api-key: $RISTMARK_API_KEY" \
  -H "Content-Type: application/json" \
  -d @batch.json

batch.json:

{
  "items": [
    {
      "templateId": "cd5f2067-31de-476f-8a63-d600366f9da2",
      "data": {
        "seller": {"name": "Northwind Studio GmbH", "street": "Ottostraße 14", "postcode": "80333", "city": "München", "country": "Germany", "vatId": "DE 811 234 567", "registration": "HRB 123456, Amtsgericht München", "email": "billing@northwind-studio.example", "website": "northwind-studio.example", "bank": {"name": "Commerzbank München", "iban": "DE89 3704 0044 0532 0130 00", "bic": "COBADEFFXXX"}},
        "customer": {"name": "Acme Manufacturing GmbH", "contact": "Jana Weber", "street": "Hauptstraße 12", "postcode": "80331", "city": "München", "country": "Germany", "vatId": "DE 298 765 432"},
        "invoice": {"number": "2026-0101", "issueDate": "2026-11-28", "dueDate": "2026-12-12", "paymentTermsDays": 14},
        "items": [{"description": "Website maintenance, November", "qty": 1, "unitPrice": 480, "vatRate": 0.19, "amount": 480, "vat": 91.2}]
      }
    },
    {
      "templateId": "cd5f2067-31de-476f-8a63-d600366f9da2",
      "data": {
        "seller": {"name": "Northwind Studio GmbH", "street": "Ottostraße 14", "postcode": "80333", "city": "München", "country": "Germany", "vatId": "DE 811 234 567", "registration": "HRB 123456, Amtsgericht München", "email": "billing@northwind-studio.example", "website": "northwind-studio.example", "bank": {"name": "Commerzbank München", "iban": "DE89 3704 0044 0532 0130 00", "bic": "COBADEFFXXX"}},
        "customer": {"name": "Globex Retail SIA", "contact": "Anna Liepa", "street": "Brīvības iela 40", "postcode": "LV-1050", "city": "Rīga", "country": "Latvia", "vatId": "LV40000000000"},
        "invoice": {"number": "2026-0102", "issueDate": "2026-11-28", "dueDate": "2026-12-12", "paymentTermsDays": 14},
        "items": [{"description": "Website maintenance, November", "qty": 2, "unitPrice": 480, "vatRate": 0.19, "amount": 960, "vat": 182.4}]
      }
    },
    {
      "templateId": "00000000-0000-4000-8000-000000000000",
      "data": {
        "seller": {"name": "Northwind Studio GmbH", "street": "Ottostraße 14", "postcode": "80333", "city": "München", "country": "Germany", "vatId": "DE 811 234 567", "registration": "HRB 123456, Amtsgericht München", "email": "billing@northwind-studio.example", "website": "northwind-studio.example", "bank": {"name": "Commerzbank München", "iban": "DE89 3704 0044 0532 0130 00", "bic": "COBADEFFXXX"}},
        "customer": {"name": "Acme Manufacturing GmbH", "contact": "Jana Weber", "street": "Hauptstraße 12", "postcode": "80331", "city": "München", "country": "Germany", "vatId": "DE 298 765 432"},
        "invoice": {"number": "2026-0101", "issueDate": "2026-11-28", "dueDate": "2026-12-12", "paymentTermsDays": 14},
        "items": [{"description": "Website maintenance, November", "qty": 1, "unitPrice": 480, "vatRate": 0.19, "amount": 480, "vat": 91.2}]
      }
    }
  ]
}

The answer has status 201 and is JSON, one result per item, in the order sent:

{
  "requested": 3,
  "succeeded": 2,
  "results": [
    { "index": 0, "status": "ok", "format": "pdf", "document": "JVBERi0xLjcKJYGBgYEK…" },
    { "index": 1, "status": "ok", "format": "pdf", "document": "JVBERi0xLjcKJYGBgYEK…" },
    { "index": 2, "status": "error",
      "error": { "code": "render_failed", "message": "Template 00000000-0000-4000-8000-000000000000 not found" } }
  ]
}
  • document is the PDF as base64 text (shortened here). Decode it to get the file: in n8n with the Convert to File node (operation Move Base64 String to File), in Make by mapping it through Make's toBinary() function with base64 as the encoding, or with base64 -d on the command line.
  • One failed item does not fail the others. Match results to your rows by index, and only the items with status ok are charged.
  • An item can carry warnings (for example data-invalid:2 when the template only reports data problems) and language when you asked for one.
  • More than 25 items is refused as a whole with status 400; split the rows into groups of 25.
  • The batch call has no strict field: check a new spreadsheet with single calls and "strict": true first, then switch to batches.

Limits and costs

  • Credits. Each document costs credits per rendered page, exactly as when you generate by hand. A refused call or a failed batch item costs nothing.
  • Rate. 30 requests a minute per workspace; a batch counts as one request. The x-ratelimit-remaining header says how many are left. On status 429, wait and retry; Make's Sleep module, n8n's Wait node or the HTTP node's Batching option spread a long sheet out.
  • Status codes. 401 is a wrong, revoked or expired key; 403 a key without Generate documents; 404 a template that is not approved or not in the key's team; 402 no active plan or no credits. API keys explains each, and the API documentation lists every field.
  • Business data only. The same rules apply to what you send through the API as to what you type in the editor: no payment-card numbers, health or other sensitive personal data.