Skip to content
Knowledge ERP Docs

API Reference ↗
Sales

Sales Orders & Invoicing

Quote, sell, ship, invoice, and collect — the full order-to-cash flow, with a customer portal for quotes, invoices, and order status.

The Sales module covers order-to-cash: build a quote for a customer (optionally linked to a CRM opportunity), convert it into a sales order, ship it, invoice it, and record payment.

In this section #

Detailed guides for everything covered here:

  • Customer Invoices & Payments — A customer invoice is a payment request issued to a customer — tracking line items, tax, and the full payment history from draft through paid or voided.
  • Recurring Invoices — A billing schedule that fires real customer invoices automatically on a weekly, monthly, quarterly, or annual cadence — define the template once and let the system generate the invoices.
  • Credit Memos — A credit memo is a balance on account — issued to a customer after a return or manual adjustment — that can be applied against open invoices to reduce what they owe.
  • Tax Rates — A named, percentage-based tax that you configure once and apply to invoices, quotes, sales orders, purchase orders, and rental agreements across every billing-capable module.
  • Price Lists — A named set of per-Product price overrides that lets you give specific customers — or customer segments — different prices without touching your default catalog.

Quotes #

Build a quote with line items and pricing and send it to the customer. When they accept, convert it into a sales order without re-keying anything. The quote carries its own location — optional while it's a draft, required before you send it — and the order inherits it, so the site the customer was promised is the site the order ships from.

Sales orders #

A sales order captures what the customer is buying, at what price, to which location.

Sales orders are for consumable stock that's sold. Reusable equipment goes out via loans or rentals, not sales orders.

Two status dimensions #

An order tracks two independent statuses, because "where it is in its life" and "where the goods are" aren't the same thing:

  • StatusDraft → Confirmed → Processing → Closed, or Cancelled. This is the order's own state and the one to read when you want to know where the order stands. Processing covers an order that's actively being fulfilled and/or billed; Closed is the "shipped in full and billed in full" state. It isn't quite terminal — voiding an invoice on a closed order puts it back to Processing; see When a closed order re-opens.
  • Delivery StatusNew → Picking → Packed → Partially Shipped → Shipped → Delivered. This says only where the goods are, and it's tracked and filterable independently of the order status (e.g. find every order that has shipped but isn't closed yet). On an order's page it sits under Shipping & Tracking, with the carrier and tracking number.

If you only want to read one of them, read Status — that's the order's. Delivery Status only tells you how far the goods have got.

Partially Shipped is set by the shipping flow, not by hand: it means some lines have gone to the carrier and some haven't. Picking stays available for warehouse staff to set themselves, and means what it says — somebody is walking the aisles. A part-shipped order stays in the Picking Queue until the rest of it goes out, and its customer can already request a return on the part they have.

When an order closes #

Billing isn't a status — it's derived from the order's invoices. An order closes automatically once it is shipped in full and invoiced in full: every line has gone out, and every unit that went out is on an invoice that has been issued to the customer.

A draft invoice bills nothing. Raising one doesn't close the order — sending it does. A draft can be deleted, so an order that closed on one could end up Closed with nobody ever asked for money and no record of why. Sent, Partially Paid, Paid and Overdue all count as issued; Draft and Voided do not.

The same rule decides everything else about billing, because it is one rule: a line billed only on a draft can still be edited or removed from the order, and one on an issued invoice cannot. Pressing Create Invoice twice will not draft the same goods twice either — the button points you at the draft already waiting instead.

Closing deliberately doesn't wait for the customer to pay. Collecting the money is the invoice's job — the invoice carries its own Sent / Partially Paid / Paid / Overdue state, and the invoice aging report and Outstanding AR are built from invoice balances. Holding the order open for another thirty or ninety days would put the same debt in two places. Recording the payment that settles an order's invoices still closes it too, for the orders that get there that way first — a pre-paid order that hasn't shipped, for instance.

When a closed order re-opens #

Closing works in both directions, because the thing that closed the order can be taken back. Void an invoice on a closed order and the order re-opens, back to Processing: what that invoice billed is owed again, so there is work on the order and it belongs where you can see it. You void an invoice because it went to the wrong customer or for the wrong amount, and the goods have already gone out — that is the order that most needs attention, not the one that should quietly disappear from the open list.

