QuickBooks Online
QuickBooks Online is a cloud-based accounting software designed for small to medium-sized businesses. It provides comprehensive tools for managing finances including invoicing, bill payment, expense tracking, financial reporting, inventory management, and payment processing. QuickBooks helps businesses track income and expenses, manage cash flow, and maintain accurate financial records for tax and compliance purposes.
Authentication Types
QuickBooks Online supports 1 authentication method:
- OAuth 2.0 - Create your own Intuit app and connect each user with their QuickBooks company.
- Pros: Secure, per-user access, supports all QuickBooks features, production-ready, automatic token refresh
- Cons: Requires Intuit Developer account and app creation
- Best for: Organizations needing secure access to QuickBooks data with proper user authentication
Understanding Realm ID
QuickBooks uses a Realm ID (also called Company ID) to identify which QuickBooks company a user is accessing. It must be set in General Settings before connecting. The Realm ID is included in every API request URL to ensure operations are performed on the correct company.
Each QuickBooks company has a unique Realm ID, so users working with multiple companies will need to create separate integrations for each company.
Where to find your Realm ID
Sandbox (Development):
- Log in to the Intuit Developer Portal
- Click My Hub → Sandboxes
- The Realm ID is shown in the Company ID column next to your sandbox company
Production:
The Realm ID (Company ID) is visible in the URL when you are logged in to QuickBooks Online — it appears as a numeric value in the URL path, for example:
https://app.qbo.intuit.com/app/homepage — the Realm ID can also be found via Settings → Account and Settings → Billing & Subscription or by inspecting the URL of any QuickBooks page (look for /company/REALM_ID/).
Setting up OAuth
To use QuickBooks Online with Webrix, you need to create an app in the Intuit Developer Portal and configure OAuth 2.0 authentication.
1. Create an Intuit Developer Account
-
Go to developer.intuit.com
-
Click Sign up (or Sign in if you already have an account)
-
Complete the registration process with your email and password
-
Verify your email address
2. Create a QuickBooks Online App
-
Log in to the Intuit Developer Portal
-
Click the My Hub menu in the top right
-
Click App dashboard
-
On the App tab, click the + button
-
Enter the App name (e.g., "Webrix MCP Integration")
-
Select the appropriate scopes for your app:
- Accounting: Select this for access to QuickBooks accounting data (required)
- Payments: Select this if you need payment processing capabilities
-
Click Done (bottom right)
-
On the pop-up shown, review the details and click Confirm
-
Enable the Show credentials toggle
-
Copy your Client ID and Client Secret from the Keys section
Keep your Client Secret secure and never share it publicly. Treat it like a password.
- Click on Open app
3. Configure OAuth Settings
-
In your app dashboard, go to the Settings section
-
Under Redirect URIs tab, click Add URI
-
Copy the Redirect URI from Webrix and paste it here
tipYou can find the Redirect URI in Webrix when configuring the QuickBooks connector under the Auth settings. It will look like:
https://your-domain.com/oauth/callback -
Click Save
4. Create a Sandbox Company (Optional but Recommended)
For testing purposes, it's recommended to create a sandbox QuickBooks company:
-
In the Intuit Developer Portal, Click the My Hub menu in the top right
-
Click Sandboxes
-
Click Add
-
Select the QuickBooks Online SKU
-
Click Create
-
Wait for the sandbox company to be created (this may take a few minutes)
-
You can use this sandbox company for testing without affecting real data
5. Configure in Webrix
-
In Webrix, go to Integrations → New → Built-in
-
Select QuickBooks Online and click Use
-
Under Authentication Type, select OAuth
-
Paste your Client ID in the Client ID field
-
Paste your Client Secret in the Client Secret field
-
Under Scopes, click Add and select the permissions your integration needs:
com.intuit.quickbooks.accounting— required for all accounting data accesscom.intuit.quickbooks.payment— required for payment processingopenid,profile,email— recommended for user identity
Minimum required:
com.intuit.quickbooks.accounting -
Under General Settings, set the API Base URL based on the credentials you copied from the Intuit Developer Portal:
- If your Client ID/Secret came from the Development tab →
https://sandbox-quickbooks.api.intuit.com - If your Client ID/Secret came from the Production tab →
https://quickbooks.api.intuit.com
How to tell which environment you're usingIn the Intuit Developer Portal, open your app (My hub → App dashboard → click the app's tile) and go to Keys and credentials. You'll see two tabs: Development and Production. Use the URL that matches the tab you copied your credentials from.
- If your Client ID/Secret came from the Development tab →
-
Under General Settings, set the Realm ID (Company ID):
- For sandbox: find it in the Intuit Developer Portal under My Hub → Sandboxes (the value in the Company ID column)
- For production: find it in the QuickBooks URL when logged in (the numeric value in the URL path)
See the Understanding Realm ID section above for detailed instructions.
-
Click Save Changes
6. Test the Connection
-
After saving, click Connect to test the OAuth flow
-
You'll be redirected to Intuit's authorization page
-
Sign in to your QuickBooks account (or use sandbox credentials for testing)
-
Select the company you want to connect (if you have multiple companies)
-
Review the permissions and click Connect or Authorize
-
You'll be redirected back to Webrix with a successful connection
Production Deployment
When you're ready to move from sandbox to production:
-
In the Intuit Developer Portal, go to your app's Production section
-
Complete the App Assessment questionnaire
-
Submit your app for review (Intuit reviews apps before production access)
-
Once approved, copy the Production Client ID and Client Secret
-
Update your Webrix configuration with the production credentials
-
Users will now connect to their real QuickBooks companies instead of sandbox
Keep your development (sandbox) and production (live) configurations separate. Test thoroughly in sandbox before deploying to production.
Rate Limits
QuickBooks Online API enforces rate limits to ensure platform stability:
- 500 requests per minute per Realm ID (company)
- 10 concurrent requests maximum per company per app
- 40 batch requests per minute for batch operations
Best Practices:
- Implement exponential backoff for 429 (rate limit) errors
- Use batch operations when processing multiple records
- Use Change Data Capture (CDC) queries instead of polling for updates
- Cache frequently accessed data like accounts and items
Common Use Cases
Customer Invoicing Workflow
- Use List Customers to find or verify the customer exists
- If needed, use Create Customer to add a new customer
- Use List Items to get product/service IDs for invoice line items
- Use Create Invoice with customer ID and line items
- Optionally use Get Invoice PDF to download and email the invoice
Bill Payment Workflow
- Use List Bills to find unpaid bills (e.g., WHERE Balance > '0')
- Use Get Bill to review bill details
- Use List Accounts to find the bank account for payment
- Use Create Bill Payment to record the payment — requires
pay_type("Check" or "CreditCard"), the bank account ID, andline_itemslinking the bill IDs (each line item needsAmountand aLinkedTxnarray withTxnIdandTxnType: "Bill")
Financial Reporting
- Use Get Profit and Loss Report to analyze revenue and expenses
- Use Get Balance Sheet Report to review assets, liabilities, and equity
- Use Get Cash Flow Report to understand cash movements
- Use Get General Ledger Report for detailed transaction audit
Purchase Order Workflow
- Use List Vendors to find the vendor ID
- Use List Accounts to find an Accounts Payable account ID (AccountType = 'Accounts Payable')
- Use List Items to find inventory or non-inventory items — they must have an
ExpenseAccountRefconfigured (service items without an expense account cannot be used on POs) - Use Create Purchase Order with the vendor ID, AP account ID, and line items
Expense Tracking
- Use List Accounts to find expense accounts
- Use List Vendors to find or verify vendors
- Use Create Bill to record vendor expenses
- Use List Expenses to query and analyze spending patterns
Troubleshooting
Redirect URI Mismatch Error
If you see "redirect_uri_mismatch" during OAuth authorization.
Cause: The redirect URI configured in your Intuit app doesn't match the one being used in the OAuth flow.
Solution:
- Copy the exact Redirect URI from Webrix (including https:// and any path)
- Go to your Intuit app → Keys & OAuth → Redirect URIs
- Ensure the URI is added exactly as provided (trailing slashes matter!)
- Save changes and wait a few minutes for the changes to propagate
- Try connecting again
Invalid Realm ID Error
API requests fail with "Invalid Realm ID" or "Unauthorized" errors.
Cause: The Realm ID configured in General Settings is incorrect or does not match the company the OAuth token was granted for.
Solution:
- In Webrix, go to the QuickBooks integration → General Settings and verify the Realm ID (Company ID) value
- Find your correct Realm ID following the Understanding Realm ID instructions above
- Update the Realm ID in General Settings and click Save Changes
- Verify that the user still has access to the QuickBooks company
- Check that the company subscription is active
Token Refresh Failures
Users are repeatedly asked to reconnect or see "invalid_grant" errors.
Cause: Refresh tokens expire after 100 days of inactivity, or the app's credentials have changed.
Solution:
- If 100 days have passed, users must reconnect (this is a QuickBooks security requirement)
- Verify that the Client ID and Client Secret haven't been rotated in the Intuit Developer Portal
- Disconnect and reconnect the integration to obtain new tokens
- Ensure your app has not been deleted or disabled in the Intuit Developer Portal
Rate Limit Errors (429)
API requests fail with HTTP 429 "Too Many Requests" errors.
Cause: Exceeded the 500 requests per minute limit or 10 concurrent requests limit.
Solution:
- Implement exponential backoff retry logic (wait 1s, 2s, 4s, 8s between retries)
- Reduce the frequency of API calls
- Use batch operations when creating/updating multiple records
- Avoid polling; use webhooks or CDC queries for detecting changes
- Cache data that doesn't change frequently (accounts, items, company info)
"Stale Object" Error
Update or delete operations fail with "Stale object" error.
Cause: The SyncToken in your update request doesn't match the current version in QuickBooks. This happens when the record was modified by another process after you retrieved it.
Solution:
- Use Get [Entity] (e.g., Get Customer, Get Invoice) to fetch the latest SyncToken
- Include the current SyncToken in your update request
- If the error persists, the record was modified again - fetch the latest version
- QuickBooks uses optimistic locking to prevent concurrent update conflicts
Query Syntax Errors
Query operations fail with "Invalid query" errors.
Cause: Using unsupported SQL syntax or filtering on non-filterable fields.
Solution:
- QuickBooks query syntax is limited - no OR, JOIN, or GROUP BY operations
- Only filterable properties can be used in WHERE clauses (check API docs for each entity)
- Use single quotes around string values:
WHERE DisplayName = 'Acme Corp' - Escape special characters with backslash:
WHERE CompanyName LIKE 'O\\'Reilly' - URL-encode your query string before sending
- Maximum 1000 results per query (use pagination for more)
Permission Denied Errors
API calls fail with "403 Forbidden" or "Insufficient permissions" errors.
Cause: The access token doesn't have the required scope, or the user lacks permissions in QuickBooks.
Solution:
- Verify that you requested the correct OAuth scopes during app creation
- For accounting operations, ensure
com.intuit.quickbooks.accountingscope is included - For payment operations, ensure
com.intuit.quickbooks.paymentscope is included - Disconnect and reconnect to request the proper scopes
- Verify the user has appropriate permissions in their QuickBooks company (not all users can create/modify all records)
Validation Errors When Creating Records
Create operations fail with validation errors like "Required field missing" or "Invalid reference".
Cause: Missing required fields or referencing entities that don't exist.
Solution:
- Invoices: Must have CustomerRef and at least one Line item
- Bills: Must have VendorRef and at least one Line item with AccountRef
- Journal Entries: Must have at least 2 lines and debits must equal credits
- Items: Must have valid IncomeAccountRef for Service/NonInventory items
- Purchase Orders: Require
ap_account_id(an Accounts Payable account — use List Accounts filtered by AccountType = 'Accounts Payable'). Line items must reference items that have anExpenseAccountRefconfigured; inventory and non-inventory items typically qualify, but pure service items (with no expense account) will cause a "Select an account for this transaction" validation error. - Use List/Get tools to find valid IDs for referenced entities (customers, accounts, items, etc.)
- Check field requirements in API documentation for each entity type
Sandbox vs Production Data Mismatch
Testing works in sandbox but fails in production, or vice versa.
Cause: Different data exists in sandbox vs production environments, or different API behaviors.
Solution:
- Sandbox companies have sample data; production companies have real data
- Entity IDs (customers, accounts, items) are different between sandbox and production
- Don't hardcode IDs - always query to find the correct entities
- Test thoroughly in sandbox before deploying to production
- Be aware that some sandbox companies have limited features compared to production
Additional Resources
- QuickBooks API Documentation
- OAuth 2.0 Playground - Test OAuth flows
- API Explorer - Interactive API documentation
- Intuit Developer Community - Support forums and knowledge base
- QuickBooks Online Entities - Complete list of available entities
Need Help?
If you encounter issues not covered in this guide, please contact Webrix support with:
- The specific error message you're receiving
- The API operation you were attempting (e.g., Create Invoice, List Customers)
- Whether you're using sandbox or production environment
- Your QuickBooks subscription level (if relevant)