Order Intake
Order Intake turns a free-form order message — copied from WhatsApp, email or a typed note — into a structured draft order by parsing each line for a quantity and product name, then attempting to match that name against your product catalog before you review and submit it as a real wholesale order.
Overview
Parsing is done line-by-line with four regex patterns covering common formats ("10 x Name", "Name - 10", "Name: 10", "10 Name") — lines that don't match any pattern are listed separately as "skipped".
Each line that does parse into a quantity + name is then fuzzy-matched against your product list using a simple case-insensitive substring check (the parsed name contains the product name, or vice versa) — the first match found wins, so ambiguous or partial names can match the wrong product.
Matched items get productId, unit and pricePerUnit pre-filled from the matched product's current selling price; unmatched items get pricePerUnit 0 and unit "piece" and must be filled in manually before creating the order.
Every field (product name, quantity, unit, price) is editable in the results table before you submit — nothing is written to the database until you click "Create Wholesale Order".
Creating the order sends plain items (no tax context, no wholesaleCustomerId) to the same POST /wholesale/orders endpoint used by Wholesale Orders — tax is still auto-calculated server-side for items that carry a productId.
Before You Start
- You must have the Billing feature enabled on your plan.
- For automatic price/unit fill-in and tax calculation to work, the products mentioned in the pasted text should already exist in your product catalog under a similar name.
Step-by-Step Guide
1 Parse a pasted order message
- Open Wholesale → Order Intake and paste the order text into the left-hand box (one item per line).
- Click "Parse Order". A summary appears showing total lines, how many parsed, and how many were skipped.
- Any lines that could not be parsed at all are listed under "Skipped lines (could not parse)" — rewrite them manually in the item table on the right, or fix the source text and re-paste.
2 Review and correct parsed items
- Each parsed line appears as a row with a "✓ matched" or "? unlinked" badge — unlinked rows have no productId and default to ₹0 price and unit "piece".
- Edit Product name, Qty, Unit or Price directly in the table; for unlinked items you must set a price manually or the line will contribute ₹0 to the order.
- Click the × on a row to drop an item you don't want to include.
3 Create the order
- Enter a Customer Name (required — this is free text, the same as a manual order, not a picker over your Customers or Wholesale Customers lists).
- Click "Create Wholesale Order" — a success toast shows the generated order number, and the form resets so you can paste the next message.
- The new order appears on the Wholesale Orders page in DRAFT status, exactly as if it had been entered by hand.
Every Field & Button, Explained
| Field / Button | What it does |
|---|---|
Paste order message (textarea) | Free-form text; each line is parsed independently. Blank lines and separator lines (e.g. "---") are ignored. |
Parse Order button | Disabled until there is text and while a parse request is in flight; calls POST /wholesale/orders/intake/parse. |
Parse summary ("N lines • N parsed • N skipped") | N parsed is items successfully split into quantity+name; N skipped is lines that matched none of the four regex patterns. |
✓ matched / ? unlinked badge | Matched means the parsed product name was found (via substring match) in your product catalog and a real productId was attached; unlinked means no catalog match was found, so the row starts at ₹0 and must be priced manually. |
Product (editable) | The parsed or matched product name; can be freely retyped, but retyping does not re-run catalog matching — it is stored as plain text on the order line. |
Qty / Unit / Price ₹ | Editable per-line values; Price × Qty recomputes the line total live as you type. |
Customer Name * | Required free-text field; must be filled before "Create Wholesale Order" is enabled. |
Total | Sum of Qty × Price across all rows shown in the table — this is a client-side estimate; the actual order total returned by the server also adds tax for any matched item. |
Tips & Best Practices
- If a supplier or customer always uses the same phrasing (e.g. "Rice 25kg x 10"), match your product names in the catalog closely to that phrasing so more lines land as "✓ matched" and need less manual price entry.
- Check unlinked rows before submitting — a ₹0 price will silently zero out that line's contribution to the order total unless you fill it in.
- The substring matching is intentionally loose (either name can contain the other) — for short or generic product names, double-check that the matched product is actually the one you meant before creating the order.