Shopify Order to QuickBooks Sales Receipt Sync (n8n)
Automate real-time financial reconciliation and inventory updates using n8n's visual workflow engine.
Tools: Shopify → QuickBooks
Platform: n8n
Short Answer
Every paid Shopify order automatically generates a corresponding Sales Receipt and Customer profile in QuickBooks. This ensures the Chart of Accounts is updated instantly, and inventory levels stay synchronized across both platforms.
The Problem
Manual entry of Shopify orders into QuickBooks is time-consuming and prone to human error, leading to taxing reconciliation issues. Without real-time syncing, inventory valuations and cash flow reporting are constantly out of date.
The Outcome
Every paid Shopify order automatically generates a corresponding Sales Receipt and Customer profile in QuickBooks. This ensures the Chart of Accounts is updated instantly, and inventory levels stay synchronized across both platforms.
Step-by-Step Guide
1. **Establish Credentials**: In n8n, go to 'Credentials' and add 'Shopify' (API Key/Access Token) and 'QuickBooks Online' (OAuth2). Ensure the Shopify scope includes `read_orders` and `read_customers`.
2. **Setup Shopify Webhook**: Add a 'Shopify Trigger' node. Set the 'Event' to `Order Paid`. Copy the Webhook URL provided by n8n and ensure it is registered in your Shopify Admin if not using n8n's automatic registration feature.
3. **Extract Customer Data**: Add a 'QuickBooks Online' node (Action: Search) to check if the `email` from Shopify exists in QuickBooks.
4. **Conditional Logic (IF)**: Process the search result. If no customer is found, use another QuickBooks node to 'Create Customer' using the Shopify billing address and name.
5. **Format Line Items**: Shopify provides line items as an array. Use an n8n 'Code' node or 'Set' node with the `splitOut` function (or a 'Split In Batches' node) to ensure each item's SKU matches your QuickBooks Item 'Name' or 'ID'.
6. **Map Sales Receipt**: Add the 'QuickBooks Online' node (Action: Create Sales Receipt). Map the Shopify `order_id` to the QuickBooks `DocNumber` to prevent duplicates. Map total price, tax, and the looped line items.
7. **Handle Taxes**: Use an n8n 'Expression' to map Shopify's `total_tax` to the appropriate QuickBooks `TaxCodeRef`. You may need a 'Switch' node if you handle multiple tax jurisdictions.
8. **Implement Error Handling**: Create an 'Error Trigger' workflow. If the QuickBooks API returns a 401 or 429, set the workflow to 'On Error -> Continue' and route to a 'Wait' node or log the failure to a Google Sheet for manual review.
Data Mapping
| Shopify Field | QuickBooks Field | n8n Expression / Transformation | Required |
| :--- | :--- | :--- | :--- |
| `customer.email` | `Customer.PrimaryEmailAddr` | `{{ $json.customer.email }}` | Yes |
| `order_number` | `SalesReceipt.DocNumber` | `{{ "SHP-" + $json.order_number }}` | Yes |
| `line_items` | `SalesReceipt.Line` | `{{ $json.line_items.map(item => ({ ... })) }}` | Yes |
| `total_price` | `SalesReceipt.TotalAmt` | `{{ parseFloat($json.total_price) }}` | Yes |
| `total_tax` | `TaxCodeRef` | `{{ $json.total_tax > 0 ? 'TAX' : 'NON' }}` | No |
| `created_at` | `TxnDate` | `{{ $json.created_at.split('T')[0] }}` | Yes |
Gotchas & Failure Modes
- **SKU Sensitivity**: QuickBooks 'Items' must exist before a Sales Receipt can be created. If a Shopify SKU doesn't match a QuickBooks Item Name exactly, the node will fail. Use an n8n 'Lookup Table' or MySQL node to map internal SKUs if they differ.
- **Rate Limiting**: QuickBooks Online API has strict concurrency limits. If processing thousands of historical orders, use the 'Split In Batches' node with a 1-second 'Wait' node to avoid 429 errors.
- **Decimal Precision**: Shopify sends prices as strings (e.g., "10.00"). QuickBooks expects numbers. Always use `parseFloat()` in your n8n expressions to avoid data type mismatches.
- **Webhook Reliability**: Shopify webhooks may fire multiple times. Use the Shopify Order ID as the QuickBooks `DocNumber` and utilize n8n's 'Wait' or a 'Database' node to check if that ID has already been processed (Idempotency).
Verification Checklist
- [ ] **Test Webhook**: Trigger a 'Test' in the Shopify Trigger node and verify the JSON payload contains `customer` and `line_items`.
- [ ] **Credential Check**: Ensure the QuickBooks connection status shows 'Internal Error' is not present in the node execution area.
- [ ] **Dry Run**: Use a test order in Shopify and check the 'Execution Log' in n8n to ensure the QuickBooks node shows a green status.
- [ ] **Verification**: Log into QuickBooks Sandbox/Live and search for the `DocNumber` matching your test Shopify order.
- [ ] **Production Mode**: Ensure the workflow is toggled to 'Active' so it listens for production webhooks.
Ready to Automate?
Build this automation with n8n in minutes.