Sync Stripe Payments to QuickBooks Online (n8n)
Automate financial reconciliation by syncing Stripe transactions to QuickBooks using n8n's visual node-based workflows.
Tools: Stripe → QuickBooks Online
Platform: n8n
Short Answer
A fully automated pipeline that detects Stripe payments, calculates net income vs. fees using n8n expressions, ensures customer records are synced, and creates a Sales Receipt in QuickBooks instantly.
The Problem
Businesses using Stripe often struggle with 'broken' reconciliation because Stripe payouts are minus fees, making it hard to match bank deposits to Gross sales. Manually entering every transaction leads to human error and delayed financial reporting.
The Outcome
A fully automated pipeline that detects Stripe payments, calculates net income vs. fees using n8n expressions, ensures customer records are synced, and creates a Sales Receipt in QuickBooks instantly.
Step-by-Step Guide
1. **Create Workflow & Webhook**: In n8n, add a 'Stripe Trigger' node. Set the event to `payment_intent.succeeded`. Copy the Webhook URL and paste it into your Stripe Dashboard.
2. **Configure Credentials**: For Stripe, use your Secret API Key. For QuickBooks Online, use the n8n OAuth2 credential type to authorize access to your sandbox or production company.
3. **Search for Existing Customer**: Add a 'QuickBooks Online' node. Set Resource to `Customer` and Operation to `Get All`. Use a filter expression: `{{ $json.customer_email }}` to see if the user already exists.
4. **Handle Logic (If Node)**: Use an 'If' node to check if the search returned a result. If length is `0`, route to a QuickBooks 'Create Customer' node.
5. **Format Stripe Data**: Stripe provides amounts in cents (e.g., 1000 for $10). Add a 'Set' or 'Code' node. Use the expression `{{ $json.amount / 100 }}` to convert to decimals.
6. **Map Line Items**: In the QuickBooks 'Create Sales Receipt' node, map the total amount and link it to your specific 'Service/Product' ID from QBO.
7. **Handle Stripe Fees**: To ensure reconciliation, create a second line item in the Sales Receipt with a negative value using `{{ ($json.fee / 100) * -1 }}` mapped to a 'Bank Fees' expense account.
8. **Implement Error Handling**: Create an 'Error Trigger' node. Connect it to a Slack or Email node so you are notified if a QuickBooks API limit is hit or if a tax code is missing.
9. **Deploy**: Set the workflow to 'Active' to start processing live webhooks.
Data Mapping
| Stripe Field | n8n Expression (Mapping) | QuickBooks Field | Notes |
| :--- | :--- | :--- | :--- |
| `customer.email` | `{{ $json.data.object.receipt_email }}` | Customer Email | Primary Key for matching |
| `amount` | `{{ $json.data.object.amount / 100 }}` | Total Amount | Convert cents to decimal |
| `id` | `{{ $json.data.object.id }}` | Private Note / Memo | For cross-referencing |
| `created` | `{{ DateTime.fromSeconds($json.created).toISO() }}` | Transaction Date | Convert Unix to ISO 8601 |
| `currency` | `{{ $json.currency.toUpperCase() }}` | Currency | Must match QBO enabled currencies |
Gotchas & Failure Modes
- **The 'Cents' Trap**: n8n treats Stripe data exactly as received. If you don't divide by 100, a $10 payment will record as $1,000 in QuickBooks.
- **Rate Limiting**: QuickBooks API has strict concurrency limits. If processing bulk historical data, use the **Split In Batches** node with a 1-second delay to avoid 429 errors.
- **Tax Code Requirement**: Many QBO instances require a `TaxCodeRef`. Hardcode a 'Non-Taxable' ID if you aren't calculating tax in this workflow.
- **Webhook Security**: Ensure you use the 'Stripe Trigger' node rather than a generic Webhook node to benefit from built-in signature verification.
Verification Checklist
- [ ] Trigger a test payment in Stripe Test Mode; verify n8n Webhook node receives data.
- [ ] Check n8n 'Execution Log' to ensure the 'If' node correctly branched to 'Create Customer' or 'Update'.
- [ ] Open QuickBooks and verify the Sales Receipt reflects the Gross amount and correctly formatted date.
- [ ] Ensure the 'Fee' line item is negative and the total 'Net' matches the Stripe payout.
- [ ] Verify that n8n credentials are set to 'Production' before moving out of sandbox testing.
Ready to Automate?
Build this automation with n8n in minutes.