Guides / Accounts payable / Xero

How to automate accounts payable in Xero with Hubdoc and n8n

Let Hubdoc, which comes with Xero, capture and code your bills. Add purchase order matching and review alerts with n8n. Adapted from the workflow that cut a NetSuite team’s weekly AP from 3 hours to 10 minutes.

Michelle Chan, CA (Singapore) · · 4 min read

Who this is for

Small finance teams on Xero who raise purchase orders and want every bill checked against one before it’s approved.

No purchase orders? If each supplier always maps to one account, Hubdoc’s supplier rules on their own may be all you need. Set those up and skip the n8n part.

What gets automated

  1. Capture
  2. Code by supplier rule
  3. Publish to Xero
  4. Match to PO
  5. Flag exceptions
  6. Approve in Xero
  7. Ready to pay

The first three steps run in Hubdoc. Matching and alerts run in n8n.

What you need

ServiceWhat it doesWhat to set up
XeroHolds purchase orders and billsA plan with bills and purchase orders
HubdocCaptures bills, applies supplier rules, publishes to Xero with the document attachedIncluded with Xero’s Starter, Standard and Premium plans in Singapore. Connect it to Xero and set up supplier rules.
n8nMatches new bills to POs and sends alertsn8n Cloud, or the free self-hosted edition
Xero API appLets n8n read bills and purchase ordersA web app in the Xero Developer portal, connected through n8n’s Xero credential, with read-only access. Xero’s free Starter tier allows up to 5 connected organisations and 1,000 API calls a day. Custom Connections are not available in Singapore.
SlackAlerts the reviewerAny plan

n8n’s built-in Xero node covers contacts and invoices (bills are invoices in Xero’s API). Reading purchase orders needs n8n’s HTTP Request node, using the same credential. Xero changed its API pricing in March 2026, so check developer.xero.com/pricing for current limits.

Step by step

  1. Send every bill to Hubdoc

    Give suppliers your Hubdoc email address, or forward bills to it. Hubdoc also accepts uploads and photos from its mobile app.

  2. Set a rule for each supplier

    In Hubdoc, save a supplier rule with the default account, tax rate and tracking category, and choose how bills publish to Xero. Rules apply one account per supplier, so leave suppliers whose bills span several accounts for manual coding.

  3. Hubdoc publishes the bill to Xero

    Hubdoc reads the supplier, date, amount and GST, and publishes the bill to Xero with the original document attached.

  4. n8n matches it to a purchase order

    On a schedule, n8n picks up new bills through the Xero API and looks up approved purchase orders. A bill matches when its reference quotes the PO number, or when the supplier and total match a PO exactly. Hubdoc reads totals rather than line items, so matching happens at the bill level.

  5. Exceptions go to a person

    If there’s no exact match, or the bill’s account differs from the PO’s, n8n sends a Slack message with a link to the bill. Nothing is guessed.

  6. Approve in Xero

    A person reviews each bill and approves it in Xero before it’s paid.

Test before you rely on it

Where the controls sit

Using NetSuite? Read the NetSuite version, which reads line items with the Gemini API.