Module: Distributors & Wholesalers Management v1.8.8
Complete distributors and wholesalers management — brands, products, warehouses, inventory, sales orders, and reports.
How to use in BIXCRM (daily operations)
- Sign in to the admin area with a role that includes Distributors & Wholesalers Management permissions.
- Open Distributors Wholesalers (sidebar) or search for Distributors & Wholesalers Management in the admin menu.
- Start on the Dashboard (if available) to see open tasks, pending approvals, and KPIs.
- Review Settings after upgrades — new options may need defaults for your company.
- Create or import master data first; most modules block transactions until masters exist.
- Run the main business flow (create → submit → approve → post/complete) using the screens listed in Admin menu below.
- Use Reports / Analytics screens to reconcile stock, finance, compliance, or SLA metrics.
- For integrations (API, EDI, gateways, tax), confirm credentials in Settings and monitor logs or webhook delivery screens.
- Train staff with role-based access — give approvers approve permissions only, operators create/edit on their area.
- If something fails overnight, check BIXCRM cron ran and open the module log / failed queue screen if present.
Admin menu — where to work
Open the Distributors & Wholesalers Management section in the admin sidebar. Screens your staff may use (depending on role):
- Account Statement
- Analytics
- Brands
- Categories
- Commissions
- Dashboard
- Delivery Routes
- Distributors
- Inventory
- Pick Lists
- Place Order
- Price Lists
- Product Catalog
- Products
- Promotions
- Quick Order
- Rebates
- Reports
- REST API
- Sales Orders
- Sales Returns
- Settings
- Shipments
- Territory Managers
- Transfer Requests
- Vans
- Van Sales
- Warehouses
- Webhooks
Detailed guide — features, workflows, API & FAQ
Module status
| Area | Status |
|---|---|
| ------ | -------- |
| Product master (brands, categories, products) | Complete |
| Multi-warehouse inventory & lot tracking | Complete |
| Distributor management & statements | Complete |
| Sales orders, returns, invoicing | Complete |
| Price lists, commissions, promotions, rebates | Complete |
| Pick/pack/ship, transfer requests | Complete |
| Van sales, routes, mobile API | Complete |
| REST API with rate limiting | Complete |
| Client portal (orders, catalog, statement) | Complete |
| Webhooks with URL validation | Complete |
| Territory manager RBAC | Complete |
| Security hardening (MIME, SSRF, CSRF, territory scope) | Complete |
| CodeCanyon packaging (LICENSE, CHANGELOG, docs) | Complete |
| Complete uninstall cleanup | Complete |
Features
- Product master via BIXCRM
Items+ module extension fields - Distributors via BIXCRM
Clients+ credit limits, territories, customer tiers, statements - Multi-warehouse stock (internal engine or Nasbix Inventory Management)
- Sales order workflow: draft → approval → partial/full delivery → invoice
- Tiered & volume pricing via price lists
- Sales rep commission rules (calculated on delivery)
- Multi-currency sales orders
- REST API (Bearer token) for products, distributors, orders, stock
- Distributor client portal (orders, catalog, self-service ordering, statement, repeat order)
- Audit trail on sales orders and commission payouts
- Automatic credit hold on overdue invoices
- Commission payout workflow (approve / mark paid / export)
- Pick/pack/ship workflow with pick lists and shipment records
- Batch/lot tracking with FIFO consumption and expiry alerts
- Transfer requests with optional approval workflow
- Promotions & coupon codes with auto-apply and redemption tracking
- Volume rebate programs with tiered accruals and payout workflow
- Outbound webhooks with HMAC signatures, delivery log, and cron retry queue
- Analytics dashboard (KPIs, trends, promotion ROI, top distributors)
- Van sales with mobile stock, route stops, and cash collections
- Delivery routes with driver assignment, stop visits, and completion webhooks
- Dashboard/analytics query caching for scale
- REST API pagination (
limit,offset,since) - Sales returns with optional BIXCRM credit notes
- 11 report types with Excel/PDF export
- Territory manager scoping for field teams
- Integration with Purchase Management (GRN, reorder PO)
Permissions
| Permission | Description |
|---|---|
| ------------ | ------------- |
dw_brands | Brand management |
dw_products | Products |
dw_warehouses | Warehouses |
dw_inventory | Stock operations |
dw_distributors | Distributor master |
dw_sales_orders | Sales orders |
dw_sales_returns | Sales returns |
dw_price_lists | Price lists & customer tiers |
dw_commissions | Commission rules |
dw_promotions | Promotions & coupons |
dw_rebates | Rebate programs |
dw_webhooks | Outbound webhooks |
dw_analytics | Analytics dashboard |
dw_vans | Van fleet & van stock |
dw_routes | Delivery routes |
dw_van_sales | Field van sales |
dw_api | REST API keys |
dw_reports | Reports |
dw_territories | Territory assignments |
dw_settings | Module settings |
Finance rules (v1.8+)
- Ledger: Delivered orders count as receivable only when no BIXCRM invoice is linked. Invoices are the receivable source once created.
- Receivables aging: Uninvoiced delivered orders + open invoice balances + opening balance. No double-counting.
- Tax mapping: Invoices and credit notes created from orders/returns include BIXCRM line taxes from item tax settings, with fallback to calculated or default rate.
REST API (v1.8+)
Enable in module settings (dw_enable_rest_api). Create API keys under Distributors & Wholesalers → REST API.
Authentication uses the Authorization: Bearer {token} header only.
GET /distributors_wholesalers/api/products
GET /distributors_wholesalers/api/distributors
GET /distributors_wholesalers/api/orders
GET /distributors_wholesalers/api/orders/{id}
POST /distributors_wholesalers/api/orders
GET /distributors_wholesalers/api/stock
GET /distributors_wholesalers/api/vans?van_id={id}
GET /distributors_wholesalers/api/routes?date=YYYY-MM-DD
POST /distributors_wholesalers/api/van_sales
Authorization: Bearer {token}
Van/route endpoints require Enable van/route mobile API in module settings.
Client portal (v1.8+)
Distributor contacts see Sales Orders and Account Statement in the client area at /clients/dw/*.
Tests
Install dev dependencies once:
cd modules/distributors_wholesalers && composer install
Unit tests (no database):
composer test
Related modules
- Inventory Management — optional stock engine
- Purchase Management — GRN sync, reorder purchase orders
Extended module documentation
Table of contents
- [Overview](#overview)
- [Installation](#installation)
- [Menu & permissions](#menu--permissions)
- [Sales order workflow](#sales-order-workflow)
- [Finance & receivables](#finance--receivables)
- [REST API](#rest-api)
- [Client portal](#client-portal)
- [Webhooks](#webhooks)
- [Integrations](#integrations)
- [Security](#security)
- [Uninstall](#uninstall)
---
Overview
Distributors & Wholesalers extends BIXCRM for wholesale and distribution operations:
| Area | Description |
|---|---|
| ------ | ------------- |
| Products | BIXCRM Items + dw_product_details extension |
| Distributors | BIXCRM Clients + dw_distributor_details extension |
| Stock | Multi-warehouse engine or Nasbix Inventory Management |
| Orders | Full order-to-cash with approval, delivery, invoicing |
| Field sales | Van stock, routes, mobile API |
Version 1.8.6 — all six implementation phases complete.
---
Menu & permissions
Admin path: Distributors & Wholesalers (sidebar)
| Permission | Feature |
|---|---|
| ------------ | --------- |
dw_brands / dw_categories / dw_products | Product master |
dw_warehouses / dw_inventory | Stock |
dw_distributors | Distributor master |
dw_sales_orders / dw_sales_returns | Order workflow |
dw_price_lists / dw_commissions | Pricing & incentives |
dw_promotions / dw_rebates | Promotions |
dw_webhooks / dw_api | Integrations |
dw_vans / dw_routes / dw_van_sales | Field sales |
dw_analytics / dw_reports | Reporting |
dw_territories | Field team scoping |
dw_settings | Module configuration |
Each permission supports: view, create, edit, delete, approve.
---
Sales order workflow
Statuses: draft → pending_approval → approved → partially_delivered → delivered → invoiced
- Create order (admin, quick order, or client portal).
- Credit limit and approval threshold checks on submit.
- Approve → pick list (optional auto-create) → ship → deliver.
- Create BIXCRM invoice from delivered order.
- Commission calculated on delivery; promotions/rebates applied per settings.
---
Finance & receivables
- Delivered orders without invoice count as receivable.
- Once invoiced, BIXCRM invoice is the receivable source (no double-count).
- Distributor statements combine ledger entries, open invoices, and uninvoiced deliveries.
- Credit hold blocks new orders when overdue threshold exceeded.
---
REST API
Enable in Settings (dw_enable_rest_api). Create keys under REST API.
Authorization: Bearer {token}
| Method | Endpoint |
|---|---|
| -------- | ---------- |
| GET | /distributors_wholesalers/api/products |
| GET | /distributors_wholesalers/api/distributors |
| GET/POST | /distributors_wholesalers/api/orders |
| GET | /distributors_wholesalers/api/stock |
| GET | /distributors_wholesalers/api/vans |
| GET | /distributors_wholesalers/api/routes |
| POST | /distributors_wholesalers/api/van_sales |
- Read/write scopes per key
- Rate limit per key (default 60/min; configurable)
- Bearer header only — query-string tokens are not accepted
- Pagination:
limit,offset,sinceon list endpoints
---
Client portal
Distributor contacts access /clients/dw/*:
- Order list and detail
- Product catalog and self-service ordering
- Repeat order from previous order
- Account statement (PDF)
Requires distributor flag on client record and portal ordering enabled in settings.
---
Webhooks
Configure under Distributors & Wholesalers → Webhooks.
Events: order.created, order.approved, order.delivered, order.partially_delivered, order.invoiced, shipment.created, van_sale.completed, route.completed.
- HMAC-SHA256 signature in
X-DW-Signatureheader - Only public HTTP/HTTPS URLs accepted (private/reserved IPs blocked)
- Delivery log with response codes
---
Integrations
| Module | Integration |
|---|---|
| -------- | ------------- |
| Inventory Management | Stock sync via warehouse mapping |
| Purchase Management | GRN posting, reorder PO from low-stock suggestions |
---
Security
| Control | Implementation |
|---|---|
| --------- | ---------------- |
| Admin auth | BIXCRM AdminController session |
| Permissions | 20 feature groups with approve capability |
| Territory RBAC | Non-admin staff with territory assignments see scoped data only |
| API auth | SHA-256 hashed tokens, Bearer header, rate limits |
| CSRF | BIXCRM forms + AJAX hash refresh |
| Uploads | Extension whitelist + MIME validation |
| Webhooks | URL validation, HMAC signatures |
| SQL/XSS | Parameterized queries, e() / html_escape() in views |
Run smoke tests:
php modules/distributors_wholesalers/tests/dw_logic_test.php
---
Extended module documentation
Table of contents
- [Overview](#overview)
- [Installation](#installation)
- [Menu & permissions](#menu--permissions)
- [Sales order workflow](#sales-order-workflow)
- [Finance & receivables](#finance--receivables)
- [REST API](#rest-api)
- [Client portal](#client-portal)
- [Webhooks](#webhooks)
- [Integrations](#integrations)
- [Security](#security)
- [Uninstall](#uninstall)
---
Overview
Distributors & Wholesalers extends BIXCRM for wholesale and distribution operations:
| Area | Description |
|---|---|
| ------ | ------------- |
| Products | BIXCRM Items + dw_product_details extension |
| Distributors | BIXCRM Clients + dw_distributor_details extension |
| Stock | Multi-warehouse engine or Nasbix Inventory Management |
| Orders | Full order-to-cash with approval, delivery, invoicing |
| Field sales | Van stock, routes, mobile API |
Version 1.8.6 — all six implementation phases complete.
---
Menu & permissions
Admin path: Distributors & Wholesalers (sidebar)
| Permission | Feature |
|---|---|
| ------------ | --------- |
dw_brands / dw_categories / dw_products | Product master |
dw_warehouses / dw_inventory | Stock |
dw_distributors | Distributor master |
dw_sales_orders / dw_sales_returns | Order workflow |
dw_price_lists / dw_commissions | Pricing & incentives |
dw_promotions / dw_rebates | Promotions |
dw_webhooks / dw_api | Integrations |
dw_vans / dw_routes / dw_van_sales | Field sales |
dw_analytics / dw_reports | Reporting |
dw_territories | Field team scoping |
dw_settings | Module configuration |
Each permission supports: view, create, edit, delete, approve.
---
Sales order workflow
Statuses: draft → pending_approval → approved → partially_delivered → delivered → invoiced
- Create order (admin, quick order, or client portal).
- Credit limit and approval threshold checks on submit.
- Approve → pick list (optional auto-create) → ship → deliver.
- Create BIXCRM invoice from delivered order.
- Commission calculated on delivery; promotions/rebates applied per settings.
---
Finance & receivables
- Delivered orders without invoice count as receivable.
- Once invoiced, BIXCRM invoice is the receivable source (no double-count).
- Distributor statements combine ledger entries, open invoices, and uninvoiced deliveries.
- Credit hold blocks new orders when overdue threshold exceeded.
---
REST API
Enable in Settings (dw_enable_rest_api). Create keys under REST API.
Authorization: Bearer {token}
| Method | Endpoint |
|---|---|
| -------- | ---------- |
| GET | /distributors_wholesalers/api/products |
| GET | /distributors_wholesalers/api/distributors |
| GET/POST | /distributors_wholesalers/api/orders |
| GET | /distributors_wholesalers/api/stock |
| GET | /distributors_wholesalers/api/vans |
| GET | /distributors_wholesalers/api/routes |
| POST | /distributors_wholesalers/api/van_sales |
- Read/write scopes per key
- Rate limit per key (default 60/min; configurable)
- Bearer header only — query-string tokens are not accepted
- Pagination:
limit,offset,sinceon list endpoints
---
Client portal
Distributor contacts access /clients/dw/*:
- Order list and detail
- Product catalog and self-service ordering
- Repeat order from previous order
- Account statement (PDF)
Requires distributor flag on client record and portal ordering enabled in settings.
---
Webhooks
Configure under Distributors & Wholesalers → Webhooks.
Events: order.created, order.approved, order.delivered, order.partially_delivered, order.invoiced, shipment.created, van_sale.completed, route.completed.
- HMAC-SHA256 signature in
X-DW-Signatureheader - Only public HTTP/HTTPS URLs accepted (private/reserved IPs blocked)
- Delivery log with response codes
---
Integrations
| Module | Integration |
|---|---|
| -------- | ------------- |
| Inventory Management | Stock sync via warehouse mapping |
| Purchase Management | GRN posting, reorder PO from low-stock suggestions |
---
Security
| Control | Implementation |
|---|---|
| --------- | ---------------- |
| Admin auth | BIXCRM AdminController session |
| Permissions | 20 feature groups with approve capability |
| Territory RBAC | Non-admin staff with territory assignments see scoped data only |
| API auth | SHA-256 hashed tokens, Bearer header, rate limits |
| CSRF | BIXCRM forms + AJAX hash refresh |
| Uploads | Extension whitelist + MIME validation |
| Webhooks | URL validation, HMAC signatures |
| SQL/XSS | Parameterized queries, e() / html_escape() in views |
Run smoke tests:
php modules/distributors_wholesalers/tests/dw_logic_test.php
---
Features
Complete distributors and wholesalers management — brands, products, warehouses, inventory, sales orders, and reports.
- Product master via BIXCRM `Items` + module extension fields
- Distributors via BIXCRM `Clients` + credit limits, territories, customer tiers, statements
- Multi-warehouse stock (internal engine or Nasbix Inventory Management)
- Sales order workflow: draft → approval → partial/full delivery → invoice
- Tiered & volume pricing via price lists
- Sales rep commission rules (calculated on delivery)
- Multi-currency sales orders
- REST API (Bearer token) for products, distributors, orders, stock
- Distributor client portal (orders, catalog, self-service ordering, statement, repeat order)
- Audit trail on sales orders and commission payouts
- Automatic credit hold on overdue invoices
- Commission payout workflow (approve / mark paid / export)
- Pick/pack/ship workflow with pick lists and shipment records
- Batch/lot tracking with FIFO consumption and expiry alerts
- Transfer requests with optional approval workflow
- Promotions & coupon codes with auto-apply and redemption tracking
- Volume rebate programs with tiered accruals and payout workflow
- Outbound webhooks with HMAC signatures, delivery log, and cron retry queue
- Analytics dashboard (KPIs, trends, promotion ROI, top distributors)
- Van sales with mobile stock, route stops, and cash collections
Permissions
Granular staff capabilities are registered on activation. Assign them under Setup → Staff → Roles for the Distributors & Wholesalers Management capability group.
Typical capabilities include view, create, edit, delete, plus module-specific actions (approve, export, settings, API access).
Cron Jobs
Background tasks (if enabled) run through BIXCRM's main cron. Example crontab (every 5 minutes):
* * * * * php /path/to/bixcrm/index.php cron/index > /dev/null 2>&1
Check module settings for scheduled jobs (alerts, sync, reports, retention).
After activation — configuration checklist
- Go to Setup → Modules and activate Distributors & Wholesalers Management.
- If prompted, click Upgrade Database or reload admin — migrations run automatically.
- Assign permissions under Setup → Staff → Roles.
- Open the module menu and configure settings.
- BIXCRM 3.0+
- PHP 7.4+ (8.1+ recommended)
- MySQL 5.7+ / MariaDB 10.3+ (InnoDB)
- PHP extensions: mysqli, json, mbstring, curl, fileinfo
One-time setup (first time only)
- Setup → Modules → activate Distributors & Wholesalers Management.
- Setup → Staff → Roles → assign Distributors & Wholesalers Management permissions (view, create, edit, delete, approve, export, settings as needed).
- Open Distributors & Wholesalers Management → Settings and complete company defaults, prefixes, integrations, and notification options.
- Create master data (warehouses, products, templates, accounts, routes, etc.) before processing live transactions.
- Enable BIXCRM cron (
php /path/to/bixcrm/index.php cron/index) for sync, retries, alerts, and scheduled jobs. - Optionally enable REST API / webhooks in module settings if you integrate external systems.
BIXCRM Knowledge Base — usage guide generated from module README and documentation.