Documentation Index
Fetch the complete documentation index at: https://docs.getlago.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Sync your Lago billing data to QuickBooks Online automatically using this community-maintained integration. It uses n8n as middleware to transform Lago webhooks into QuickBooks API calls — so your accounting records stay in sync with your billing, without lifting a finger.How it works
The integration uses n8n (a workflow automation platform) as middleware between Lago and QuickBooks Online.What gets synced
| Lago Event | QuickBooks Action | Description |
|---|---|---|
customer.created | Create/Update Customer | Creates customer record with billing details |
customer.updated | Update Customer | Updates existing customer information |
invoice.created | Create Invoice | Creates invoice with line items and taxes |
invoice.one_off_created | Create Invoice | Creates one-off invoice |
credit_note.created | Create Credit Memo | Creates credit memo for refunds/adjustments |
invoice.payment_status_updated | Create Payment (if succeeded) | Records successful payments |
invoice.voided | Void Invoice | Voids invoice in QuickBooks |
Key features
Auto-create customers
Exact tax override
Duplicate prevention
Item mapping
Batch processing
Retry logic
Prerequisites
Required accounts
Required accounts
- Lago account with API and webhook endpoints access
- QuickBooks Online account (Essentials, Plus, or Advanced)
- n8n instance — n8n Cloud or self-hosted
QuickBooks developer setup
QuickBooks developer setup
- Create a QuickBooks Developer account
- Create a new app in the Developer Portal
- Note your Client ID and Client Secret
- Set the OAuth2 redirect URI to
https://your-n8n-instance.com/rest/oauth2-credential/callback
Technical requirements
Technical requirements
- n8n version 0.235.0 or higher
- HTTPS endpoint for webhook receiver (required for production)
- QuickBooks Online API access (included with QB Online subscriptions)
Installation
Deploy the n8n workflow
- Import from file
- Import from URL (n8n Cloud)
- Download
lago-quickbooks-main.jsonfrom the GitHub repository - In n8n, go to Workflows → Add workflow
- Click the ⋮ menu → Import from file
- Select the downloaded file and click Import
Configure QuickBooks OAuth2 credentials
- In n8n, click + → Credentials → Add credential
- Search for QuickBooks OAuth2 API
- Fill in the details:
| Field | Value |
|---|---|
| Credential name | QuickBooks OAuth2 |
| Client ID | From QuickBooks Developer Portal → Your App → Keys & credentials |
| Client Secret | From QuickBooks Developer Portal → Your App → Keys & credentials |
| Environment | sandbox for testing, production for live data |
| Scope | com.intuit.quickbooks.accounting |
- Click Connect my account, authorize in QuickBooks, then Save
Configure the workflow
HMAC Signature node
Open the Verify HMAC Signature node and edit theCONFIG object:| Field | Required | Description |
|---|---|---|
LAGO_WEBHOOK_SECRET | Yes | From Lago → Settings → Webhooks → Secret |
QB_ENVIRONMENT | Yes | sandbox for testing, production for live |
QB_REALM_ID | Yes | Your QuickBooks company ID (see below) |
QB_DEFAULT_ITEM_ID | Yes | Default QuickBooks Item ID — see Item mapping |
QB_DISCOUNT_ACCOUNT_ID | No | Account ID for discounts/credits |
BYPASS_SIGNATURE | No | Skip signature verification (dev only) |
How to find your QB_REALM_ID
How to find your QB_REALM_ID
https://app.qbo.intuit.com/app/homepage?realmId=123456789The number after realmId= is your Realm ID. Alternatively, use the API Explorer and look for CompanyInfo.Id.How to find your QB_DEFAULT_ITEM_ID
How to find your QB_DEFAULT_ITEM_ID
https://qbo.intuit.com/app/item?id=1 — here, the Item ID is 1.Item Mappings Config node
Open the Item Mappings Config node and edit theMAPPINGS object:Get your webhook URL
- In n8n, open the workflow and click the Lago Webhook Receiver node
- Copy the Production URL (e.g.,
https://your-n8n.com/webhook/lago-webhook)
Configure Lago webhooks
- In Lago, go to Settings → Webhooks → Add a webhook endpoint
- Paste the n8n webhook URL from the previous step
- Enable HMAC signature (strongly recommended)
- Copy the Signature secret and paste it into the
LAGO_WEBHOOK_SECRETfield in n8n - Set
BYPASS_SIGNATURE: falsefor production
Item mapping
Item mapping connects Lago billing items to QuickBooks products/services, so you can track revenue by product line. When Lago sends an invoice, each fee includes anitem.code (e.g., "premium_plan"). The workflow looks it up in ITEM_MAPPINGS and uses the matched QuickBooks Item ID — or falls back to ITEM_FALLBACK_ID if there’s no match.
Find your QuickBooks Item IDs
List your Lago item codes
code field on each item.Tax mapping
The integration uses QuickBooks’ tax override feature — Lago’s exact tax amounts show up in QuickBooks, regardless of QB’s own tax rates. No recalculation, no rounding surprises. Under the hood:- Line items are marked
TAXorNONbased on Lago data - The exact tax total from Lago is set via
TxnTaxDetail.TotalTax - The API uses
minorversion=70to enable the override
Find your Tax Code ID
Troubleshooting tax issues
Troubleshooting tax issues
QB_TAX_CODE_ID is set and points to a taxable code (not “NON”).QuickBooks recalculates tax — Ensure minorversion=70 is in the API URL. The workflow includes this by default — check the node settings if you’ve modified things.Understanding the flow
Workflow architecture
Event flows
Customer Created/Updated
Customer Created/Updated
DisplayName — updates if found, creates if not.Invoice Created
Invoice Created
DocNumber.Credit Note Created
Credit Note Created
Payment Status Updated
Payment Status Updated
succeeded creates a QB Payment. Other statuses are logged and skipped.Invoice Voided
Invoice Voided
Error handling
Retries
Rate limiting
Duplicate prevention
Missing customers
Scaling
| Limit | Value |
|---|---|
| Requests per minute | 500 |
| Concurrent requests | 10 |
| Per-second limit | 10 |
| Scenario | Throughput | Time for 10k invoices |
|---|---|---|
| Default (10 concurrent) | ~100/min | ~100 minutes |
| Optimized (parallel) | ~300/min | ~33 minutes |
Testing
Always test in QuickBooks Sandbox (QB_ENVIRONMENT: 'sandbox') before going to production.
Checklist
- Customer sync: Create/update customer in Lago → verify in QB
- Invoice creation: Create invoice in Lago → verify items and tax in QB
- Credit note: Create credit note → verify credit memo in QB
- Payment: Mark invoice as paid → verify payment in QB
- Duplicate prevention: Send same invoice twice → only one in QB
- Tax calculation: Tax amount in QB matches Lago exactly
- Item mapping: Correct QB items are used
Troubleshooting
Webhook not received in n8n
Webhook not received in n8n
- Check the webhook URL in Lago settings
- Verify the workflow is Active in n8n
- Check n8n firewall/network settings
HMAC validation fails
HMAC validation fails
- Verify
LAGO_WEBHOOK_SECRETmatches Lago exactly - Check for extra spaces when copying the secret
QuickBooks authentication fails
QuickBooks authentication fails
- Re-authorize the OAuth2 credential in n8n
- Verify Client ID and Secret are correct
Tax amounts don't match
Tax amounts don't match
- Check
QB_TAX_CODE_IDis set and points to a taxable code (not “NON”) - Verify
minorversion=70is in the API URL (included by default)
Production checklist
Before going live:-
QB_ENVIRONMENTset toproduction -
BYPASS_SIGNATUREset tofalse -
QB_REALM_IDmatches your production company - Item mappings configured and tested
-
QB_TAX_CODE_IDconfigured (if using tax) - QuickBooks OAuth2 credential authorized for production
- Lago webhook endpoint configured with HMAC enabled
- n8n workflow set to Active
- Error notifications configured (email/Slack)