Monthly
Get last month's ledger as CSV
On the 1st, the general ledger and invoice list for the previous month arrive in your inbox ready for your accountant.
- Runs
- Monthly
- Apps
- QuickBooks
- AI
- Not needed
- Access
- read
Send this to your assistant
Create a ClickRuntime automation: on the 1st of every month, email me last month's QuickBooks general ledger and a list of invoices as CSV text.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Accountants and auditors regularly ask for the general ledger and a transaction list for a period, and in QuickBooks Online that means running reports, choosing date ranges, setting columns and exporting each file. If you do it each month, small differences in settings make the files inconsistent, and a forgotten export becomes an urgent request in the middle of a close.
At the end of each month, ClickRuntime fetches the general ledger report and the transaction list for the closed period from QuickBooks, builds CSV text from them with the same columns every time, and emails the files to you. Your bookkeeper receives identical layouts month after month, which makes them easy to load into other tools.
Companies that hand data to an outside accountant, a lender or an analyst benefit most from a predictable monthly package.
What you get out of it
Month-end packages are ready on time
The files arrive as soon as the month closes. A lender, board member or accountant asking for numbers gets them the same day instead of waiting for someone to find time to run reports.
Reports use identical settings each time
Manual exports vary with who ran them and what filter they last used. A scripted export gives you the same columns and ranges, so comparing March to April is a straightforward diff.
Audit trails are built as you go
Keeping each month's ledger in your mailbox creates a series of snapshots. If an entry is edited later, you can see what the ledger said at the time of the close.
Analysis is possible outside QuickBooks
CSV text loads into spreadsheets, BI tools and databases. Finance can build pivot tables or reconcile against a bank feed without needing a QuickBooks seat for every analyst. Everyone works from the same numbers.
You avoid last-minute scrambles
Requests from your accountant at filing time become a forward, not a project. The data has been sitting in your inbox since the month ended, correct for the period it covers.
How it works
What happens, step by step
On the 1st of each month, ClickRuntime pulls last month's general ledger and transaction list from QuickBooks.
It turns them into a CSV with the date, type, number, name, memo, account and amount of each transaction.
You get the CSV by email, ready for your accountant or a spreadsheet.
Before it runs live
- 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
- Run it at a different time, more or less often, or only on weekdays
- 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 QuickBooks steps into one automation
Under the hood
The code that runs this automation
import csv, io
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, notify
REALM_ID = "1234567890"
API = f"https://quickbooks.api.intuit.com/v3/company/{REALM_ID}"
def qb(method, path, **kw):
headers = {"Authorization": f"Bearer {credentials.connection('quickbooks', 'company')}", "Accept": "application/json"}
resp = http.request(method, f"{API}{path}", headers=headers, params={"minorversion": 73, **kw.pop("params", {})}, **kw)
resp.raise_for_status()
return resp.json()
def query(sql):
return qb("GET", "/query", params={"query": sql})["QueryResponse"]
def rows(section, out):
for row in section.get("Row", []):
if "ColData" in row:
out.append([c.get("value", "") for c in row["ColData"]])
rows(row.get("Rows", {}), out)
return out
@on_trigger
def run(event):
end = date.today().replace(day=1) - timedelta(days=1)
span = {"start_date": end.replace(day=1).isoformat(), "end_date": end.isoformat()}
gl = qb("GET", "/reports/GeneralLedger", params=span)
invoices = query(f"select * from Invoice where TxnDate >= '{span['start_date']}' "
f"and TxnDate <= '{span['end_date']}' maxresults 1000").get("Invoice", [])
buf = io.StringIO()
w = csv.writer(buf)
w.writerow([c["ColTitle"] for c in gl["Columns"]["Column"]])
w.writerows(rows(gl["Rows"], []))
w.writerows([[], ["Invoice", "Date", "Customer", "Total", "Balance"]])
w.writerows([i["DocNumber"], i["TxnDate"], i["CustomerRef"]["name"], i["TotalAmt"], i["Balance"]] for i in invoices)
notify.email_me(f"QuickBooks ledger {end:%B %Y}", buf.getvalue()[:100_000])
return {"invoices": len(invoices)}FAQ
Common questions
Which period does each export cover?
Does the export include voided or deleted transactions?
What if my files are too large to email?
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
Hear when daily sales look unusual
You get an email on mornings when yesterday's sales were far above or below normal.
See how it worksCatch overdue invoices nobody emailed
A daily list of overdue invoices that were never sent to the customer, so they don't sit forgotten.
See how it worksGet a Friday sales and cash summary
Every Friday you see what was invoiced, what was collected and what is still outstanding, compared with last week.
See how it worksKeep exploring
Set up “Get last month's ledger as CSV” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.