The same happens whichever door the invoice changes through: the Void button, the API pushing an issued invoice back to Draft, undoing a Mark as Sent, or removing the invoice line that billed the order. It's the same rule that closed the order, read backwards, so the two can't disagree — if Create Invoice has something left to raise for the customer, the order is open.

Processing, not Confirmed: the goods have shipped, so the order isn't waiting on the warehouse. What's outstanding is the bill. Raise and send a replacement invoice and the order closes again on its own; a draft replacement doesn't close it, for the same reason a draft never closed it in the first place.

Two things this deliberately leaves alone. An order whose invoice was cancelled by hand — the order itself set to Cancelled — stays cancelled. And voiding an invoice that billed none of the order's lines (a separate shipping charge, say) takes nothing back, so the order stays closed.

Tax #

An order carries an optional tax rate, exactly as a quote does. Its subtotal, tax amount, and total amount are shown separately on the order's detail page and on its PDF, and they recalculate whenever a line item or the tax rate changes.

Converting a quote carries the quote's tax rate onto the order, and creating an invoice from an order carries it onto the invoice — so the figure the customer was quoted is the figure they're billed.

Shipping #

Use the Ship Items flow to fulfill an order. Shipping draws the units out of stock and records the movement, advancing the delivery status (some lines shipped → Partially Shipped; all lines shipped → Shipped) and moving the lifecycle to Processing. Mark the delivery Delivered once the customer has it. Anything from Partially Shipped onwards lets the customer request a return from the portal — they're holding goods, even if the rest is still on back-order.

A line never ships more than it was ordered. Enter a bigger figure and the flow ships what's left on the line and tells you it did so; raise the ordered quantity first if the customer is taking more. The same rule holds everywhere the shipped quantity can be written, the API included — the order is what the customer agreed to pay for, and it's what the invoice bills against.

Editing an order that has already moved #

Once part of an order has shipped or been invoiced, that part of it is settled and the line's quantity can no longer be cut below it — nor can the line be deleted. Reducing an order under goods that have already gone out would remove the only record of what the customer owes for them, and reducing it under an issued invoice would leave the order and the document the customer is holding saying different things.

The rest of the order stays editable, so partial fulfilment and partial billing both keep working. To go further:

  • Shipped too much? Correct the shipped quantity and the ordered quantity in the same edit, or take the goods back with a customer return.
  • Invoiced too much? Credit or void the invoice first.

The line's edit form shows how many units have already shipped, and the order's edit page says up front when either applies.

Deleting the order follows the same rule. An order that has shipped anything, or that carries an invoice which hasn't been voided, can't be deleted — singly or in a bulk selection — and the refusal names the reason before you confirm. Cancel the order instead: it stays on file, with its shipments and its invoices intact.

Invoicing and payments #

Create a customer invoice straight from an order (pre-filled with its line items), record payments against it, and track what's still owed. The invoice bills what has shipped: once any part of the order has gone out, the draft carries the shipped quantities and leaves the lines still waiting for a later invoice. An order that hasn't shipped at all is billed in full, which is how you raise a deposit or an advance invoice. Recurring invoices automate repeat billing, and the invoice aging report shows outstanding receivables.

What's been billed so far #

The order's page carries an Invoicing panel — the money's answer to the Ship screen's Ordered · Shipped · Remaining:

  • Invoiced — what's on invoices raised against this order. Voided invoices don't count, because voiding is how you take an invoice back.
  • Remaining to Invoice — the order's value that isn't on an invoice yet.
  • Ready to Invoice Now — what pressing Create Invoice would bill today.

The last two differ whenever goods are still to go out, and that difference is the useful part: an invoice bills what has shipped, so $600.00 remaining, $0.00 ready means the next invoice is waiting on the warehouse rather than on you. All three come from the same figures the Create Invoice button bills on, so the panel and the button can't disagree. GET /sales-orders/{id} returns the same three as invoiced_amount, remaining_to_invoice_amount and ready_to_invoice_amount (cents, read-only).

Customer portal #

Customers get a magic-link customer portal to view their quotes, invoices, orders, rentals, and loans — no account required. From it they can accept/decline quotes, pay invoices, and request a return on an order that's shipped or delivered.

Doing it from the API #

# List sales orders
curl "https://your-domain.com/api/v1/sales-orders" \
  -H "Authorization: Bearer $TOKEN"