QuvanticBook free audit

ZapierChecked blueprint6 nodes

Catch a duplicate invoice before it is logged

Build one key from vendor, invoice number, and amount, look it up in the log, and either log the invoice or flag the duplicate.

Portfolio reference build with demo data and placeholder credentials, not a client deployment.

Pain

Stops opening PDFs, typing vendor totals, and hoping nobody pays the same bill twice.

Solution

Build one key from vendor, invoice number, and amount, look it up in the log, and either log the invoice or flag the duplicate.

Impact · From the blueprint

Minutes per duplicate caught, and the cost of one double payment usually exceeds a year of Zapier.

Library status: passing. Schema, field mapping, task count, and Code-step unit tests pass. Not built in a live Zapier account.

Catch a duplicate invoice before it is logged step list
Step list

Step inspector

The first step shows the checked-in sample payload.Later steps name the node. They are not a live execution.

Guardrails

No approval, retry, or demo-gate node was detected by name. Read the README before connecting live credentials.

Credential ids in the JSON are placeholders. These files are portfolio demos.

Deploy this for your business

Tell us this slug and what still happens by hand. We will map it onto your accounts. This page is not a claim that the blueprint already runs for a customer.

README

Portfolio demo by Mustafa (mustafaautomation). Not client work. The people, companies, and numbers in it are made up. Rebuild it in your own Zapier account. Nothing here is connected to anyone's account.

Category: Invoices and documents
Difficulty: intermediate
Apps: Gmail, AI by Zapier, Code by Zapier, Google Sheets, Paths by Zapier, Slack
Zapier plan: Professional (multi-step Zap: 8 steps after the trigger; Paths by Zapier; AI by Zapier)
Tasks per run: 5 typical, 6 at most
Test status: passing (schema, mapping scope, task count, Code step unit tests)

Problem

Suppliers send the same invoice twice: once on issue, again as a reminder, sometimes with "INV-001842" in one and "#1842" in the other. Both get logged and occasionally both get paid.

Who it's for

Accounts-payable teams logging invoices in a sheet who have paid the same invoice twice at least once.

How the Zap runs

flowchart TD
  s1["1. Gmail: New Labeled Email<br/>New email under the Invoices label"]
  s2["2. AI by Zapier<br/>Pull the invoice fields"]
  s1 --> s2
  s3["3. Code by Zapier<br/>Turn the printed total into cents"]
  s2 --> s3
  s4["4. Code by Zapier<br/>Build the duplicate key"]
  s3 --> s4
  s5["5. Google Sheets<br/>Look the key up in the log"]
  s4 --> s5
  s6{"6. Paths by Zapier<br/>New invoice or duplicate"}
  s5 --> s6
  s7["7. Google Sheets<br/>Log the invoice with its key"]
  s6 -->|"New invoice"| s7
  s8["8. Gmail<br/>Label the email as a duplicate"]
  s6 -->|"Duplicate"| s8
  s9["9. Slack<br/>Tell AP about the duplicate"]
  s8 --> s9

Build it in the Zapier editor

Zapier has no import file for a Zap like this one, so it is built by hand from the steps below. zap.json is the same Zap in a machine-readable form (schema), and zap.yaml is the same document in YAML.

A value like [2. vendor] means: click the field, open step 2 in the data picker, and choose vendor. Plain text is typed as shown. YOUR_... is a value from your own account.

Before you start

  • Create the sheet Payables › Invoice log with these headers in row 1: invoice_key, logged_at, vendor, invoice_number, amount, currency, due_date, gmail_link.

Steps

1. Trigger: New email under the Invoices label

