Quickbooks Module
The Quickbooks module owns QuickBooks Online credentials, sync transactions, webhook processing, data matching, and accounting-related Filament administration.
Location
src/Modules/Quickbooks
Main Responsibilities
- Store OAuth credentials used for external integrations.
- Queue and process QuickBooks sync transactions.
- Handle QuickBooks webhook events.
- Match payments, deposits, invoices, and imported accounting data.
- Provide Filament admin resources for accounting sync operations.
- Provide diagnostic and reporting console commands.
Runtime Registration
QuickbooksServiceProvider registers:
- Config under the
quickbookskey. - Module migrations.
- Module views under the
quickbooksnamespace. - Web and API routes.
- The QuickBooks Filament panel provider.
- The
SyncRequestedevent listener. - Selected QuickBooks console commands.
The provider listens for SyncRequested and sends it to CreateSyncJob.
Important Config
The main config file is:
src/Modules/Quickbooks/config/quickbooks.php
Important environment variables include:
QUICKBOOKS_EXTERNAL_ID_KEY=quickbooks
QUICKBOOKS_EVENT_BUS_CHANNEL=qbo-events
The config also contains default account/item IDs and sync restriction flags for invoice, payment, deposit, and end-of-month behavior.
Console Commands
The provider registers these commands:
php artisan quickbooks:implant-qbo-key
php artisan quickbooks:get-invoice
php artisan quickbooks:report-invoice-mismatches
Other command classes exist in the module for targeted sync work. Confirm provider registration before relying on one in an environment.
Key Classes
| Area | Classes |
|---|---|
| Credentials | OAuthCredential, QboCredentialBroker |
| Sync Models | SyncTransaction, BankDeposit |
| Controllers | QboManager, ObjectSyncController, DataBrokerController, HooksHandler |
| Jobs | ProcessSyncTransaction, MatchData, HandleEvent, GenerateInvoiceMismatchReport |
| Events | SyncRequested, SyncStarted, SyncCompleted, SyncFailed |
| Listeners | CreateSyncJob and sync transaction state listeners |
| Filament | QuickBooks panel, clusters, resources, and actions for customers, products, vendors, documents, payments, deposits, and transactions |
Operational Notes
Start with SyncTransaction when debugging a sync. It records the sync object, status, and lifecycle state.
The OAuthCredential model is general enough to support more than QuickBooks. Check the credential broker and external_id_key before changing credential behavior.