Nightly QuickBooks invoices for unpaid Acuity appointments
Every night at 8pm, sweep yesterday's completed Acuity appointments that are still unpaid and open matching QuickBooks invoices with a Sheets audit log.
Every night at 8pm my practice's local time, run a deterministic code workflow that reconciles yesterday's Acuity Scheduling appointments against QuickBooks Online and logs every invoice created to a Google Sheets audit tab. This is a node-based flow, not an agent.
Step 1. Pull yesterday's appointments. Use Acuity Scheduling List Appointments with minDate set to yesterday at 00:00:00 and maxDate set to yesterday at 23:59:59 in the practice's local timezone (Acuity accepts any strtotime-parseable value, e.g. "2026-07-16T00:00:00-0500"). Paginate by advancing minDate to the last returned appointment's datetime with direction=ASC until the page is short. Keep only appointments whose paid field equals the string "no" (Acuity returns paid as a string, not a boolean) and whose email field is a non-empty string. Skip anything already flagged paid or missing an email.
Step 2. For each remaining appointment, find or create the QuickBooks customer. Call QuickBooks Query Entities with a SQL-like query: SELECT * FROM Customer WHERE PrimaryEmailAddr = '<client email>'. If exactly one match comes back, reuse that customer's Id. If no match, call QuickBooks Create Customer with the client's first name, last name, email, and phone from the Acuity appointment payload, and use the new Id.
Step 3. Create the invoice. Call QuickBooks Create Invoice with the customer Id from step 2 and a single line item whose description is the Acuity appointment type name and whose amount is the appointment's price. Acuity returns price as a decimal string like "150.00", so parse it to a number before sending. Set the invoice due date to the run date plus 14 days (net-14). Include the client's email on the invoice's billing address so QuickBooks can send it.
Step 4. Log the run. Call Google Sheets Append Values to add one row to the practitioner's "Acuity Invoices" audit tab with these columns in order: Appointment ID (Acuity's id), Client Name (firstName plus lastName), Session Type (Acuity's appointmentType or type), Amount (the parsed decimal), Invoice Number (DocNumber from the QuickBooks Create Invoice response), and Timestamp (ISO 8601 timestamp of the moment the invoice was created).
Guardrails. Never invoice an appointment that is already marked paid in Acuity, and never invoice an appointment missing a client email. On any per-appointment error (QuickBooks validation failure, missing customer data, network blip), log the failure with the appointment ID and continue to the next appointment so one bad row does not block the rest of the batch. Do not send Slack or email notifications. The Google Sheets tab is the entire audit trail.
Additional information
What does this prompt do?
- Every night at 8pm, we pull yesterday's finished Acuity appointments and pick out the ones that are still unpaid.
- For each unpaid appointment with a client email, we open a matching invoice in QuickBooks Online with the session type, the price, the client's contact info, and a net-14 due date.
- Anything already marked paid in Acuity or missing an email is left alone so you can handle it manually.
- Every invoice we create lands as a new row in a Google Sheets audit tab with the appointment ID, client name, session type, amount, invoice number, and timestamp.
What do I need to use this?
- An Acuity Scheduling account with your appointments and client details.
- A QuickBooks Online account you invoice from, connected to the same practice.
- A Google Sheets file with a tab reserved for the invoice audit log.
How can I customize it?
- Change the 8pm run time or shift it to a weekly cadence for lower-volume practices.
- Adjust the due date from net-14 to net-7, net-30, or any other terms your practice uses.
- Choose which columns show up in the audit tab, or point the log at a different Google Sheet.
Frequently asked questions
What happens if a client already paid at the appointment?
What if an appointment does not have a client email on file?
Will this create duplicate customers in QuickBooks?
Can I change the due date from net-14?
How do I know the invoice actually went out?
Related templates
Stop chasing unpaid Acuity appointments by hand.
Turn every night's finished sessions into clean QuickBooks invoices with a Sheets audit trail, all without manual data entry.