Skip to content

Every 15 min + polling the sheet

Log 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.

Runs
Every 15 min + polling the sheet
Apps
Google Sheets, QuickBooks
AI
Yes, uses the built-in AI allowance
Access
accounting write; sheet editor; Gmail read

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, read new invoice emails, pull out vendor, amount and due date with AI and add a row to my AP sheet; when I mark a row Approved, create the bill in QuickBooks.

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

Supplier invoices arrive by email to whoever placed the order. Some get forwarded to the bookkeeper, some get lost, and a few are paid twice. Nobody has a single list of what's owed and what's been approved.

Logging each invoice in a shared payables sheet gives one list to review. Creating the QuickBooks bill only after someone marks it Approved keeps control with a person while removing the data entry.

What you get out of it

  • One list of what you owe

    Every emailed invoice lands in the same sheet, so nothing is lost in a personal inbox.

  • Approval stays with you

    Bills reach QuickBooks only after someone marks them Approved, so unchecked invoices never enter the books.

  • No typing from PDFs

    Vendor, amount and due date are filled in for you, leaving only a check.

  • Fewer double payments

    A bill number recorded against each row shows at a glance which invoices are already in QuickBooks.

How it works

What happens, step by step

  1. Every 15 minutes, ClickRuntime checks your Gmail for new emails with the Invoices label.

  2. AI reads each email and picks out the vendor, amount and due date.

  3. It adds a row for each invoice to your AP sheet, with the status left as New.

  4. When you change a row's status to Approved, the next run creates the bill in QuickBooks and marks the row Done.

  5. Emails and rows already handled are remembered, so nothing is logged or billed twice.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect QuickBooks

What you get

RunsEvery 15 min + polling the sheet
Log emailed supplier invoices in a sheet and create bills once approvedtoday, 9:00Succeeded
Google Sheets · APNorthwind Supplies · 1,280.00 · due 2026-11-15 · New

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

  • Act only on the items that match your own rules, and skip the rest
  • Change what the AI looks for, or how it writes the result
  • 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

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.
vendor_bills_from_emailed_invoices_logged_in_a_sheet.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, state, ai, 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()

SCHEMA = {"type": "object", "properties": {"vendor": {"type": "string"}, "amount": {"type": "number"}, "due": {"type": "string"}}}

@on_trigger
def run(event):
    gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
    done = set(state.get("done") or [])
    msgs = [m for m in gmail.users().messages().list(userId="me", q="label:Invoices newer_than:7d").execute().get("messages", []) if m["id"] not in done]
    rows = sheets.values().get(spreadsheetId=SHEET_ID, range="AP!A2:E").execute().get("values", [])
    approved = [(i, r) for i, r in enumerate(rows, start=2) if len(r) >= 4 and r[3] == "Approved"]
    report_fetched(len(msgs) + len(approved))
    if not msgs and not approved:
        return {"summary": "Nothing new"}
    for m in msgs:
        snippet = gmail.users().messages().get(userId="me", id=m["id"]).execute()["snippet"]
        f = ai.generate(f"Extract vendor, amount and due date (YYYY-MM-DD):\n{snippet}", json_schema=SCHEMA, max_output_tokens=80).json
        sheets.values().append(spreadsheetId=SHEET_ID, range="AP!A:E", valueInputOption="USER_ENTERED", body={"values": [[f["vendor"], f["amount"], f["due"], "New"]]}).execute()
        done.add(m["id"])
    for i, (vendor, amount, due, *_) in approved:
        v = qb("GET", "/query", params={"query": f"select * from Vendor where DisplayName = '{vendor}'"})["QueryResponse"]["Vendor"][0]
        bill = qb("POST", "/bill", json={"VendorRef": {"value": v["Id"]}, "DueDate": due, "Line": [{"Amount": float(amount),
                  "DetailType": "AccountBasedExpenseLineDetail", "AccountBasedExpenseLineDetail": {"AccountRef": {"value": "7"}}}]})["Bill"]
        sheets.values().update(spreadsheetId=SHEET_ID, range=f"AP!D{i}:E{i}", valueInputOption="RAW", body={"values": [["Done", bill["Id"]]]}).execute()
    state.set("done", list(done)[-500:])
    return {"logged": len(msgs), "billed": len(approved)}

FAQ

Common questions

Which emails are read?
Messages matching your Gmail search, such as a label like Invoices or emails with PDF attachments from known suppliers.
What if AI reads a figure wrong?
That's why the approval step exists. Correct the row before marking it Approved and the bill uses your corrected values.
Do scanned paper invoices work?
Text-based PDFs and invoices written in the email body work best. Scanned images need a text-recognition step first.
What permissions does it need?
accounting write; sheet editor; Gmail read. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new 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 “Log emailed supplier invoices in a sheet and create bills once approved” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.