Browse the docs

Agent setup guide

Job → PayPal Invoice

A finished job or order becomes a PayPal invoice from your rates, with the math checked in code; after your approval PayPal sends it.

Available About 15 min to set up

What it does

A finished job or order becomes a PayPal invoice from your rates, with the math checked in code; after your approval PayPal sends it.

  • Starts when your job system, store or a form posts a finished job.
  • AI turns it into invoice lines from the job and your rates; lines without a known price stay TBD and are flagged.
  • Totals are recalculated in code before anyone sees them — never by the AI: each line (quantity × rate), the subtotal, markups and the total; anything the AI got wrong is corrected and flagged to the reviewer, and lines it couldn't price stay TBD.
  • A person approves every invoice and can edit any of it; code then checks the email and that no price is TBD.
  • Creates the draft in PayPal and sends it only when PayPal's own total equals the approved total; you get an email with the link.

What it needs

  • A paid plan (agents run live on paid plans).
  • An AI provider key (Settings → AI Providers).
  • PayPal: the Client ID and Secret of your own REST app (developer.paypal.com → Apps & Credentials, Live tab; a PayPal Business account).
  • A job system, store or form that can post the finished job to a webhook.

What it doesn't do

  • It never charges cards, refunds or moves money: PayPal emails the customer a link to pay.
  • It doesn't add taxes, discounts or fees that aren't in your rules or the job.
  • It doesn't chase payment (see PayPal Overdue Invoice Reminder).

Availability and plans

Available

Its workflow is built and tested, and every app it needs is live. You can get it and set it up now.

Included free on the Enterprise plan; on other paid plans it's a one-time purchase per workspace (the price is on the Agents page). The Agents page in the app always shows its current status.

Before you start

  • A paid plan: agents run live, and the Free plan only runs Dry Runs.
  • An AI provider key (OpenAI, Anthropic, Google and more) in Settings → AI Providers. AI usage is billed by your provider.
  • These apps, connected in Settings → Integrations: PayPal.
  • A form, app or system that can send each new item to a webhook URL (the agent starts from a webhook).
  • About 15 minutes.

Set it up step by step

