Automated Stripe Sales & Fee Reconciliation (n8n)

Achieve penny-perfect accounting by syncing Stripe transactions and processing fees to QuickBooks Online using n8n.

Tools: StripeQuickBooks Online

Platform: n8n

Short Answer

For every successful Stripe charge, n8n automatically creates or updates the customer in QuickBooks, generates a Sales Receipt for the gross amount, and records the Stripe fee as a separate expense, ensuring your Stripe Clearing Account matches exactly.

The Problem

Manual entry of Stripe sales into QuickBooks leads to human error and data silos. Furthermore, because Stripe payouts are 'net' of fees, simply syncing the payout amount makes bank reconciliation impossible without manually accounting for every processing fee.

The Outcome

For every successful Stripe charge, n8n automatically creates or updates the customer in QuickBooks, generates a Sales Receipt for the gross amount, and records the Stripe fee as a separate expense, ensuring your Stripe Clearing Account matches exactly.

Step-by-Step Guide

1. **Setup Stripe Trigger**: Add a 'Stripe Trigger' node. Set the event to `payment_intent.succeeded`. Create a Webhook via the node credentials to link your Stripe account. 2. **Fetch Processing Fees**: Add a 'Stripe' node (Action: Get). Use an expression to pass the `balance_transaction` ID from the trigger. This is crucial to extract the exact fee amount. 3. **Standardize Currency**: Stripe provides amounts in cents (e.g., 1000). Add a 'Set' node or use expressions to divide both Gross Amount and Fee by 100 to get decimal values (10.00). 4. **QuickBooks Credentials**: Add a 'QuickBooks Online' node. Connect your QBO account using OAuth2 credentials in n8n. 5. **Find/Create Customer**: Configure the QBO node to 'Search' for a customer by email. Link an **IF Node** to check if a result was returned. If not, add another QBO node to 'Create' the customer using Stripe email/name data. 6. **Create Sales Receipt**: Add a QBO node (Action: Create Sales Receipt). Map the 'Total Amount' to the gross amount from Stripe and link it to the Customer ID from the previous step. 7. **Map Income Account**: In the Sales Receipt node, specify your 'Income Account' (e.g., Sales) and set the 'Deposit To' account to a custom 'Stripe Clearing' Asset account (not your main bank account). 8. **Record Expense (The Fee)**: Add another QBO node (Action: Create Expense). Map the 'Total Amount' to the fee value retrieved in Step 2. Set 'Account' to 'Bank Charges/Stripe Fees' and 'Payment Account' to 'Stripe Clearing'. 9. **Configure Error Handling**: Right-click the workflow canvas and add an 'Error Trigger' node. Connect it to a Slack or Email node to notify you if a QBO API limit is hit or a mapping fails. 10. **Test with Sandbox**: Run the workflow in 'Manual' mode and trigger a test payment in Stripe's Developer mode to verify the n8n execution log.

Data Mapping

| Field Category | Stripe Source Field | QBO Destination Field | n8n Expression Example | | :--- | :--- | :--- | :--- | | **Customer** | `{{ $json.customer_details.email }}` | `Email` | `{{ $json["email"] }}` | | **Sales Amount** | `{{ $json.amount }}` | `Total Amount` | `{{ $json["amount"] / 100 }}` | | **Fee Amount** | `{{ $node["Stripe"].json.fee }}` | `Total Amount (Expense)` | `{{ $json["fee"] / 100 }}` | | **Reference** | `{{ $json.id }}` | `Document Number` | `Stripe-{{ $json["id"] }}` | | **Currency** | `{{ $json.currency }}` | `Currency` | `{{ $json["currency"].toUpperCase() }}` | | **Account** | *Static Value* | `Deposit To Account` | `Stripe Clearing Account` |

Gotchas & Failure Modes

• **Amount Format**: n8n receives Stripe amounts as integers (cents). Always divide by 100 in an expression or QBO will record a $10 payment as $1,000. • **Rate Limiting**: QuickBooks Online has strict API limits. If processing high-volume batches from Stripe, use the 'Wait' node or 'Split In Batches' node to prevent 429 Errors. • **Draft Invoices**: If you use Stripe Invoices, ensure you trigger off `invoice.paid` rather than `payment_intent` to avoid duplicate entries for the same transaction. • **Self-Hosting Memory**: If running n8n on a small VPS, heavy data transformations can spike RAM. Ensure your Docker container has at least 2GB allocated for large financial syncs.

Verification Checklist

- [ ] **Webhook Active**: Check n8n 'Active' toggle and confirm Stripe Dashboard shows 'Enabled' status for the webhook. - [ ] **Customer Deduplication**: Verify that re-running a transaction for an existing customer doesn't create a duplicate QBO contact. - [ ] **Net Balance Check**: Ensure (Gross Sales Receipt) minus (Stripe Fee Expense) in QBO equals the actual 'Net' amount shown in your Stripe Payout. - [ ] **Execution History**: Open n8n 'Executions' tab and confirm all nodes show green status after a live test payment. - [ ] **Credential Refresh**: Ensure QBO OAuth2 connection doesn't expire (n8n usually handles refresh tokens automatically, but check on first sync).

Ready to Automate?

Build this automation with n8n in minutes.