Invoice PDFs to data in Zapier

When an invoice PDF arrives (an email attachment, a file in Drive or Dropbox), a Zap sends it to ConvertPDF.pro and gets the vendor, invoice number, dates, total and every line item back as data for the next step, such as a row in Google Sheets.

What you need: a ConvertPDF.pro API key. API access comes with any paid page pack (one-time, no subscription). The free 5-page trial works in the web app only, so you can see the result on a real invoice before you buy. Files can be up to about 3 MB.

How this works: Zapier sends the PDF to our web address and we send back the data. This is a setup using Zapier's own web-request step, not an app listed in Zapier's directory. The steps follow Zapier's documentation, and the screens change from time to time, so run one test invoice before you rely on it.

Set it up in Zapier

  1. Trigger: get the invoice file

    Use any trigger that gives you a PDF file, for example a new email attachment or a new file in a folder.

  2. Code by Zapier (JavaScript): turn the file into base64 text

    Add a Code step, under Input Data add a key called fileUrl and map the trigger's file into it, then paste this. Zapier limits what a Code step can pass along (about 6 MB), which is more than the 3 MB file limit below. It downloads the file and returns it as base64 text.

    const res = await fetch(inputData.fileUrl);
    if (!res.ok) throw new Error("Could not download the file: " + res.status);
    const bytes = Buffer.from(await res.arrayBuffer());
    return { pdfBase64: bytes.toString("base64") };
  3. Webhooks by Zapier: Custom Request

    Method POST. URL below. Add the header Authorization with the value Bearer and then your API key (from the Automation page), and the header Content-Type: application/json. Paste the JSON body into the Data field exactly as shown and insert pdfBase64 from the Code step in place of the placeholder. Custom Request needs a Zapier plan that includes webhooks.

    URL:     https://convertpdf.pro/api/v1-extract
    Header:  Authorization: Bearer YOUR_API_KEY
    Header:  Content-Type: application/json
    Body:    {
               "template": "invoice",
               "pdfBase64": "<the PDF as base64 text>"
             }
  4. Use the result

    The response arrives as fields you can map into any later step. The fields are listed below.

What comes back

One JSON object. These are the values you will use most:

Vendordata.vendor
Invoice numberdata.invoice_number
Invoice datedata.invoice_date
Totaldata.total
Line items (one row each)data.line_items
Needs a person to check?needs_review (true or false), with review_fields

Each PDF page uses one page from your pack. A document where nothing at all is found is not charged (up to 5 a day per account). The full response, error codes and signed webhooks are on the Automation page.

Using another tool?