Automated Multi-Stage Bill Processing from Dext to QuickBooks Online (n8n)

Streamline accounts payable with intelligent vendor matching and automated attachment syncing using n8n workflows.

Tools: DextQuickBooks

Platform: n8n

Short Answer

A self-hosted or cloud-based n8n workflow that triggers on Dext publication, cross-references QuickBooks vendors, creates missing records, and pushes high-fidelity financial data with the source PDF attached automatically.

The Problem

Manual entry of supplier invoices leads to human error and delayed financial reporting. While Dext extracts data, a direct integration lacks the custom logic needed for multi-step approvals, automated vendor creation, and centralized error logging required by complex accounting teams.

The Outcome

A self-hosted or cloud-based n8n workflow that triggers on Dext publication, cross-references QuickBooks vendors, creates missing records, and pushes high-fidelity financial data with the source PDF attached automatically.

Step-by-Step Guide

1. **Establish Credentials**: In n8n, navigate to 'Credentials' and setup 'QuickBooks Online OAuth2'. For Dext, create a 'Header Auth' credential using your Dext API Key. 2. **Setup Webhook Node**: Add a Webhook Node as the trigger. Set the HTTP Method to 'POST'. Copy the URL into Dext's outbound webhook settings for the 'Item Published' event. 3. **Extract & Cleanse**: Add a 'Set' or 'Edit Image' node to map incoming Dext JSON. Use expressions to format the date `{{ $json.date.toDate().toISOString() }}` and ensure currency codes match ISO standards. 4. **Vendor Verification**: Add a 'QuickBooks Online' node. Select Resource 'Vendor' and Operation 'Get All'. Use a Filter in the node to search where `DisplayName` equals the Dext 'Supplier Name'. 5. **Conditional Branching (IF Node)**: Add an 'IF' node to check if the QuickBooks vendor search returned any results. 6. **Create Missing Vendor**: If the IF node is 'False', add another QuickBooks node to 'Create' a Vendor using the supplier name and details from Dext. 7. **Dynamic Transaction Creation**: Add a QuickBooks node to 'Create Bill' (for unpaid) or 'Create Purchase' (for paid). Link the Vendor ID from the previous steps using `{{ $node["Find Vendor"].json["Id"] }}`. 8. **Binary Data Fetch**: Use an 'HTTP Request' node to GET the Dext 'Image URL'. Set the 'Response Format' to 'File' to bring the PDF into n8n's binary buffer. 9. **Attach Document**: Add a QuickBooks node with the 'Upload Attachable' operation. Map the 'File Content' from the previous binary node and link it to the Bill ID created in Step 7. 10. **Global Error Trigger**: Create a separate 'Error Trigger' node connected to a Slack or Email node to notify you if the QuickBooks API returns a 400 (validation error) or 429 (rate limit).

Data Mapping

| Dext Field | QuickBooks Field | n8n Expression / Transformation | | :--- | :--- | :--- | | `supplier_name` | `VendorRef.value` | `{{ $node["Find Vendor"].json["Id"] }}` (via Search query) | | `date` | `TxnDate` | `{{ $json["date"].split('T')[0] }}` | | `net_amount` | `Line.Amount` | `{{ Number($json["net_amount"]) }}` (Force Float) | | `tax_amount` | `TaxAmount` | `{{ Number($json["tax_amount"]) }}` | | `invoice_ref` | `DocNumber` | `{{ $json["invoice_ref"] || 'No-Ref' }}` (Default value) | | `image_url` | `Attachable` | Use HTTP Request node to fetch as Binary first |

Gotchas & Failure Modes

* **MinorVersion Requirement**: Global QuickBooks entities (UK/AU/FR) require the `minorversion` parameter (e.g., 65) in the node header to handle tax rounding correctly. * **Memory Management**: When handling large PDF attachments from Dext, ensure your n8n instance has sufficient RAM, as binary data is processed in-memory. * **Rate Limits**: QuickBooks Online API is limited to 100 requests per minute. Use the n8n 'Wait' node or 'Split in Batches' if you are bulk-publishing hundreds of items from Dext. * **Vendor Name Duplication**: QuickBooks is extremely strict about unique Display Names. Always use a 'Search' node before attempting a 'Create' operation to avoid 400 Bad Request errors.

Verification Checklist

- [ ] **Webhook Handshake**: Trigger a test publish in Dext and confirm the n8n Webhook node receives the JSON payload. - [ ] **Data Type Validation**: Ensure 'Total' and 'Tax' fields show as orange (Number) in n8n, not green (String). - [ ] **Vendor Logic**: Test with a brand new supplier to verify the 'IF' node triggers the Vendor Creation path. - [ ] **Attachment Check**: Open a created Bill in QuickBooks and verify the PDF preview is visible and not corrupted. - [ ] **Execution Log**: Check the n8n 'Executions' tab to ensure no '402 Payment Required' errors (occur if QBO subscription is inactive).

Ready to Automate?

Build this automation with n8n in minutes.