Skip to content
NEWError doctor and Watchtower: failed n8n runs explained in plain words, and emailed to you. See what is new

Library / Finance, Invoices & Accounting

Finance, Invoices & Accounting

Collect Xero invoice payments with Stripe Payment Links via WhatsApp

When an API call/webhook arrives, it processes financial data using Data Table, Slack, Stripe.

What it does

## Collect Xero invoice payments with Stripe Payment Links on WhatsApp ### How it works This workflow listens for Xero invoice webhooks, verifies the webhook signature, and processes approved sales invoices. For each eligible invoice, it checks whether a Stripe Payment Link already exists; if not, it fetches contact details, validates a WhatsApp number, creates a Stripe price and payment link, saves it, and sends it via WhatsApp. A separate Stripe payment-success path records paid invoices back into Xero, handles Stripe fees with an optional journal entry, and updates the local link/payment tracking table. Failure and duplicate-payment branches notify Slack. ### Setup steps - Configure the Xero webhook URL and signing secret, and set up Xero API/OAuth credentials with access to invoices, contacts, payments, and manual journals. - Configure Stripe credentials for creating prices/payment links and for the payment-succeeded trigger; ensure Stripe metadata includes enough invoice/link identifiers for reconciliation. - Set up the n8n Data Tables used for payment-link lookup, saved links, sent/paid status, and account configuration mappings. - Configure the WAHA host/session settings for WhatsApp number checks and message sending. - Connect Slack credentials and choose channels for duplicate payment and workflow failure alerts. - Review the Xero tenant ID, Stripe product/price parameters, Xero bank/account codes, fee journal account codes, and WhatsApp message template values in the code and HTTP request nodes. ### Customization Customize the invoice eligibility filter, WhatsApp message wording, Stripe Payment Link options, duplicate-payment alert behavior, and Xero account mappings for your chart of accounts and collection process.

The steps

  1. When Xero Invoice Triggered
  2. Compute Signature
  3. If Signature Matches
  4. Respond with HTTP 200
  5. Extract Events From Invoice
  6. Fetch Xero Invoice Data
  7. Prepare Invoice Data
  8. Filter Approved Sales Invoices
  9. Find Payment Link
  10. If Payment Link Exists
  11. Fetch Xero Contact Info
  12. Build Stripe Payment Request
  13. Verify WhatsApp Number
  14. Confirm Number Validity

35 steps in total.

Similar automations