App: Gmail · Event: New Labeled Email · polling (Zapier checks on your plan's update interval) · Tasks: 0

Fires for each invoice email under the label.

FieldValue
LabelInvoices

Fields this library maps from the trigger: message_id, thread_id, from_email, from_name, to, subject, date, body_plain, snippet, labels, attachment_count, attachment_names. Zapier shows them with its own labels; pick the one with the same meaning.

2. Action: Pull the invoice fields

App: AI by Zapier · Event: Analyze and Return Data · Tasks: 1

Reads vendor, number, and total from the email text.

FieldValue
ModelDefault (fast)
InstructionsYou read supplier invoices for an accounts-payable team. From the email below, return: vendor (the company that sent the invoice), invoice_number (exactly as printed), invoice_date and due_date (YYYY-MM-DD, empty if not stated), total_text (the grand total exactly as printed, with its currency symbol or code, for example "$1,280.00" or "1.280,00 EUR"), currency (ISO code if you can tell, otherwise empty), line_summary (one short line describing what was bought), and text_found ("yes" if the email text actually contains the invoice figures, "no" if the figures are only inside an attachment you cannot read). Never invent a number. If a value is not in the text, leave it empty.
Input dataFrom: [1. from_name] <[1. from_email]>
Subject: [1. subject]

[1. body_plain]
Output fieldsvendor, invoice_number, invoice_date, due_date, total_text, currency, line_summary, text_found

Later steps can map: vendor, invoice_number, invoice_date, due_date, total_text, currency, line_summary, text_found.

3. Action: Turn the printed total into cents

App: Code by Zapier · Event: Run JavaScript · Tasks: 1

The key uses cents so "$1,280.00" and "1280" match.

Paste the whole of code/parse-money.js into the code box. Source: content/code/parse-money.cjs. Unit tests: content/code/parse-money.test.cjs.

Input Data keyValue
amount_text[2. total_text]
currency_hint[2. currency]

Returns: amount, amount_fixed, amount_cents, currency, format, needs_review.

4. Action: Build the duplicate key

App: Code by Zapier · Event: Run JavaScript · Tasks: 1

Normalises the vendor ("Harbor Goods Ltd." and "HARBOR GOODS" match) and the number ("INV-001842", "#1842") into one key.

Paste the whole of code/invoice-key.js into the code box. Source: content/code/invoice-key.cjs. Unit tests: content/code/invoice-key.test.cjs.

Input Data keyValue
vendor[2. vendor]
invoice_number[2. invoice_number]
amount_cents[3. amount_cents]

Returns: key, vendor_slug, number_clean, complete.

5. Search: Look the key up in the log

App: Google Sheets · Event: Lookup Spreadsheet Row · Tasks: 1

Searches the key column the new-invoice path writes.

FieldValue
DriveMy Google Drive
SpreadsheetPayables
WorksheetInvoice log
Lookup Columninvoice_key
Lookup Value[4. key]
Should this step be considered a "success" when nothing is found?Yes

Later steps can map: row_number, _zap_search_was_found_status, logged_at, gmail_link.

6. Paths: New invoice or duplicate

App: Paths by Zapier · Event: Split into paths · Tasks: 0

One path per answer from the lookup.

The path rules exclude each other, so at most one path runs. Nothing can follow a Paths step, so each path ends the run on its own.

Path A: New invoice. Rule: [5. _zap_search_was_found_status] (Boolean) Is false. This is the usual path.

7. Action: Log the invoice with its key (path A)

App: Google Sheets · Event: Create Spreadsheet Row · Tasks: 1

Writes the key so the next copy of this invoice is caught.

FieldValue
DriveMy Google Drive
SpreadsheetPayables
WorksheetInvoice log
Columns › invoice_key[4. key]
Columns › logged_at[1. date]
Columns › vendor[2. vendor]
Columns › invoice_number[4. number_clean]
Columns › amount[3. amount_fixed]
Columns › currency[3. currency]
Columns › due_date[2. due_date]
Columns › gmail_linkhttps://mail.google.com/mail/u/0/#all/[1. message_id]

Later steps can map: id, row_number.

Path B: Duplicate. Rule: [5. _zap_search_was_found_status] (Boolean) Is true.

8. Action: Label the email as a duplicate (path B)

App: Gmail · Event: Add Label to Email · Tasks: 1

Keeps the copy out of the payment run without deleting it.

FieldValue
Message[1. message_id]
LabelsInvoices/Duplicate

Later steps can map: id.

9. Action: Tell AP about the duplicate (path B)

App: Slack · Event: Send Channel Message · Tasks: 1

Links the first copy so a person can confirm in seconds.

FieldValue
Channel#accounts-payable
Message TextPossible duplicate: [2. vendor] invoice [4. number_clean] for [3. amount_fixed] [3. currency]. First logged [5. logged_at] (row [5. row_number]): [5. gmail_link]
Send as a bot?Yes
Bot NameZap alerts
Include a link to this Zap?No

Later steps can map: ts, permalink.

Test it

Use sample-trigger.json as the test record. For an instant or webhook trigger, send it to the trigger once; for a polling trigger, create a matching record in the app and click Test trigger. Then test each step in order and read its output before you turn the Zap on.

{
  "message_id": "18c2f4a9b7d01e55",
  "thread_id": "18c2f4a9b7d01e55",
  "from_email": "accounts@harbor-goods.example",
  "from_name": "Harbor Goods Accounts",
  "to": "ap@northwind-studio.example",
  "subject": "Reminder: invoice #1842 is due soon",
  "date": "2026-11-24T09:14:03Z",
  "body_plain": "Hi, a friendly reminder that invoice #1842 for $1,280.00 is due on 2026-12-21. Harbor Goods Ltd.",
  "snippet": "Please find invoice INV-001842 for the November studio supplies order.",
  "labels": "INBOX, Invoices",
  "attachment_count": 1,
  "attachment_names": "INV-001842.pdf"
}

Plan and task usage

StepAppTasks
1. New email under the Invoices labelGmail0
2. Pull the invoice fieldsAI by Zapier1
3. Turn the printed total into centsCode by Zapier1
4. Build the duplicate keyCode by Zapier1
5. Look the key up in the logGoogle Sheets1
6. New invoice or duplicatePaths by Zapier0
7. Log the invoice with its keyGoogle Sheets1
8. Label the email as a duplicateGmail1
9. Tell AP about the duplicateSlack1

A typical run uses 5 tasks; the upper bound is 6, when every filter passes and the costliest paths run. Zapier does not charge tasks for triggers, Filter, Paths, Formatter, Delay, Looping, Digest, Storage, or Zapier Tables steps. AI by Zapier is counted here as 1 task; Zapier prices it by model tier, so a larger model can cost more.

Minimum plan: Professional, because of: multi-step Zap: 8 steps after the trigger; Paths by Zapier; AI by Zapier. The Free plan only runs two-step Zaps (a trigger and one action) and leaves out Filters, Paths, Formatter, webhooks, AI by Zapier, and premium apps.

Customize

  • Drop the amount from the key if suppliers re-issue invoices with corrected totals under the same number and you want those flagged too.
  • Send the duplicate alert by email to the bookkeeper instead of Slack if AP is one person.

Time saved

Minutes per duplicate caught, and the cost of one double payment usually exceeds a year of Zapier.

Files

FileWhat it is
zap.jsonThe Zap, step by step, in schema 1.0.0.
zap.yamlThe same document in YAML.
sample-trigger.jsonFictional trigger record for the first test.
diagram.pngThe step list, drawn like the Zapier editor.
code/parse-money.jsPaste-ready Code by Zapier step.
code/invoice-key.jsPaste-ready Code by Zapier step.