Automated Stripe Revenue & Fee Sync to QuickBooks Online (n8n)

Eliminate manual bookkeeping by automatically syncing Stripe transactions to QuickBooks with fee reconciliation using n8n.

Tools: StripeQuickBooks Online

Platform: n8n

Short Answer

A fully automated workflow that detects new Stripe charges, converts cents to decimals, creates or updates customers in QBO, and generates Sales Receipts that include a negative line item for Stripe fees, ensuring 1:1 bank reconciliation.

The Problem

Manual entry of Stripe sales into QuickBooks leads to human error and reconciliation headaches. Businesses often fail to account for Stripe's 'net' payouts, resulting in bank balances that don't match accounting records due to ignored processing fees.

The Outcome

A fully automated workflow that detects new Stripe charges, converts cents to decimals, creates or updates customers in QBO, and generates Sales Receipts that include a negative line item for Stripe fees, ensuring 1:1 bank reconciliation.

Step-by-Step Guide

1. **Create Credentials**: In n8n, go to 'Credentials' and add 'Stripe API' (Secret Key) and 'QuickBooks Online OAuth2'. Follow the OAuth flow to authorize n8n access to your QBO company. 2. **Stripe Webhook Node**: Add a 'Stripe Trigger' node. Set the event to `charge.succeeded`. Copy the 'Test URL' and paste it into the Stripe Dashboard (Webhooks section) to start receiving real-time data. 3. **QuickBooks Customer Search**: Add a 'QuickBooks Online' node. Set the Resource to 'Customer' and Operation to 'Get All'. Use a Filter with the expression `{{ $json["billing_details"]["email"] }}` to find an existing customer. 4. **Handle New Customers**: Add an 'IF' node to check if the Customer Search returned a result. If false, add another QBO node to 'Create' a Customer using Stripe's `billing_details.name` and `email`. 5. **Data Transformation (The Math)**: Stripe sends amounts in cents (e.g., 5000 = $50.00). Use a 'Set' node or 'Edit Fields' node. Create an expression for `GrossAmount`: `{{ $json["amount"] / 100 }}` and `FeeAmount`: `{{ $json["balance_transaction"]["fee"] / 100 }}`. 6. **Format Date**: Use the expression `{{ $now.format('yyyy-MM-dd') }}` or convert Stripe's Unix timestamp using `{{ DateTime.fromSeconds($json["created"]).toISODate() }}` to match QBO's date format. 7. **Create Sales Receipt**: Add a QBO node set to 'Sales Receipt' > 'Create'. Map the Customer ID from Step 3/4. Add two Line Items: Line 1 for Revenue (Gross) and Line 2 for Fees (as a negative value reaching your 'Bank Fees' account). 8. **Error Handling**: Connect an 'Error Trigger' node to a separate flow (like Slack or Discord) to notify you if the QBO API fails (e.g., due to a disconnected token or expired trial).