Quick overview
This workflow runs daily to reconcile yesterday’s successful Stripe charges in multiple currencies, converts net revenue to a single reporting currency using ApogeoAPI exchange rates, appends a dated total to Google Sheets, and posts a Slack alert if rates are stale or any charges cannot be converted.
How it works
- Runs every day at 09:00 (or manually with provided sample data for testing).
- Retrieves charges from Stripe and keeps only succeeded charges created during the previous UTC day, net of any refunded amounts.
- Fetches a full set of FX rates from ApogeoAPI in a single request using USD as the base.
- Converts each charge to the reporting currency with correct handling for zero- and three-decimal currencies, aggregates totals by currency, and computes a grand total.
- Appends one reconciliation row (date, totals, breakdown JSON, and any unconverted charges) to a Google Sheets tab.
- Posts a message to a Slack channel when exchange rates are marked stale or any charges could not be converted.
Setup
- Install the
n8n-nodes-apogeoapi community node (required for the ApogeoAPI exchange rate step).
- Add credentials for Stripe, ApogeoAPI, Google Sheets (OAuth2), and Slack.
- Update the Google Sheets document ID and ensure the sheet has a
Reconciliation tab with columns for date, reporting currency, totals, rate flags, and JSON breakdown fields.
- Set the Slack channel (for example
#finance) and adjust the reporting currency constant in the code if you don’t want USD.
- Run the manual test trigger once to validate output, then activate the scheduled workflow.