Browse the docs

Agent setup guide

Wholesale Order → Invoice

Prices each B2B order from your wholesale list and, once approved, sends the Square invoice.

Available About 20 min to set up

What it does

Prices each B2B order from your wholesale list and, once approved, sends the Square invoice.

  • Starts when your B2B order form (or a pasted email order) posts to the webhook.
  • AI matches each line to your price list by SKU or name and prices it from the list only; unclear lines are flagged, not guessed.
  • Every line total (quantity × list price) and the invoice total are recalculated in code before anyone sees them — never by the AI; anything the AI got wrong is corrected and flagged to the approver.
  • The invoice due date is today plus your payment terms (Net 30 by default), worked out in code, never by the AI.
  • A person approves the lines, total and due date before anything is created.
  • Finds the buyer in Square, creates the order and the invoice, and publishes it: Square emails it with a payment page.
  • Posts the invoice number and payment link to your Slack orders channel; orders that can't be invoiced go there too.

What it needs

  • A paid plan (agents run live on paid plans).
  • An AI provider key (Settings → AI Providers).
  • Square and Slack, connected in Settings → Integrations.
  • Buyers set up as Square customers (with their email), and your wholesale price list.

What it doesn't do

  • It doesn't check stock or reserve inventory.
  • It never prices from the order text or guesses an item: unclear lines are left off the invoice for a person.
  • The Square order is one line for the approved total; the line-by-line breakdown is in the line note and the invoice message.
  • It doesn't create Square customers: a buyer who isn't one is flagged in Slack.

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: Square and Slack.
  • A form, app or system that can send each new item to a webhook URL (the agent starts from a webhook).
  • About 20 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 Square

Connect your Square account (Settings → Integrations → Square) with access to customers, orders and invoices.

3. Connect Slack

Connect the Slack workspace your orders team uses (Settings → Integrations → Slack).

4. Paste your price list

Open “Read the order lines” and replace the placeholder with your price list and currency. Payment terms are Net 30: change the days in “Work out the due date”.

SettingWhat to enterIn step
Your price list and termsReplace the placeholder with your wholesale price list (SKU, product, unit, price, minimum order) and currency. Prices on invoices come only from here. Payment terms (days until due) are set in “Work out the due date”. It starts as “[PASTE YOUR WHOLESALE PRICE LIST HERE (SKU, PRODUCT NAME, UNIT, PRICE, MINIMUM ORDER) AND YOUR CURRENCY]” until you replace it.“Read the order lines”

5. Pick your Square account and location

Open “Find the buyer in Square”, “Create the Square order”, “Create the invoice” and “Publish the invoice” and pick your account (and location) in each.

SettingWhat to enterIn step
Square account (customers)The Square account you invoice from. Pick your connected Square account.“Find the buyer in Square”
Square account (orders)The same Square account. Pick your connected Square account.“Create the Square order”
Square location (orders)The location the wholesale orders and invoices belong to.“Create the Square order”
Square account (invoices)The same Square account. Pick your connected Square account.“Create the invoice”
Square location (invoices)The same location.“Create the invoice”
Square account (publish)The same Square account. Pick your connected Square account.“Publish the invoice”

6. Pick the Slack account and channel

Open “Ask the team in Slack”, “Ask the team to add the customer” and “Post it to Slack” and pick your account and orders channel in each.

SettingWhat to enterIn step
Slack account (orders needing a person)The Slack workspace your orders team uses. Pick your connected Slack account.“Ask the team in Slack”
Orders channel (needs a person)The channel your orders team watches, e.g. #wholesale.“Ask the team in Slack”
Slack account (missing customer)The same Slack workspace. Pick your connected Slack account.“Ask the team to add the customer”
Orders channel (missing customer)The same orders channel.“Ask the team to add the customer”
Slack account (invoices sent)The same Slack workspace. Pick your connected Slack account.“Post it to Slack”
Orders channel (invoices sent)The same orders channel (or a finance channel).“Post it to Slack”

7. Test it with Dry Run

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

8. Switch the trigger on

Open the trigger, copy the webhook URL and secret into your order form or site, and switch it on. Fields: buyer_company, buyer_name, buyer_email, po_number, requested_delivery, order_text, notes.

How it works

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

  • New wholesale order — Starts when your form or app sends data to the agent's webhook URL. Your B2B order form (or your site, or a teammate pasting an emailed order into your internal form) posts each order to this webhook.
  • Work out the due date — Step. In code, not AI: the invoice due date is today plus your payment terms (Net 30 by default; change add.days here, and set timezone, e.g. America/Chicago, for “today” — UTC when blank). Also reads the requested delivery date. Orders are never dropped here.
  • Read the order lines — AI step (runs on your AI provider key). AI pulls out each line, matches it to your wholesale price list by SKU or name, prices it from the list and flags unclear lines instead of guessing. The due date comes from the step before.
  • Check the math — Step. Recalculates every line (quantity × unit price, in cents) and the invoice total in code — not by AI — writes them into the line breakdown and the amount Square invoices, and flags anything the AI got wrong for the approver.
  • Can it be invoiced? — Decision: picks the branch to follow. Orders with no matched line or no buyer email go to Slack for a person; the rest wait for approval.
  • Ask the team in Slack — Slack: Post a message. Branch: Needs a person. Posts the order and why it can't be invoiced automatically to your orders channel.
  • Sent to the team — Kept in the run history. No invoice was created.
  • Approve lines and prices — A person approves or rejects it in Reviews (the run waits). Branch: Approve. A person checks the lines, prices, total and due date in Reviews, edits them if needed and approves to invoice.
  • Find the buyer in Square — Square: Find a customer by email. Branch: Approved. Looks up the Square customer with the buyer's email.
  • Customer in Square? — Decision: picks the branch to follow. Invoices need a Square customer. When the buyer isn't one yet, the team is asked to add them.
  • Ask the team to add the customer — Slack: Post a message. Branch: Not in Square. Posts to your orders channel that the buyer isn't a Square customer yet, with the approved lines.
  • Waiting for the customer — Kept in the run history. No invoice was created.
  • Create the Square order — Square: Create an order. Branch: Found. Creates an order for the buyer with the approved total (one line; the breakdown is in the line note and the invoice message).
  • Create the invoice — Square: Create an invoice. Creates the draft invoice for the order, due on the approved date, with the line breakdown as its message.
  • Publish the invoice — Square: Publish an invoice. Publishes the invoice: Square emails it to the buyer with a payment page.
  • Post it to Slack — Slack: Post a message. Posts the invoice number, total and payment link to your orders channel.
  • Invoiced — Kept in the run history. The run history keeps the order, the invoice and its link.

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

buyer_company, buyer_name, buyer_email, po_number, requested_delivery, order_text, notes.

  • 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 the webhook URL and secret into your order form or site, and switch it on. Fields: buyer_company, buyer_name, buyer_email, po_number, requested_delivery, order_text, notes.
  • 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

Will it invent a price?

No. Prices come only from the price list you paste in. Items it can't match are listed for a person and left off the invoice.

Can the AI get the total wrong?

Not on the invoice: after the AI reads the order, every line (quantity × list price) and the total are recalculated in code, and that checked total is what Square invoices. If the AI's math was off, the review screen shows what was corrected.

Does it check stock?

No. It invoices what was ordered; check stock as you do today.

How is the due date set?

In code, not by the AI: today plus your payment terms (Net 30 by default). Change the days in “Work out the due date” (add.days). The approver can still edit the date before invoicing.

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.
  • Slack says the app isn't in the channel: in Slack, type /invite @Fluxo Flow in that channel (always needed for private channels).
  • 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 .