Get the agent first (buy it, or it's already yours when your plan includes it), then in Agents → My agents press “Set up this agent”. That creates the agent's workflow in your workspace (it counts towards your plan's workflow limit) and opens the canvas with a setup checklist above it. Each item links to the exact place to go and ticks itself off when it's done.

1. Connect your AI provider

The AI steps run on your own key (OpenAI, Anthropic, Google and more). Add one in Settings → AI Providers.

2. Connect PayPal

Connect PayPal with your REST app's Client ID and Secret (Settings → Integrations → PayPal).

3. Paste your rates

Open “Prepare the invoice” and replace the placeholder with your rates and invoice rules.

SettingWhat to enterIn step
Your rates and invoice rulesReplace the placeholder with your currency, rates and prices, how lines are named, your invoice note and what must be true before sending. It starts as “[YOUR DEFAULT CURRENCY (E.G. USD), YOUR RATES AND PRICES (HOURLY RATE, CALL-OUT FEE, PRICE LIST), HOW LINE ITEMS ARE NAMED, YOUR INVOICE NOTE AND WHAT MUST BE TRUE BEFORE AN INVOICE IS SENT]” until you replace it.“Prepare the invoice”

4. Pick your PayPal account

Open “Create the PayPal draft” and “Send it from PayPal” and pick your PayPal connection.

SettingWhat to enterIn step
PayPal accountYour PayPal connection (Live). Pick your connected PayPal account.“Create the PayPal draft”
PayPal account (send)The same PayPal connection. Pick your connected PayPal account.“Send it from PayPal”

5. Your email

Enter your email on “Tell your team”.

SettingWhat to enterIn step
Your email (sent invoices)Who hears about each invoice sent (up to 5, comma-separated). Replace the example address. It starts as “you@your-business.example” until you replace it.“Tell your team”

6. Test it with Dry Run

Press Dry Run: the agent runs on sample data with no messages sent and nothing written to your apps.

7. Switch the trigger on

Open the trigger, copy its webhook URL and secret into your job system or form, and switch it on.

How it works

The agent is a normal workflow with 15 steps (1 AI step, with a person approving in Reviews). You can open, edit and monitor it like any other workflow.

  • Job or order finished — Starts when your form or app sends data to the agent's webhook URL. Your job system, store or a form posts the finished job here: customer, email and what was done or sold (quantities and prices, or hours).
  • Prepare the invoice — AI step (runs on your AI provider key). AI turns the job into invoice lines from your rates (quantity × price; the math is rechecked in code next) and writes the note for the customer.
  • Check the math — Step. Recomputes every line (quantity × price) and the total in code — not by AI — fills the review summary from the checked figures and flags anything the AI got wrong. Lines without a price stay TBD.
  • Approve the invoice — A person approves or rejects it in Reviews (the run waits). A person checks the customer, every line, the checked total and the note in Reviews, edits them if needed and approves. Nothing is created in PayPal before this approval.
  • Not approved — Kept in the run history. Branch: Rejected. Rejected: nothing was created in PayPal.
  • Check before creating — Step. Branch: Approved. In code, after approval: one valid customer email, a total that is a number (no TBD lines left) and no placeholders in the note.
  • Passes the checks? — Decision: picks the branch to follow. Invoices that pass are created in PayPal; the rest are held for a person.
  • Held — Kept in the run history. Branch: Held. The approved invoice failed a check (email, a TBD price or a leftover placeholder); nothing was created. The reason is in the run history.
  • Create the PayPal draft — PayPal: Create a draft invoice. Branch: Passes. Creates a draft invoice in PayPal with the approved lines (PayPal adds them up).
  • Compare PayPal's total — Step. In code: PayPal's total for the draft must equal the checked, approved total before anything is sent.
  • Totals match? — Decision: picks the branch to follow. Matching totals are sent; a mismatch leaves the draft in PayPal for you.
  • Draft left in PayPal — Kept in the run history. Branch: Mismatch. PayPal's total differs from the approved total (for example a tax rule in PayPal): the draft stays unsent for you to check.
  • Send it from PayPal — PayPal: Send an invoice. Branch: Match. PayPal emails the invoice to the customer with a link to pay.
  • Tell your team — Sends an email from your workspace's sender. Emails you that the invoice was sent, with its PayPal link.
  • Sent — Kept in the run history. The run history keeps the job, the approved invoice and PayPal's ids.

Test it with Dry Run

Press Dry Run in the canvas. The agent runs on the sample data stored on its trigger (the “Sample data for Dry Run” box), so you can check every step's output before anything is live. Edit the sample to match the fields your own form or app sends.

Sample data fields

job_reference, customer_name, customer_email, company, currency, work_done.

  • Nothing is sent or written: app actions, emails and Slack posts are simulated, and AI steps don't call your AI provider.
  • Approval steps use the Dry Run decision you pick in the step's settings (approved, rejected or timeout), so you can try each branch.

Go live

  • Open the trigger, copy its webhook URL and secret into your job system or form, and switch it on.
  • The webhook is protected by a secret: send it in the header shown in the Activation panel (requests without it are refused with 403). Each request starts one run.
  • The setup checklist adds a “paid plan” item before activation: live runs need a paid plan (the Free plan only runs Dry Runs).
  • When every checklist item is done and the trigger is on, the checklist says “Live — this agent is running”. Follow its runs in the workflow's History tab and in Analytics → Agents.

Questions

Can the AI get the total wrong?

Not in what's sent: the lines and total are recalculated in code before you review, and PayPal's own total must match the approved total before the invoice goes out.

What does the job need to include?

The customer's email and what was done or sold, with quantities (or hours). Prices can come from the job or from your rates in the rules; a line without a price is held.

Can I change the payment terms?

Yes: open “Create the PayPal draft” and pick another term (Net 30 by default).

Troubleshooting

  • “No AI provider connected” or a rejected key: connect or fix the key in Settings → AI Providers, then press Test there.
  • A checklist item stays unticked: the setting is still empty or still contains its placeholder text. Open the step from the checklist and fill it in.
  • An app step fails with “Needs reconnect”: the account's access was revoked or expired. Reconnect it in Settings → Integrations.
  • Nothing happens when your form sends data: check the webhook is switched on and the request carries the secret header (403 means it's missing or wrong).
  • A run shows as paused: it's waiting for someone in Reviews to approve or reject it.
  • A step failed: open the run in History and check that step in the Trace tab for the error and what it received.

Generated from the agent's own workflow, so it always matches what the agent does. Last updated .