Guides / Generate PDFs with Zapier

No-code · Updated 2026-12-03

Generate PDFs with Zapier

This guide builds a Zap that turns a new order, form entry or spreadsheet row into a finished PDF, then emails it or saves it to Drive. You fill a template with data from the trigger; DevilPDF handles the layout, page breaks, totals and fonts.

A native DevilPDF app for Zapier is coming. Until it is listed, use the built-in Webhooks by Zapier action described here. It calls the same API and gives the same result.

#What you need

  • A Zapier plan that includes Webhooks by Zapier. It is a premium app, available on paid Zapier plans.
  • A DevilPDF API key. Sign up, open API keys, and create one. It starts with dp_live_. The free plan includes 500 documents a month.

Use a separate key for Zapier, so you can revoke it without breaking anything else.

#The example

A new row in a Google Sheet called "Invoices" becomes an invoice PDF that is emailed to the customer. The sheet has the columns Number, Date, Customer, Email, Item, Quantity and Price. Any other trigger works the same way: Stripe, Typeform, Shopify, Airtable, a webhook.

#1. Add the trigger

Create a Zap. Trigger: Google Sheets → New Spreadsheet Row. Pick the spreadsheet and worksheet, then test the trigger so Zapier loads a sample row. You need that sample to map fields in the next step.

#2. Add the Webhooks by Zapier action

  1. Add an action and choose Webhooks by Zapier, event Custom Request.
  2. Method: POST
  3. URL: https://devilpdf.com/v1/render
  4. Data Pass-Through: False
  5. Data: the JSON body below. Where it shows a field in double braces, delete that placeholder and insert the matching field from the trigger with Zapier's field picker.
Data
{
  "template": "invoice",
  "data": {
    "number": "{{Number}}",
    "issue_date": "{{Date}}",
    "company": { "name": "Northwind Studio", "address": "410 Bay Street, Toronto, ON" },
    "customer": { "name": "{{Customer}}", "email": "{{Email}}" },
    "items": [
      { "name": "{{Item}}", "quantity": {{Quantity}}, "unit_price": {{Price}} }
    ],
    "tax_rate": 13,
    "tax_label": "HST"
  },
  "filename": "invoice-{{Number}}"
}
  1. Headers: add two.
KeyValue
AuthorizationBearer dp_live_... (the word Bearer, a space, then your key)
Content-Typeapplication/json

Notes on the body:

  • Text values go inside quotes: "{{Customer}}". Numbers go without them: {{Quantity}}. If a number cell can be empty, quote it too, or the body stops being valid JSON. A number sent as text still works in the template's calculations.
  • issue_date reads best as YYYY-MM-DD. Use a Formatter by Zapier → Date / Time step first if your dates are in another format.
  • You do not send a subtotal or total. The invoice template calculates them from items and tax_rate.

#3. Test it

Click Test step. Zapier shows the response from DevilPDF. The fields you care about:

FieldMeaning
urlLink to the finished PDF
idThe document's id, starting with doc_
pagesPage count
statussucceeded

Open the url to check the invoice. If the test fails, the response has an error object with a message that says what is wrong: usually a missing Bearer prefix, or a quote character in a text field breaking the JSON.

#4. Send or save the PDF

Add one more action and map the url from the webhook step:

  • Gmail → Send Email: put the link in the body, or map it into Attachments. Zapier downloads files from a URL placed in an attachment field.
  • Google Drive → Upload File: map url into File to keep a copy in Drive.
  • Slack → Send Channel Message: post the link to your team.

Hosted links expire: after 24 hours on DevilPDF's free plan, and up to 30 days on paid plans. If the document must live longer, save the file in the same Zap, as in the Drive example.

#Several line items

A spreadsheet row usually holds one item. If your trigger gives you line items (a Shopify order, a Stripe invoice), Zapier passes them as lists. The simplest reliable approach is a Code by Zapier step that builds the items array, and then a body that uses it:

Code by Zapier (JavaScript)
const names = inputData.names.split(",");
const qtys = inputData.quantities.split(",");
const prices = inputData.prices.split(",");

const items = names.map((name, i) => ({
  name: name.trim(),
  quantity: Number(qtys[i]),
  unit_price: Number(prices[i]),
}));

output = { items_json: JSON.stringify(items) };

In the webhook's Data field, write "items": {{items_json}} with no quotes around it.

#Other documents

Change "template" to another starter: quote, receipt, statement, report, packing-slip or certificate. Each one documents its fields in sample_data; see templates. To render in another language, add "locale": "fr" (or "ar", "ja", "de"...) next to "template". Labels, dates and money switch, and Arabic or Hebrew documents mirror right to left.

#Next steps