Skip to content
agents/en vrai

Post every Stripe refund to Xero as a journal entry and get alerted on disputes

When Stripe reports a succeeded refund, the agent fetches the charge and invoice, applies a country-to-Xero-account table, checks that no journal already exists for that refund, then posts a manual journal to Xero. It also alerts Slack on duplicates, new disputes (amount, reason, evidence deadline) and failures.

L3 autonomousVerified sourceBased on official documentation we checked; not tested by us yet.Updated
Difficulty
Advanced
Setup time
≈ 1 h 30 (estimate, excluding accounting review)
Estimated cost
n8n: €0 self-hosted or from €20/month; Stripe, Xero and Slack: your existing plans (no AI cost)
Category
Small business & freelancers

⏱ Trigger

Stripe charge.refunded and charge.dispute.created events (webhook)

✋ Human approval

The template posts journals directly into Xero (POSTED status): test first with a Xero demo organisation and your Stripe test key, and have your accountant review the country-to-accounts table. Disputes are alerts only; nothing is sent back to Stripe.

→ Output

Xero manual journals + Slack alerts (duplicate, dispute, error)

Autonomy level 3 — Autonomous: Runs end to end on its own; only low-risk actions (read, notify, archive).

01Connected tools

02What the agent does on its own

  1. step 01

    Triggers on the Stripe charge.refunded event and extracts the refund details.

  2. step 02

    Stops unless the refund status is "succeeded", then fetches the related Stripe charge and invoice.

  3. step 03

    Looks up the invoice country in an n8n Data Table and maps it to the Xero tenant ID plus clearing and revenue account codes.

  4. step 04

    Retrieves recent Xero manual journals and checks whether one already mentions the refund ID.

  5. step 05

    If a duplicate is found, notifies Slack and posts nothing to Xero.

  6. step 06

    Otherwise creates a POSTED manual journal that debits the revenue account and credits the clearing account for the refunded amount.

  7. step 07

    On charge.dispute.created, posts the amount, customer, reason, evidence deadline and Stripe dashboard link to Slack; any sync failure is also sent to Slack.

03Agent instructions

$ instructions.txt · replace the {VARIABLES}
> This card uses no LLM prompt: the logic is deterministic. To prepare: the Data Table {COUNTRY_TABLE} with columns country, xero_tenant_id, revenue_account, clearing_account (one row per country you sell to); the Slack channel {ALERT_CHANNEL}.

04Limits and legal points

Needs Stripe (API key), Xero (OAuth2) and Slack credentials, and an n8n version with Data tables. Replace the template's placeholder Data Table ID. It handles refunds, not lost disputes or Stripe fees. A wrong account mapping creates wrong journals: it does not replace your accountant.

05In short

When does the agent run, and what does it produce?
Trigger: Stripe charge.refunded and charge.dispute.created events (webhook). Output: Xero manual journals + Slack alerts (duplicate, dispute, error).
What stays under your control?
The template posts journals directly into Xero (POSTED status): test first with a Xero demo organisation and your Stripe test key, and have your accountant review the country-to-accounts table. Disputes are alerts only; nothing is sent back to Stripe. Autonomy level 3 — Autonomous: Runs end to end on its own; only low-risk actions (read, notify, archive).
How much does it cost and how long does setup take?
Estimated cost: n8n: €0 self-hosted or from €20/month; Stripe, Xero and Slack: your existing plans (no AI cost). Setup time: ≈ 1 h 30 (estimate, excluding accounting review), difficulty "advanced". Tools: Stripe – Webhooks, n8n – Data tables, n8n – HTTP Request, Xero – Manual Journals API, n8n – Slack.

Answers taken from this recipe · updated 9 November 2026

06Source

https://n8n.io/workflows/22206-sync-stripe-refunds-to-xero-and-send-dispute-alerts-with-slack/

07Related recipes

Same category or same connected tools.

All recipes in "Small business & freelancers" →

→ monthly newsletter

3 agents en vrai.
Every month.

Three reproducible, sourced autonomous agents. No hype, no "top 100 tools". One-click unsubscribe.