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.
- 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
- step 01
Triggers on the Stripe charge.refunded event and extracts the refund details.
- step 02
Stops unless the refund status is "succeeded", then fetches the related Stripe charge and invoice.
- 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.
- step 04
Retrieves recent Xero manual journals and checks whether one already mentions the refund ID.
- step 05
If a duplicate is found, notifies Slack and posts nothing to Xero.
- step 06
Otherwise creates a POSTED manual journal that debits the revenue account and credits the clearing account for the refunded amount.
- 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
> 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.