Automate Invoice Splitting and Data Extraction Using AI Invoice Parser and Zapier

Jul 14, 2025·5 Minutes Read

This tutorial demonstrates how to automate invoice processing using the PDF.co AI Invoice Parser and Zapier. The workflow will:

  1. Split a multi-invoice PDF into individual invoice files. Extract data from each invoice using PDF.co’s AI Invoice Parser.
  2. Save the extracted data into a Google Sheets.

Sample Input

A single PDF file containing five invoices (one per page).

Sample Input

Step-by-Step Instructions

Step 1: Trigger on New File in Google Drive

  • App: Google Drive
  • Trigger: New File in Folder
  • Purpose: Detect when a new PDF file is added to a specific folder.

Note: Make sure the folder contains only the target PDF file with multiple invoices.

Step 2: Configure Google Drive

  • Drive: Select My Google Drive.
  • Folder: Choose the folder where the multi-invoice PDF will be uploaded.
Configure Google Drive

Step 3: Test the Trigger

Run a test to confirm that Zapier detects the uploaded PDF file correctly.

Test the Trigger

Step 4: Add PDF.co App – Split PDF

  • App: PDF.co
  • Action Event: Split PDF Into Multiple Files
Add PDF.co App – Split PDF

Step 5: Configure PDF.co Split Action

  • File Source: Use the file from Step 3.
  • Page Numbers/Ranges: Enter * (asterisk) to split all pages into separate files.
Configure PDF.co Split Action

Step 6: Test the Split Action

Confirm that each page of the original PDF is split into a separate invoice PDF.

Test the Split Action

Step 7: Add Looping by Zapier

  • App: Looping by Zapier
  • Action: Create Loop From Line Items
  • Purpose: Iterate through the list of individual invoice URLs.
Add Looping by Zapier

Step 8: Configure Looping

  • Values to Loop: Use the output array of URLs from the Split PDF action.
Configure Looping

Step 9: Test the Looping Setup

Run a test to ensure that each invoice PDF is processed in the loop.

Test the Looping Setup

Step 10: Add PDF.co AI Invoice Parser

  • App: PDF.co
  • Action Event: AI Invoice Parser
Add PDF.co AI Invoice Parser

Step 11: Configure Invoice Parser

  • Source File URL: Use the invoice file URL from the looping step.
  • Custom Fields: Specify any additional fields not included in the common schema that should appear in the output.
Configure Invoice Parser

Step 12: Test the Invoice Parser

Verify that the parser extracts key invoice data correctly from each file.

Test the Invoice Parser

Step 13: Add Code by Zapier

  • App: Code by Zapier
  • Action Event: Run Python
  • Purpose: Format the table items for easy mapping to Google Sheets

Step 14: Configure Run Python

  • Input Data: Provide values for the required variable and include the output URL from the previous step.
  • Code: Use the code below:
import requests

# Get the URL passed into this code step
url = input_data['json_url']

# Fetch and parse JSON
response = requests.get(url)
data = response.json()

# Extract all line items
line_items = data.get('lineItems', [])

# Return the full list of line items
return {
    "line_items": line_items
}
Configure Run Python

Step 15: Test the Python Code

This step returns the table items, which can be easily mapped to Google Sheets.

Test the Python Code

Step 16: Add Google Sheets Action

  • App: Google Sheets
  • Action Event: Create Multiple Spreadsheet Rows

Step 17: Configure Google Sheets Integration

  • Drive: My Google Drive
  • Spreadsheet: Select the target sheet
  • Worksheet: Choose the relevant tab
  • Data Mapping: Map each extracted invoice field to a corresponding column in the spreadsheet
Configure Google Sheets Integration
Configure Google Sheets Integration
Configure Google Sheets Integration

Step 18: Test & Publish the Zap

  • Run a test to make sure invoice data is added to the spreadsheet.
  • Once confirmed, publish the Zap to go live.
Test & Publish the Zap

Step 19: Review Results in Google Sheets

Open your Google Sheet and confirm that invoice data is populated correctly into separate rows.

Review Results in Google Sheets

Result Summary

You have successfully automated your invoice processing pipeline using:

  • PDF.co to split and parse invoices
  • Zapier to handle workflow automation
  • Google Sheets to store extracted invoice data

Related Tutorials

See Related Tutorials