Skip to content

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.

Paste it into your assistant. It tells you what it will send or change before it runs live.

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

  1. On the 1st of each month, ClickRuntime pulls last month's general ledger and transaction list from QuickBooks.

  2. It turns them into a CSV with the date, type, number, name, memo, account and amount of each transaction.

  3. You get the CSV by email, ready for your accountant or a spreadsheet.

Before it runs live

  • Connect QuickBooks

What you get

RunsMonthly
Get last month's ledger as CSVtoday, 9:00Succeeded
Email · Ledger for September 2026Date,Transaction Type,Num,Name,Memo,Account,Amount 2026-09-03,Invoice,1027,Northwind Traders,,Accounts Receivable,1500.00

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
export_ledger_and_transactions_for_a_period.pyexample
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?
The most recent completed calendar month. For example, the export that runs on the first of March covers all of February. Fixing the range this way means files do not overlap or leave gaps between months.
Does the export include voided or deleted transactions?
The general ledger report shows posted entries as QuickBooks reports them. Voided transactions appear with zero amounts, while deleted ones appear in the audit log, which is a separate report. Say if you need the audit log included.
What if my files are too large to email?
Very active companies can produce ledger files beyond typical attachment limits. In that case the report can be split by account or week, or compressed, so each message stays under the limit your mail provider allows.
What permissions does it need?
read. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (monthly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

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.