On a schedule
Turn rows in a billing sheet into QuickBooks invoices
Each new row in your billing sheet becomes a QuickBooks invoice, and the invoice number is written back into the row.
- Runs
- On a schedule
- Apps
- Google Sheets, QuickBooks
- AI
- Not needed
- Access
- accounting write; sheet editor
Send this to your assistant
Create a ClickRuntime automation: every hour, create a QuickBooks invoice for each row in my Billing sheet that has no invoice number yet, and write the invoice number back to the row.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A consultancy logs billable work in a shared sheet: client, description, hours, rate. At month end the bookkeeper re-types every line into QuickBooks, which takes an afternoon and occasionally bills the wrong client.
Creating the invoice straight from the row removes the re-typing. The sheet stays the simple place the team records work, and QuickBooks gets accurate invoices without delay.
What you get out of it
No re-typing
Rows become invoices exactly as entered, which removes a whole class of copying mistakes.
Invoice sooner
Work is billed within the hour it's logged, not at month end, which brings payments forward.
A clear trail
The invoice number written back to each row shows what's been billed and what hasn't.
Keep the sheet your team knows
Nobody needs to learn QuickBooks to record billable work.
How it works
What happens, step by step
Every hour, ClickRuntime reads your Billing sheet.
It picks out rows that don't have an invoice number yet.
For each row, it finds the customer in QuickBooks, or creates them, and creates the invoice.
It writes the new invoice number back into the row, so the row is never billed twice.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect QuickBooks
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Google Sheets and QuickBooks steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, report_fetched
SHEET_ID = "your-spreadsheet-id"
API = "https://quickbooks.api.intuit.com/v3/company/1234567890" # your QuickBooks company id
def qb(method, path, **kw):
r = http.request(method, API + path, params={"minorversion": 73, **kw.pop("params", {})}, **kw, headers={"Accept": "application/json", "Authorization": "Bearer " + credentials.connection("quickbooks", "company")})
return r.raise_for_status() or r.json()
@on_trigger
def run(event):
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
rows = sheets.values().get(spreadsheetId=SHEET_ID, range="Billing!A2:D").execute().get("values", [])
todo = [(i, r) for i, r in enumerate(rows, start=2) if len(r) >= 3 and (len(r) < 4 or not r[3])]
report_fetched(len(todo))
if not todo:
return {"summary": "Nothing new"}
for i, (customer, desc, amount, *_) in todo:
name = customer.replace("'", "\\'")
found = qb("GET", "/query", params={"query": f"select * from Customer where DisplayName = '{name}'"})["QueryResponse"].get("Customer")
cust = found[0] if found else qb("POST", "/customer", json={"DisplayName": customer})["Customer"]
inv = qb("POST", "/invoice", json={"CustomerRef": {"value": cust["Id"]}, "Line": [{
"Amount": float(amount), "Description": desc, "DetailType": "SalesItemLineDetail",
"SalesItemLineDetail": {"ItemRef": {"value": "1"}}}]})["Invoice"]
sheets.values().update(spreadsheetId=SHEET_ID, range=f"Billing!D{i}", valueInputOption="RAW", body={"values": [[inv["DocNumber"]]]}).execute()
return {"invoiced": len(todo)}FAQ
Common questions
What columns does the sheet need?
What if the customer isn't in QuickBooks yet?
Can it email the invoice to the customer?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Add expenses from a sheet into QuickBooks
Expenses your team lists in a Google Sheet are added to QuickBooks within the hour and marked as uploaded.
See how it worksWelcome every new QuickBooks customer by email
Each customer you add to QuickBooks gets a welcome email from your Gmail, and is logged in a sheet so nobody is welcomed twice.
See how it worksLog emailed supplier invoices in a sheet and create bills once approved
Supplier invoices from your inbox are logged as rows in your payables sheet, and each one becomes a QuickBooks bill when you mark it Approved.
See how it worksKeep exploring
Set up “Turn rows in a billing sheet into QuickBooks invoices” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.