# Match supplier invoices to purchase orders and post to Xero, QuickBooks, or Sheets using Gmail, OpenAI, and Telegram

> Quick overview Reads invoice PDFs from Gmail, matches every one to its purchase order, asks a human on Telegram to approve anything that does not reconcile, and posts approved bills to Xero or QuickBooks exactly once. How it works 1. A Gmail trigger polls a label every five minutes and keeps only PDF attachments. The file is converted to text, then an HTTP node asks any OpenAI-compatible model for one JSON object holding vendor, invoice number, dates, currency, subtotal, tax, total, line items, VAT and PO number. 2. A code node repairs what models get wrong: decimal commas such as 1.234,56, dd/mm/yyyy dates and currency symbols, and every amount is recomputed in code. The If gate requires vendor, number, date, currency and total, and requires subtotal plus tax to equal the stated total within two cents; anything else goes to Telegram review instead of the ledger. 3. The ledger is read next (an empty sheet still lets the first invoice through) and keyed on normalised vendor plus invoice

- **Domain**: `n8n-workflow-22364.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/22364
- Page (HTML): https://agenstry.com/agents/n8n-workflow-22364.n8n.io
- Documentation: https://n8n.io/workflows/22364
