Skip to content

The moment it happens

Send a PayPal invoice from your own form or tool

When your tool sends a customer and line items to a link, a PayPal invoice goes out and you get a confirmation.

Runs
The moment it happens
Apps
PayPal
AI
Not needed
Access
REST app with invoicing (write)

Send this to your assistant

Create a ClickRuntime automation: give me a link my order form can send to. When it gets a customer email and line items, create a PayPal invoice due in 14 days, send it, and confirm in #billing on Slack.

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 freelancer or small agency takes orders from a web form, a booking tool or an internal script, then copies the details into PayPal by hand to bill the customer. That means retyping names, emails, line items and amounts, plus the risk of a typo in the total. Orders sit unbilled over the weekend, and some never get invoiced because the copy step was forgotten.

When your form or tool posts an order to the webhook, the payload is validated first, so incomplete or malformed requests are rejected rather than half processed. A draft PayPal invoice is created from the fields, sent to the customer right away, and a confirmation lands in Slack so you know it went out.

It suits businesses that sell custom work, deposits or services priced per order, where a fixed checkout page does not fit.

What you get out of it

  • Invoices go out the minute an order arrives

    Customers receive the bill while the purchase is fresh. Getting paid sooner improves cash flow, and the customer is less likely to forget about the order or dispute it later.

  • No retyping, no wrong totals

    Details move straight from the order payload into the invoice, so there is no manual copy step where an extra zero or a misspelled email can slip in and delay payment.

  • Bad requests are stopped early

    Validation catches orders missing an email or an amount before an invoice is created. You avoid sending a customer a blank or incorrect invoice, which is harder to walk back than to prevent.

  • Nothing falls through the weekend

    Orders that arrive at midnight or on a holiday are billed just as quickly as those during working hours. Revenue does not depend on someone remembering to open PayPal on Monday morning.

  • A Slack trail for each invoice

    Each confirmation message in Slack gives you a quick log of what was billed and when. If a customer says they never received an invoice, you can see that it was sent.

How it works

What happens, step by step

  1. When your own form or tool sends ClickRuntime the customer, items and amount, the automation starts.

  2. It checks that the required details are there.

  3. It creates the invoice in PayPal and sends it to the customer.

  4. A confirmation is posted to your #billing Slack channel with the invoice number, customer, amount and due date.

Before it runs live

  • Connect PayPal
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Send a PayPal invoice from your own form or tooljust nowSucceeded
Slack · #billing🧾 Invoice INV-0057 sent to ap@northwind.example: USD 860.00, due in 14 days

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 PayPal 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.
create_and_send_an_invoice_from_a_webhook.pyexample
from clickruntime import on_event, credentials, http, notify

API = "https://api-m.paypal.com"

def paypal_headers():
    resp = http.post(f"{API}/v1/oauth2/token", data={"grant_type": "client_credentials"},
                     auth=(credentials.secret("PAYPAL_CLIENT_ID"), credentials.secret("PAYPAL_CLIENT_SECRET")))
    resp.raise_for_status()
    return {"Authorization": f"Bearer {resp.json()['access_token']}"}

@on_event
def handle(event):
    data = event.json or {}
    if not data.get("email") or not data.get("items"):
        return {"created": False, "reason": "email and items are required"}
    headers = {**paypal_headers(), "Prefer": "return=representation"}
    invoice = http.post(f"{API}/v2/invoicing/invoices", headers=headers, json={
        "detail": {"currency_code": "USD", "payment_term": {"term_type": "NET_14"}},
        "primary_recipients": [{"billing_info": {"email_address": data["email"]}}],
        "items": [{"name": i["name"], "quantity": str(i.get("quantity", 1)),
                   "unit_amount": {"currency_code": "USD", "value": f"{float(i['price']):.2f}"}}
                  for i in data["items"]]})
    invoice.raise_for_status()
    inv = invoice.json()
    http.post(f"{API}/v2/invoicing/invoices/{inv['id']}/send", headers=headers,
              json={"send_to_invoicer": True}).raise_for_status()
    notify.slack(f"🧾 Invoice {inv['detail']['invoice_number']} sent to {data['email']}: "
                 f"USD {inv['amount']['value']}, due in 14 days", channel="#billing")
    return {"invoice": inv["id"]}

FAQ

Common questions

What does the order payload need to contain?
At minimum a customer email, at least one line item with a description and price, and a currency. Your form or tool can include more fields, and the validation step rejects anything that is missing what PayPal requires.
Will a duplicate submission create two invoices?
Not if the order has a unique reference. Instruct your AI assistant to skip orders whose reference was already invoiced, so a double click on a form or a retried request does not bill the customer twice.
Can the invoice be saved as a draft for me to review instead of sent?
Yes. Stop after the draft step and the invoice waits in PayPal for you to check and send manually. Many people begin that way, then switch to automatic sending once they trust the payloads. That is a good way to test.
What permissions does it need?
REST app with invoicing (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 “Send a PayPal invoice from your own form or tool” from your assistant

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