See llms.txt for all machine-readable content.

Back to Templates

Onboard vendors and 3-way match invoices with Xero and Google Sheets

Quick overview

Onboard vendors and pay only matched invoices: AI verification with human approval, 3-way invoice matching within 2% tolerance, approved Xero payments, and a full Sheets audit trail — the whole procure-to-pay loop in one flow, unlike 18447, 12662 and 22172.

How it works

  1. Receives a vendor onboarding submission via a webhook and uses OpenAI to extract structured vendor details.
  2. Validates the vendor’s tax ID, bank account, and contact email, then emails the vendor for missing info and logs the submission to the Google Sheets Vendors tab if incomplete.
  3. Logs valid vendor submissions to Google Sheets and sends a Gmail approval request to the owner.
  4. If approved, creates the vendor as a contact in Xero, appends an approved record (including ContactID) in Google Sheets, and emails the vendor a welcome message; if rejected, logs the rejection and emails the vendor.
  5. Receives an invoice via a second webhook, normalizes key fields, and checks Google Sheets to confirm the vendor’s latest status is approved.
  6. If the vendor is not approved, emails Accounts Payable and logs the invoice as a hold in the Google Sheets Invoices tab.
  7. If the vendor is approved, reads PO and receipt data from Google Sheets, performs a 3-way match within the configured tolerance, and emails Accounts Payable plus logs the invoice as a mismatch hold when it fails.
  8. For matched invoices, requests owner approval via Gmail, then creates an ACCPAY bill in Xero and records a payment via the Xero Payments API, logs the paid result to Google Sheets, and emails both the owner and vendor; rejected payments are logged and sent to Accounts Payable.

Setup

  1. Create and connect credentials for OpenAI, Gmail (OAuth2), Google Sheets (OAuth2), and Xero (OAuth2).
  2. Create a Google Sheet with tabs named Vendors, POs, Receipts, and Invoices, and update the Google Sheet ID in both CONFIG nodes.
  3. In the CONFIG nodes, set your owner and AP email addresses, Xero tenant ID, Xero bank account ID for payments, and (optionally) the expense account code and match tolerance percentage.
  4. Copy the two webhook URLs (vendor-onboarding and invoice-received) and configure your vendor intake form and invoice intake source to POST the required fields to them.

Additional info

Onboard vendors and pay only matched invoices: a new vendor is verified by AI and human-approved (a Xero contact is created on approval), then each invoice is matched three-way against the purchase order and goods receipt within a 2% tolerance, payment is human-approved, the Xero bill is created and paid, and every step is logged to Google Sheets. Unlike 18447, which validates supplier onboarding documents but stops before any invoice, matching, approval or payment, and unlike 12662, which matches invoices three-way and creates a Xero bill but has no vendor onboarding, no approval gate and never pays, and unlike 22172, which routes invoice approvals on a two-way match (invoice vs PO only, no goods receipt) with no onboarding, no Xero and no payment, workflow-13 runs the whole procure-to-pay loop in one flow — vendor verification and approval, Xero contact creation, 3-way invoice matching, approved payment, and a complete Sheets audit trail.