See llms.txt for all machine-readable content.

Back to Templates

Collect Xero invoice payments with Stripe Payment Links via WhatsApp

Quick overview

This workflow sends single-use Stripe Payment Links for approved Xero sales invoices via WhatsApp (using WAHA) and, when Stripe confirms payment, records the payment and Stripe fees back to the correct Xero invoice while tracking link and payment status in an n8n Data Table.

How it works

  1. Receives a POST webhook from Xero for invoice events and verifies the request using the Xero webhook signature.
  2. Extracts unique INVOICE events, fetches each invoice from the Xero API, and keeps only authorised sales invoices (ACCREC) with an amount due greater than zero.
  3. Processes invoices one by one and checks an n8n Data Table to skip invoices that already have a saved payment link.
  4. Fetches the invoice contact from Xero, formats a WhatsApp-ready phone number, and confirms via WAHA that the number exists on WhatsApp.
  5. Creates a Stripe Price and a single-use Stripe Payment Link with Xero invoice metadata, saves the link details to the Data Table, and sends the link to the customer on WhatsApp via WAHA.
  6. Triggers on Stripe payment_intent.succeeded events, ignores payments without Xero metadata, and checks the Data Table to prevent recording the same invoice as paid twice (alerting duplicates in Slack).
  7. Retrieves the Stripe charge and fee details, maps the payment to the correct Xero clearing and fee accounts, records the payment (and posts a fee journal when applicable) via the Xero API, and updates the Data Table row to paid.
  8. Sends a Slack alert with execution details whenever a production run fails.

Setup

  1. Add credentials for Xero OAuth2, Stripe, and Slack, and create a Crypto credential containing your Xero webhook key for signature verification.
  2. Set up a WAHA server and API key (HTTP Header Auth) and replace https://YOUR_WAHA_HOST plus the session name (default) wherever used.
  3. Create and select two n8n Data Tables: invoice_payment_links (to store invoice/link/status) and stripe_xero_config (to store Xero tenant-specific clearing and fee account codes, optionally by country).
  4. Replace REPLACE_WITH_YOUR_N8N_DATA_TABLE_ID in all Data Table nodes with your actual table IDs and set your Slack channel (for duplicate and failure alerts).
  5. Copy the production URL from the Xero webhook trigger and configure it in your Xero app’s Webhooks settings for Invoices so Xero can deliver events to this workflow.
  6. Ensure your Xero clearing account is enabled for payments and that Xero contact phone numbers include a country code so WhatsApp delivery checks can succeed.

Requirements

  • A Xero app with webhooks enabled and connected to your organisation
  • A Stripe account. Use test mode first.
  • A WAHA server with the default session showing WORKING
  • A Slack channel for alerts
  • A clearing account in Xero with 'Enable payments to this account' ticked, and a fees expense account. Their codes must match the stripe_xero_config table.
  • Customers' mobile numbers saved in Xero with a country code

Additional info

Connect with us:
Website: https://www.intuz.com/n8n-workflow-automation-templates/
Email: [email protected]
LinkedIn: https://www.linkedin.com/company/intuz

For Custom Workflow Automation

Get Started: https://n8n.partnerlinks.io/intuz