Free n8n template

Receipt capture and matching n8n template (Gmail to QuickBooks Online)

What it does

This n8n template watches a receipts inbox, has Claude read each photo or PDF into strict JSON, pulls QuickBooks Online purchases within a few days of the receipt date, and scores them on amount with tip tolerance, date, merchant name and card digits. Clear matches are logged with the purchase ID and its current account, and everything else goes to the bookkeeper in Slack. You need Gmail, QuickBooks Online, Google Sheets, Slack and an Anthropic API key.

What this workflow does

  1. Receipts inbox polls a dedicated address, such as receipts@yourcompany.com, for new emails with attachments. People forward or photograph receipts straight to it.
  2. Config holds your QuickBooks company ID, the date window for matching and the tip tolerance.
  3. Build extraction request sends the first PDF or image to Claude.
  4. Claude: read receipt returns receipt type, merchant, date, subtotal, tax, tip, total, currency, last four card digits, items and a short category hint through structured outputs.
  5. Parse receipt rejects unreadable images, non-receipts and receipts without a date or total, then builds a QuickBooks query for purchases within the window.
  6. QBO: purchases near date pulls those card and bank purchases from QuickBooks Online.
  7. Match to transaction scores every candidate: exact amount, or a higher charge within the tip tolerance; closeness of date; merchant name against the payee, memo and line descriptions; and a bonus when the card digits appear in the account name. Only a score of 0.75 or more with a clear lead over the runner-up counts as a match.
  8. Matched? sends matches to Append to matched receipts and everything else, including API errors, to Send to bookkeeper.

Before you import

  • A current n8n version.
  • A dedicated receipts mailbox in Gmail or Google Workspace.
  • QuickBooks Online with bank and card feeds already creating purchases.
  • A Google Sheet with a “Matched receipts” tab using the headers in the sheet node.
  • An Anthropic API key and a Slack bot for the bookkeeper’s channel.

Setup

  1. Import the JSON file and connect the Gmail, Anthropic, QuickBooks Online, Google Sheets and Slack credentials.
  2. In Receipts inbox, replace REPLACE_WITH_RECEIPTS_INBOX_ADDRESS.
  3. In Config, replace REPLACE_WITH_QBO_COMPANY_ID. Keep matchWindowDays at 3 to 5 and raise tipTolerancePct if your team tips more than 25 percent on card slips.
  4. Replace REPLACE_WITH_SHEET_ID and REPLACE_WITH_SLACK_CHANNEL.
  5. Rename card accounts in QuickBooks to include the last four digits, for example “Visa 4242”, so card matching can break ties between cardholders.

Test it

Pick three recent card charges in a QuickBooks sandbox or your live file. Email the receipts for two of them, one itemized and one card slip with a handwritten tip, plus a photo of something that is not a receipt. Expect two rows in the sheet with the right purchase IDs and the third in Slack as receipt_not_a_receipt. Then send a receipt from a day with two charges of the same amount and confirm it lands in Slack as two_close_matches.

Make it production-ready

  • Attach and categorize. Once matches look right, upload the image to the matched purchase through QuickBooks’ attachments API and apply the account from your merchant history table. The sheet’s attached_in_qbo column is there to track that step.
  • Receipts before charges. Receipts often arrive before the charge posts. Store unmatched receipts in a pending table and retry them daily for a week.
  • Error workflow. Set one in the workflow settings.
  • More channels. Add a Google Drive folder or WhatsApp Business photos as extra triggers feeding the same extraction step.
  • Weekly chase. List charges with no receipt per cardholder and send each person their own list.
  • Model choice. claude-haiku-5-5 is a cheaper option for clear printed receipts. Test it on faded thermal paper first.

Read the full guide, how to automate receipt capture and categorization, or talk to Lumeor if you want this connected to Ramp or Xero.

Next steps