B2B / Wholesale Orders
Create wholesale orders for company customers, manage stock reservations, and cancel orders with audit-traceable reasons.
Learn how to create wholesale orders for your company customers, manage stock reservations, and cancel orders with audit-traceable reasons.
Overview
B2B (wholesale) orders are a separate flow from regular customer orders in Stogly. They differ in three important ways:
- Stock is soft-reserved at place-time. Inventory is held against the order immediately, so two operators can't accidentally promise the same units to different buyers.
- The customer's price list is re-applied by the server. What the operator sees in the form is the *preview*; the final pricing is recomputed authoritatively on submit so price-list overrides can never drift.
- Cancellations require a reason. The audit trail captures *why* every wholesale order was cancelled, visible later in the order list.
The flow lives behind the B2B Orders sidebar entry (under Sales, retail business type only).
Prerequisites
Before placing your first B2B order:
- Customer is set as Company. In Sales → Customers, the customer's *Customer category* must be Company (Pravno lice in Serbian). Individual customers can't be selected in the B2B flow.
- Optional: customer has a price list. In the customer's record, link them to a Price List. The B2B form will default to it on customer select; the operator can still override per order.
- Optional: customer has wholesale fields. On the customer record, set
Credit limit,Payment terms, andDiscount %(these come from/api/customers/:id). They surface as informational chips and a credit-utilization bar in the B2B form. - Warehouse is set up. B2B orders require an explicit warehouse selection — there's no silent fallback. Make sure at least one warehouse exists under Inventory → Warehouses.
- Products have stock. The picker shows reservations-aware *Available stock* (on-hand minus open reservations), so any items already promised to inter-store transfers or other B2B orders are visible.
Placing a B2B Order
Step 1 — Open the B2B tab
Navigate to Sales → B2B Orders. You'll land on the list view (empty if no B2B orders exist yet). Click New B2B order in the top-right.
Step 2 — Pick a wholesale customer
Type at least 2 characters in the Find a wholesale customer field. Only Company customers appear in the results — individuals are filtered out.
When you select a customer, the form surfaces:
- The customer's company name and contact details.
- Payment terms chip (e.g. "Net 30") if set on the customer record.
- Discount % chip if the customer has one.
- A credit utilization bar if the customer has a
Credit limitset. The bar sums prior open orders + this order's running total against the limit. When utilization hits 100% you'll see a warning that the order would push the buyer over — but the warning is informational, the submit button stays enabled. - Their default Price List auto-populates the price-list picker.
To switch customers, click Change.
Step 3 — Select warehouse and price list
- Warehouse (required). Defaults to your primary warehouse. Pick which warehouse the goods ship from — this is the warehouse the reservation is written against.
- Price list (optional). Defaults to the customer's preferred price list. Select No price list (use base prices) to skip price-list adjustments.
> Tip: When a price list is active, the per-line *Unit* input becomes read-only — the price list is the source of truth. Switch to "No price list" to type custom unit prices.
Step 4 — Add line items
Start typing in the Add product field. The picker searches by name, SKU, or barcode. Each row shows:
- Product name + SKU.
- Available stock (greyed em-dash if unknown, red if 0, otherwise the available quantity). This is the reservations-aware number — if another order has 5 units reserved, you'll see 5 fewer here.
Click a row to add it to the order. Quantity defaults to 1; adjust in the Qty column.
If you set a quantity that exceeds available stock, the row shows an amber warning ("Quantity exceeds available stock"). The order can still be submitted — but the reservation may fail or partially fulfil.
Step 5 — Price list preview
When a price list is selected, the form recalculates unit prices live (debounced ~350ms). A "Recalculating prices…" indicator appears in the Price list block during the round-trip. The recalculated prices are *preview only* — the server reapplies the price list on submit.
If the recalculation fails (for example, the connection drops), a message appears under the Price list picker and Place B2B order stays disabled: the lines would otherwise show prices the order is not saved with. Click Retry, or select No price list (use base prices) to continue at base prices.
Step 6 — Submit
Review the Subtotal and Total at the bottom. Click Place B2B order.
On success, the form is replaced by the confirmation card:
- Order ID, customer, status (usually
pending). - Per-line You sent vs. Server applied columns showing any price-list adjustments the server made on submit.
- An amber "Server adjusted the order" banner appears only when something diverged (price changed, line added, or line dropped server-side).
- Server-side totals.
- New B2B order to place another, or View in orders to go back to the list.
Reading the Reservation State
Back on the B2B Orders list, each row carries a reservation-state badge:
| Badge | What it means |
|---|---|
| Reserved | The order is placed but not completed. Stock is held. |
| Fulfilled | The order was completed. Stock has been deducted; the reservation is now an actual deduction. |
| Cancelled | The order was cancelled. Stock was released back into available. |
| Mixed | The order has reservation rows in more than one state — typically a partial cancellation or partial fulfilment. |
| Unknown | The reservation state couldn't be derived (e.g. older orders without the include flag). |
The stats grid at the top counts orders in each state plus the total wholesale value.
Cancelling a B2B Order
For orders in Reserved, Mixed, or Unknown state, a Cancel action is visible in the row.
Required reason
Click Cancel to open the cancellation modal. The reason field is required (minimum 3 characters). Examples:
Buyer cancelled by phone — out of stock at their endPricing dispute — needs renegotiationDuplicate order — original is #B2B-12345
Click Cancel order to confirm. The reason is saved on the order's audit trail and echoed back on the order row, visible as an italicised caption under the order number on subsequent loads.
Tips
- Available stock vs Stock. Available stock subtracts open reservations. Stock (on-hand) doesn't. The B2B picker uses Available stock so you don't oversell — but inventory-management views (stock-take, valuation) still show Stock because reservations are bookkeeping, not physical units.
- Credit limit is a soft warning, not a block. The bar warns at 100% utilization but doesn't prevent submit. The maintainer must enforce credit limits via business process, not the UI.
- Cancellation releases stock. As soon as a B2B order is cancelled, the reserved units return to Available stock — visible to the next operator placing a B2B order, immediately.
- Multiple price-list previews. Switching the price-list dropdown re-fetches prices for all current lines. If the customer has a default price list but a particular order needs to ignore it, switch to "No price list" before adding lines.
- The reconciliation banner only fires on actual deltas. If the server's
applyPriceList: truedidn't change anything, you won't see an amber banner — the card stays green.
Related guides
- Customer Management & Price Lists — set up wholesale customers, credit limits, and price lists.
- Inventory Management — understand the difference between Stock and Available stock.
- Invoices and Receipts — convert a completed B2B order into an invoice.
Need help? Contact support at support@stogly.com