Territories
Territories lets you define geographic sales areas (by pincode list and/or state list), attach a default sales rep to each, and assign individual trade accounts into a territory — all from a single two-panel screen without leaving the page.
Overview
The left panel lists every territory as a card with its description, rep name, pincodes/states and a live count of trade accounts currently assigned to it.
The right panel is context-sensitive: with no territory selected it shows every Unassigned Account (trade accounts with no territoryId) with a one-click "Assign" button; clicking a territory card switches it to show that territory's assigned accounts with a "Reassign" button on each.
Assigning or reassigning a trade account opens a small modal where you pick a Territory from a dropdown (or "— Unassigned —" to clear it) and optionally set a Sales Rep Name for that specific account — this calls assign-territory and is the only place in the wholesale app that sets territoryId/salesRepId/salesRepName on a trade account.
A territory's own Sales Rep Name (set when creating/editing the territory) is just a default label shown on the card — assigning an account lets you give that account a different rep name than the territory default.
Deactivating a territory (via the "Deactivate" button on its card) does not unassign its accounts or stop it appearing in the territory list; it only dims the card and removes it from the active-territory dropdown shown in the Assign modal.
Before You Start
- You must have the Billing feature enabled on your plan.
- At least one trade account (Wholesale → Trade Accounts) must exist before there is anything to assign.
Step-by-Step Guide
1 Create a new territory
- Open Wholesale → Territories and click "+ New Territory".
- Enter a Territory Name (required), Description, Sales Rep Name, comma-separated Pincodes, comma-separated States and Notes.
- Click "Save".
2 Assign an unassigned trade account to a territory
- With no territory card selected, the right panel shows "Unassigned Accounts".
- Click "Assign" next to an account.
- Pick a Territory from the dropdown and optionally type a Sales Rep Name for this account, then click "Save".
3 Reassign an account or view who is in a territory
- Click a territory card on the left — the right panel switches to show every account currently in that territory.
- Click "Reassign" on an account to move it to a different territory or change its rep name.
- Click the same territory card again to deselect it and return to the Unassigned Accounts view.
4 Deactivate, edit or delete a territory
- Use "Edit" on a territory card to change its name, description, pincodes, states or notes.
- Use "Deactivate"/"Activate" to toggle isActive — an inactive territory drops out of the Assign-modal dropdown but its already-assigned accounts stay put.
- Use "Delete" to permanently remove a territory; accounts previously assigned to it keep their stored territoryId, which will then point at a deleted row (see Troubleshooting).
Every Field & Button, Explained
| Field / Button | What it does |
|---|---|
Territory Name | Required. Shown as the card title, e.g. "North Zone" or "Pune Metro". |
Description | Optional free-text summary shown under the name on the card. |
Sales Rep Name (territory) | The default rep name shown on the territory card — separate from the per-account Sales Rep Name set during assignment. |
Pincodes | Comma-separated list, informational only — there is no automatic matching of a trade account's address against this list. |
States | Comma-separated list, informational only, same caveat as Pincodes. |
Notes | Optional free-text notes, not shown on the card list, stored on the territory record. |
accounts count | Live count on each territory card = number of trade accounts whose territoryId currently equals this territory's id. |
Assign / Reassign modal → Territory | Dropdown of active territories, plus "— Unassigned —" to clear the account's territory. |
Assign / Reassign modal → Sales Rep Name | Free-text rep name stored on the trade account itself (salesRepName), independent of the territory's own rep name field. |
Tips & Best Practices
- Pincodes and States are documentation fields for your own reference — assigning an account to a territory is always a manual, explicit action via the Assign/Reassign modal, not automatic based on the account's address.
- Give an account a rep name different from its territory's default when a specific customer is handled by someone other than the usual area rep — the per-account salesRepName always wins on that account's records.
- If you plan to delete a territory, reassign its accounts to another territory (or Unassigned) first — see Troubleshooting for what happens if you delete one that still has accounts.