Quick overview
This workflow listens for Stripe refund and dispute events, posts succeeded refunds to Xero as manual journals using a country-based mapping table, and sends Slack alerts for duplicates, disputes, and refund-sync failures.
How it works
- Triggers when Stripe sends a
charge.refunded event and extracts the refund details from the webhook payload.
- Stops processing unless the refund status is
succeeded, then fetches the related Stripe charge and invoice.
- Looks up the customer’s invoice country in an n8n Data Table and maps it to the correct Xero tenant ID plus clearing and revenue account codes.
- Retrieves recent Xero manual journals and checks whether a journal narration already contains the Stripe refund ID.
- If a duplicate is detected, posts a Slack message and skips posting anything to Xero.
- If no duplicate is found, creates and posts a POSTED Xero manual journal that debits the revenue account and credits the clearing account for the refund amount.
- Separately, triggers on Stripe
charge.dispute.created, fetches the disputed charge details, and posts a Slack alert containing the dispute amount, customer, reason, evidence deadline, and Stripe dashboard link.
- If any step in the refund sync path fails, posts the failing step and error details to Slack via an error workflow trigger.
Setup
- Create and connect credentials for Stripe (API key), Xero (OAuth2 connection to your organisation), and Slack (access to your target channel).
- Replace
REPLACE_WITH_YOUR_N8N_DATA_TABLE_ID with your n8n Data Table ID and populate the table with columns country, xero_tenant_id, revenue_account, and clearing_account (one row per country code you sell to).
- Update the Slack channel in the Slack steps (for duplicate refund alerts, dispute alerts, and failure alerts) to the channel you want to notify.
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