Automated PayPal Sale to QuickBooks Online Sales Receipt (n8n)

Streamline e-commerce accounting by automatically syncing PayPal transactions to QuickBooks with fee reconciliation.

Tools: PayPalQuickBooks

Platform: n8n

Short Answer

A fully automated n8n workflow that catches new PayPal payments via webhooks, creates or updates customers in QuickBooks, and generates a Sales Receipt accounting for both the item income and the PayPal service fee.

The Problem

Manual entry of PayPal transactions into QuickBooks often misses the distinction between Gross Amount and Transaction Fees. This leads to unbalanced books, incorrect sales tax reporting, and hours of manual reconciliation at the end of the month.

The Outcome

A fully automated n8n workflow that catches new PayPal payments via webhooks, creates or updates customers in QuickBooks, and generates a Sales Receipt accounting for both the item income and the PayPal service fee.

Step-by-Step Guide

1. **Setup PayPal Webhook**: Start with a 'Webhook' node in n8n. Set the HTTP Method to POST. In your PayPal Developer Dashboard, point the Webhook URL to your n8n production URL and select the `PAYMENT.SALE.COMPLETED` event. 2. **Create QuickBooks Credentials**: Add a QuickBooks Online node. Authenticate using OAuth2. Ensure you have the 'Accounting' scope selected in your Intuit developer portal. 3. **Search for Customer**: Use the QuickBooks node with the 'Resource: Customer' and 'Operation: Get All' action. Use a filter expression: `{{ $json.payer.payer_info.email }}` to see if the user already exists. 4. **Logic Branch (IF Node)**: Add an 'IF' node to check if the search result from Step 3 returned an ID. 5. **Create/Update Customer**: If the IF node is 'false', use a QuickBooks node to 'Create' a customer using the PayPal name and email data. 6. **Set Variables (Set Node)**: Use a 'Set' node to map PayPal's `amount.total` (Gross) and `transaction_fee.value` (Fee). Use n8n expressions to ensure they are formatted as numbers: `{{ parseFloat($json.amount.total) }}`. 7. **Map Product/Service**: Use a 'Set' node or a 'Switch' node to map the PayPal `item_name` to your specific QuickBooks 'Product/Service ID'. If not found, set a default 'General Sale' ID. 8. **Calculate Line Items**: In the QuickBooks 'Create Sales Receipt' node, add two line items: - Line 1: Income (Gross Amount). - Line 2: PayPal Fee (as a negative amount) mapped to your 'Bank Fees' expense account. 9. **Configure Deposit Account**: In the Sales Receipt node settings, set the 'Deposit To' field to your 'PayPal Bank' asset account in QuickBooks. 10. **Error Handling**: Create a separate 'Error Trigger' workflow. Use a 'Sticky Note' to link the two, ensuring any failed API calls (like 401 Unauthorized or 400 Bad Request) alert you via Slack or email.