Quickbooks Module

Integration Filament CLI

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 quickbooks key.
  • Module migrations.
  • Module views under the quickbooks namespace.
  • Web and API routes.
  • The QuickBooks Filament panel provider.
  • The SyncRequested event 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

AreaClasses
CredentialsOAuthCredential, QboCredentialBroker
Sync ModelsSyncTransaction, BankDeposit
ControllersQboManager, ObjectSyncController, DataBrokerController, HooksHandler
JobsProcessSyncTransaction, MatchData, HandleEvent, GenerateInvoiceMismatchReport
EventsSyncRequested, SyncStarted, SyncCompleted, SyncFailed
ListenersCreateSyncJob and sync transaction state listeners
FilamentQuickBooks 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.