Skip to content

The moment it happens

Create PDF invoices from your order form

Each order from your form gets a numbered PDF invoice saved to Drive and a row in your Invoices sheet.

Runs
The moment it happens
Apps
Google Drive, Google Sheets
AI
Not needed
Access
Drive write; Sheets read+write

Send this to your assistant

Create a ClickRuntime automation: when my order form posts to the trigger link, create a PDF invoice with the next invoice number, save it to my Drive 'Invoices' folder and add a row to my Invoices sheet.

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

A small catering business takes orders through a form on its website. After each event, the owner opens a word processor template, types in the customer, items and prices, works out the next invoice number from last month's file, and saves a PDF. Numbers get skipped or repeated, and the list of what has been invoiced lives only in a folder.

Generating the invoice the moment an order comes in gives every customer a proper invoice with a unique number and keeps a running list for your accounts. Caterers, makers and small service businesses use it to invoice without accounting software.

What you get out of it

  • Invoice numbers are never repeated

    Each invoice takes the next number in sequence, which keeps your records tidy and your accountant happy.

  • Every invoice is filed

    PDFs are saved to one Drive folder, so you can find any invoice by customer or number.

  • A ledger that keeps itself

    Each invoice adds a row with date, customer and total, which gives you a running record of sales.

  • No retyping order details

    Customer details and items come from the order form, so prices and names are not copied by hand.

How it works

What happens, step by step

  1. ClickRuntime starts as soon as your order form sends a new order.

  2. It ignores an order it has already invoiced, so a repeated delivery does not create a second invoice.

  3. It creates a PDF invoice with the next invoice number, the customer's details and the items ordered, and saves it to your Drive Invoices folder.

  4. A row with the invoice number, date, customer, total and a link to the PDF is added to your Invoices sheet.

Before it runs live

  • Connect Google Drive
  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Create PDF invoices from your order formjust nowSucceeded
Google Sheets · Invoices1043 | 2026-10-18 | Acme Events Ltd | 1,860.00 | Invoice 1043.pdf

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
  • 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 Drive and Google Sheets 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.
invoice_pdfs_generated_from_orders.pyexample
import io
from datetime import date
from reportlab.pdfgen import canvas
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseUpload
from clickruntime import on_event, credentials, state

FOLDER_ID, SHEET_ID = "your-invoices-folder-id", "your-spreadsheet-id"

@on_event
def handle(event):
    if state.get(f"done:{event.event_id}"):
        return {"skipped": "duplicate"}
    order = event.json
    number = (state.get("last_number") or 1000) + 1
    total = sum(i["qty"] * i["price"] for i in order["items"])
    buf = io.BytesIO(); pdf = canvas.Canvas(buf)
    lines = [f"Invoice {number}", f"Date: {date.today()}", f"Bill to: {order['name']}", ""] +             [f"{i['qty']} x {i['item']} @ {i['price']:.2f}" for i in order["items"]] + ["", f"Total: {total:.2f}"]
    for n, line in enumerate(lines):
        pdf.drawString(60, 780 - n * 18, line)
    pdf.save()
    creds = Credentials(credentials.connection("google", "work"))
    f = build("drive", "v3", credentials=creds, cache_discovery=False).files().create(body={"name": f"Invoice {number}.pdf", "parents": [FOLDER_ID]},
        media_body=MediaIoBaseUpload(io.BytesIO(buf.getvalue()), mimetype="application/pdf"), fields="webViewLink").execute()
    build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Invoices!A:E",
        valueInputOption="USER_ENTERED", body={"values": [[number, str(date.today()), order["name"], total, f["webViewLink"]]]}).execute()
    state.set("last_number", number)
    state.set(f"done:{event.event_id}", True)
    return {"invoice": number}

FAQ

Common questions

What does the invoice include?
Your business details, the invoice number and date, the customer's name and address, each item with quantity and price, and the total. You can add payment terms and bank details.
How is the invoice number chosen?
It continues from the last number used, starting from any number you choose, for example 1001. Each order gets the next one.
Does it email the invoice to the customer?
It saves the PDF and logs it. Emailing the invoice can be added so the customer receives it with the order confirmation.
What permissions does it need?
Drive write; Sheets read+write. 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 for each event the app sends.
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 “Create PDF invoices from your order form” from your assistant

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