Xero logo

Draft a Xero sales invoice from every wholesale order

Each trade order becomes a draft sales invoice in Xero, with the buyer's contact, line items and purchase order number already in place.

When this happens

New submission on your order form

Do this

Create a draft sales invoice in accounts receivable with the ordered line items, quantities and the customer contact

One-directional. A submission triggers the action — nothing is written back into your form.

Wholesale orders arrive as a list of product codes and quantities, and someone has to turn that into an invoice. Typed twice, a case count becomes a credit note.

Here the order form is the only place those numbers are entered. Every submission opens a draft invoice in Xero carrying the buyer's contact, their purchase order number and one line per product, waiting for the finance team to check freight and send it. Suppliers taking trade orders through a web form use this to keep the ledger and the warehouse looking at the same figures.

Setting it up

  1. 1

    Publish the wholesale order form and place one test order containing two different products, so the sample shows how buyers actually write quantities.

  2. 2

    In Zapier, trigger on New Submission from that order form, add Xero, and select the Create Sales Invoice action so the record posts to accounts receivable.

  3. 3

    Leave the invoice status as Draft. Freight, stock and trade pricing all get checked before anything is sent, and a draft is the only status that allows for that.

  4. 4

    Map Business Name to the invoice contact. Xero creates the contact when the name is new, which is why the form's help text should ask buyers for their registered trading name rather than a shop name.

  5. 5

    Turn Product Selection and Quantities into line items. If buyers pick from a multiple-choice list, use Zapier's line-item support; if they type freely, add a Formatter step to split on line breaks before the Xero action.

  6. 6

    Set an account code and tax rate on every line explicitly, pointing at your sales revenue account, rather than leaving the Zap to inherit a default that may not match trade sales.

  7. 7

    Map PO Number (optional) into the invoice Reference so it prints on the PDF the buyer's accounts team receives, and convert Payment Terms into a due date with a Formatter date step.

  8. 8

    Run one order through, confirm it under Business then Invoices with Draft status, delete the test, then switch the Zap on.

What maps where

Using the Wholesale Order Form as the starting point. These are its real fields — swap in your own and the mapping works the same way.

Form fieldXero
Business NameContact on the sales invoice; Xero creates the contact if no record matches the name
Product Selection and QuantitiesInvoice line items — description and quantity on each line
PO Number (optional)Reference field on the invoice, printed on the PDF sent to the buyer
Payment TermsDue date, calculated from the invoice date through a Zapier date step
Email AddressEmail on the Xero contact, used when the draft is approved and sent

Variations worth knowing

Approve the invoice instead of drafting it

Set the status to Authorised and the invoice is live the moment the order lands, so Xero's reminders can start chasing it. Worth it only for products you never run out of — an authorised invoice for stock you cannot ship has to be credited rather than edited.

Separate trade and retail orders

Reseller or Tax ID Number tells you which is which. Run Zapier paths on whether it is filled: trade orders take your wholesale price list, longer payment terms and the trade revenue account, while blank ones raise a retail-priced invoice due on receipt.

If something isn't arriving

The same buyer keeps producing new contacts — Acme Ltd, Acme Limited, ACME.

Xero matches contacts on the name it is given, so every spelling makes a record. Add a Find Contact step keyed on Email Address before the invoice action and pass the returned contact ID in, so orders settle onto one ledger entry.

A ten-product order arrives as a single invoice line.

The Xero action only creates several lines when it is handed a line-item array. Split Product Selection and Quantities in a Formatter step on line breaks or commas, then map the output to the line item group rather than to one description field.

Frequently asked questions

Does the form take payment for the order?

Yes. Add products and priced options to the form, then collect payment through secure hosted checkout with Stripe, PayPal, or Square. Payment status is tracked alongside the response.

Can the invoice be emailed to the buyer automatically?

Yes, by setting the status to Authorised and enabling emailing in the Xero step. Most suppliers keep it as a draft so someone confirms stock and freight first, then sends from Xero with a real delivery date on it.

What if a buyer changes the order after submitting?

The Zap has already run and will not return to that invoice. Edit the draft in Xero, since that is where the order now lives. Nothing travels back from Xero into the form or into the stored submission.

Related automations

Build the form first

The automation needs somewhere to fire from. Publish a form, connect it once, and every submission from then on runs this flow.

Start free