> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comforthub.app/llms.txt
> Use this file to discover all available pages before exploring further.

# QuickBooks

> Customers, items, invoices and payments: what the engine writes there and what it reads back

QuickBooks is where money is counted. The engine writes customers, items and invoices into it, and reads each invoice's totals back to check they agree. Nobody types an invoice into QuickBooks by hand.

## What QuickBooks holds, and who writes it

| Record   | Written by                       | When                                                                                                                                       |
| -------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Customer | the engine                       | a customer is created here, or its name, email, phone or address changes, or the address of one of its properties changes                  |
| Item     | the engine                       | a product is created, or its name, description, code, type or price changes. The item is made inactive when the product is deleted in Zoho |
| Invoice  | the engine                       | an invoice is made here and has no QuickBooks copy yet                                                                                     |
| Payment  | Helcim, the pay page's processor | a customer pays on the pay page                                                                                                            |
| Void     | the engine                       | an invoice is voided here, or its work order is cancelled                                                                                  |

The invoice number in QuickBooks is our INV number, so the two are always the same document.

## Payments

QuickBooks does not call the engine, and nothing here goes looking through QuickBooks for payments. A payment made on the pay page is posted into QuickBooks by the processor, and recorded here by the engine at the same time; the engine does the rest of the paperwork from its own record. See [How payments work](/handbook/payments/how-payments-work). A payment the office types into QuickBooks by hand reaches nothing else, and the nightly check finds the difference.

## Rules worth knowing

* A payment must be applied to an invoice. A payment with no invoice is flagged for a person and nothing else happens.
* The method shown in Zoho says how the customer paid: Credit Card for a card, ACH for a bank transfer. The CRM's list also holds Cash, Cheque and e-Transfer for payments taken another way.
* A void in QuickBooks is recognised by its zeroed amounts and the "Voided" note QuickBooks writes; QuickBooks puts no status on an invoice.
* Every night the monitor compares each live invoice's total here, in QuickBooks and in Zoho, and its balance where the pay page keeps the accounting, and holds a condition open in Sentry for any that differ by more than two cents. See [Monitor checks](/reference/monitor-checks) and [How the monitor works](/handbook/running/how-the-monitor-works).

## Where the keys live

The QuickBooks connection is an app authorised once by the owner. Its client id and secret sit in the functions' secret group; its refresh token rotates on every use and is kept in the engine's own token table, never in a page or a repo. See [Environments and secrets](/systems/environments-and-secrets).

## Related

* [How payments work](/handbook/payments/how-payments-work)
* [How invoicing works](/handbook/invoicing/how-invoicing-works)
* [Who is the source of truth](/systems/who-is-the-source-of-truth)
