Add to Claude

Guides · For agents

Find unpaid invoices: match invoices to payments

Tools: sift_match, sift_countWorks with Claude Code

Join invoices to payments on the invoice number, then count the invoices with no payment and total what they are worth. In the test files, that is 6 invoices worth 4,623.75, 3 of them overdue.

Ask your agent

With Sift connected (setup takes three steps), paste this and swap in your own paths.

Use Sift to match /path/to/invoices.csv on invoice_no to /path/to/payments.csv on invoice_no, as of 2026-11-01. How many invoices have no payment, what are they worth, and how many of those are past their due_date? Then count the open invoices in invoices.csv and total the amount column.

What Sift sends back

Invoices with a payment6
Invoices with no payment6, worth 4,623.75
of which overdue3, worth 1,435.75
Payments for no invoice2
Open invoices, from sift_count7, worth 6,123.75

One unpaid invoice has a blank amount. It is counted, left out of the total, and Sift says so. It is never treated as 0.

What to do next

Questions

Why give an "as of" date?
So the count is repeatable. Overdue is measured against the date you give, never today's clock.
What if one invoice is paid in several payments?
Sift says when a key sits on several rows of the other file, as one invoice does here, so a split payment is never counted twice.

Two lists of any kind work the same way: stock against a supplier list, sign-ups against who turned up.

More guides

Guide Change prices across a list, with a dry run and an undo Guide Get a supplier's file into your booking form's layout Guide Match rent payments to tenants: who hasn't paid this month