Home / Help Center / pos-app-wholesale / wholesale / Territories
🗺️ wholesale

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.

📍 Menu path: Wholesale → Territories
👤 Who uses it: All roles with the Billing feature enabled

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

Step-by-Step Guide

1 Create a new territory

  1. Open Wholesale → Territories and click "+ New Territory".
  2. Enter a Territory Name (required), Description, Sales Rep Name, comma-separated Pincodes, comma-separated States and Notes.
  3. Click "Save".

2 Assign an unassigned trade account to a territory

  1. With no territory card selected, the right panel shows "Unassigned Accounts".
  2. Click "Assign" next to an account.
  3. 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

  1. Click a territory card on the left — the right panel switches to show every account currently in that territory.
  2. Click "Reassign" on an account to move it to a different territory or change its rep name.
  3. Click the same territory card again to deselect it and return to the Unassigned Accounts view.

4 Deactivate, edit or delete a territory

  1. Use "Edit" on a territory card to change its name, description, pincodes, states or notes.
  2. Use "Deactivate"/"Activate" to toggle isActive — an inactive territory drops out of the Assign-modal dropdown but its already-assigned accounts stay put.
  3. 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 / ButtonWhat it does
Territory NameRequired. Shown as the card title, e.g. "North Zone" or "Pune Metro".
DescriptionOptional 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.
PincodesComma-separated list, informational only — there is no automatic matching of a trade account's address against this list.
StatesComma-separated list, informational only, same caveat as Pincodes.
NotesOptional free-text notes, not shown on the card list, stored on the territory record.
accounts countLive count on each territory card = number of trade accounts whose territoryId currently equals this territory's id.
Assign / Reassign modal → TerritoryDropdown of active territories, plus "— Unassigned —" to clear the account's territory.
Assign / Reassign modal → Sales Rep NameFree-text rep name stored on the trade account itself (salesRepName), independent of the territory's own rep name field.

Tips & Best Practices

Troubleshooting & FAQ

I deleted a territory that still had accounts assigned to it. What happened to those accounts?
deleteTerritory only removes the WholesaleTerritory row — it does not clear territoryId on any WholesaleTradeAccount that referenced it. Those accounts keep a territoryId pointing at a now-nonexistent territory, so they will silently vanish from every territory card's account list (their territoryId no longer matches anything) but will also not reappear in "Unassigned Accounts" (which only checks for territoryId being empty). Reassign affected accounts manually via Trade Accounts or by reopening the Assign modal from another territory card first.
The account count on a territory card does not match what I expect.
The count is computed client-side from the currently loaded trade-account list filtered by territoryId — it reflects live data from the same page load, so if you assign an account in one browser tab it will not update in another tab until that tab reloads.
I typed pincodes/states but accounts in that area are not showing up automatically.
Pincodes and States are plain reference text with no matching logic behind them — you must still use the Assign/Reassign flow to place each trade account into a territory by hand.
Can I bulk-assign many accounts to a territory at once?
No — assignment is one account at a time through the Assign/Reassign modal; there is no multi-select or bulk-move action on this page.