Mobile SFA — Overview & module guide

Module: Mobile SFA v1.5.0

Mobile Sales Force Automation for field sales reps — territories, routes, visits, orders, and collections via REST API

Screen-by-screen guides (each tab explained)

Click a menu item below for step-by-step instructions on that Mobile SFA screen:

How to use in BIXCRM (daily operations)

  1. Sign in to the admin area with a role that includes Mobile SFA permissions.
  2. Open Mobile Sfa (sidebar) or search for Mobile SFA in the admin menu.
  3. Start on the Dashboard (if available) to see open tasks, pending approvals, and KPIs.
  4. Review Settings after upgrades — new options may need defaults for your company.
  5. Create or import master data first; most modules block transactions until masters exist.
  6. Run the main business flow (create → submit → approve → post/complete) using the screens listed in Admin menu below.
  7. Use Reports / Analytics screens to reconcile stock, finance, compliance, or SLA metrics.
  8. For integrations (API, EDI, gateways, tax), confirm credentials in Settings and monitor logs or webhook delivery screens.
  9. Train staff with role-based access — give approvers approve permissions only, operators create/edit on their area.
  10. 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 Mobile SFA section in the admin sidebar. Screens your staff may use (depending on role):

  • API Keys
  • Collections
  • Dashboard
  • Executive Reports
  • Mobile Devices
  • Orders
  • Routes & Beats
  • Sales Reps
  • Settings
  • SFA
  • Territories
  • Visits
  • Webhooks

Detailed guide — features, workflows, API & FAQ

Phase 1 (Complete) — Foundation

  • Sales rep profiles linked to BIXCRM staff
  • Territory management with client assignment
  • Mobile device registration & approval
  • REST API for mobile app authentication
  • API keys for integration partners
  • Admin dashboard, permissions, audit logs

Phase 2 (Complete) — Visits & Check-In

  • Customer visit check-in/check-out with GPS
  • Visit types: sales call, delivery, collection, survey
  • Geofence validation against client coordinates
  • Photo attachments (base64 or multipart)
  • Admin: visit list, map view, rep activity report
  • Visit REST API endpoints

Phase 3 (Complete) — Beat & Route Planning

  • Daily beat/route plans per sales rep
  • Ordered customer stops with planned times
  • Reusable weekly route templates
  • Route compliance: planned vs actual visit matching
  • Admin: route list, create/edit, templates, compliance report
  • Optional sync to Distributors & Wholesalers dw_routes
  • Route REST API endpoints

Phase 4 (Complete) — Mobile Order Taking

  • Mobile order capture with line items
  • Product catalog API (BIXCRM items + optional DW pricing)
  • Order workflow: Draft → Submitted → Synced
  • Sync to BIXCRM invoice or estimate
  • Admin: order list, detail, manual sync
  • Order REST API endpoints

Phase 5 (Complete) — Collections & Payments

  • Field payment recording with multiple payment modes
  • Customer outstanding balance & unpaid invoices API
  • Auto/manual sync to BIXCRM invoice payments
  • Collection receipt PDF generation
  • Accounting Pro integration via payment hooks
  • Collection REST API endpoints

Phase 6 (Complete) — Offline Sync & Enterprise

  • Offline batch sync (POST /sync/batch) with idempotent client_ref
  • Delta sync bundle (GET /sync/pull?since=)
  • Push notifications (FCM) + route stop reminders via cron
  • Inventory Management stock API integration
  • Distributors van stock API (driver staff link)
  • Executive reports: rep productivity, territory coverage, route compliance
  • Webhooks: visit.completed, order.synced, collection.recorded/synced

Mobile API

Base URL: {your-site}/mobile_sfa/api

Login

POST /mobile_sfa/api/auth/login
Content-Type: application/json

{
  "employee_code": "REP-0001",
  "pin": "1234",
  "device_uuid": "unique-device-id",
  "platform": "android",
  "app_version": "1.0.0"
}

Response includes token — use as Authorization: Bearer {token} for subsequent requests.

Endpoints (Phase 1)

MethodEndpointAuthDescription
-------------------------------------
GET/mobile_sfa/api—API discovery
POST/mobile_sfa/api/auth/login—Sales rep login
POST/mobile_sfa/api/auth/logoutSessionLogout
GET/mobile_sfa/api/profileSessionRep profile
GET/mobile_sfa/api/territoriesTokenAssigned territories
GET/mobile_sfa/api/customersSessionTerritory customers
GET/mobile_sfa/api/customers/{id}SessionSingle customer
POST/mobile_sfa/api/devices/registerSessionRegister device
GET/mobile_sfa/api/sync/statusTokenFeature flags

Visits (Phase 2)

MethodEndpointAuthDescription
-------------------------------------
GET/mobile_sfa/api/visitsSessionVisit history (filters: date_from, date_to, status)
GET/mobile_sfa/api/visits/activeSessionCurrent open check-in
POST/mobile_sfa/api/visits/check-inSessionStart visit
POST/mobile_sfa/api/visits/check-outSessionEnd visit
GET/mobile_sfa/api/visits/{id}SessionVisit detail + photos
POST/mobile_sfa/api/visits/{id}/photosSessionUpload photo
POST/mobile_sfa/api/visits/{id}/cancelSessionCancel open visit

Routes (Phase 3)

MethodEndpointAuthDescription
-------------------------------------
GET/mobile_sfa/api/routesSessionRoute list (filters: date_from, date_to, status)
GET/mobile_sfa/api/routes/todaySessionToday's beat plan with stops
GET/mobile_sfa/api/routes/{id}SessionRoute detail + stops + compliance
POST/mobile_sfa/api/routes/stops/{id}/skipSessionSkip a planned stop

Orders (Phase 4)

MethodEndpointAuthDescription
-------------------------------------
GET/mobile_sfa/api/productsSessionProduct catalog (client_id for DW pricing)
GET/mobile_sfa/api/ordersSessionOrder history
POST/mobile_sfa/api/orders/createSessionCreate draft order
POST/mobile_sfa/api/orders/updateSessionUpdate draft order
POST/mobile_sfa/api/orders/{id}/submitSessionSubmit order
POST/mobile_sfa/api/orders/{id}/cancelSessionCancel order
GET/mobile_sfa/api/orders/{id}SessionOrder detail + lines

Collections (Phase 5)

MethodEndpointAuthDescription
-------------------------------------
GET/mobile_sfa/api/customers/{id}/outstandingSessionUnpaid invoices & balance
GET/mobile_sfa/api/collectionsSessionCollection history
POST/mobile_sfa/api/collections/recordSessionRecord field collection
GET/mobile_sfa/api/collections/{id}SessionCollection detail
GET/mobile_sfa/api/collections/{id}/receiptSessionReceipt PDF
POST/mobile_sfa/api/collections/{id}/cancelSessionCancel collection

Check-in example:

POST /mobile_sfa/api/visits/check-in
Authorization: Bearer {token}
Content-Type: application/json

{
  "client_id": 12,
  "visit_type": "sales_call",
  "lat": 24.8607,
  "lng": 67.0011,
  "notes": "Met with store manager"
}

Permissions

FeatureCapabilities
----------------------
Dashboardview
Sales Repsview, create, edit, delete
Territoriesview, create, edit, delete
Devicesview, edit, delete
Visitsview, delete
Routesview, create, edit, delete
Ordersview, edit (sync), delete
Collectionsview, edit (sync), delete
Executive Reportsview
Webhooksview, create, edit, delete
API Keysview, create, delete
Settingsview, edit

Roadmap

All 6 phases complete. See [docs/ROADMAP.md](docs/ROADMAP.md) for full history.

Design Principles

  1. No core changes — hooks + module folder only
  2. Uses BIXCRM clients — tblclients for customer master data
  3. Optional integrations — Distributors & Wholesalers, Invoices, Inventory (future phases)
  4. Incremental migrations — auto-upgrade via msfa_maybe_upgrade_database()

Features

Mobile Sales Force Automation for field sales reps — territories, routes, visits, orders, and collections via REST API

  • Sales rep profiles linked to BIXCRM staff
  • Territory management with client assignment
  • Mobile device registration & approval
  • REST API for mobile app authentication
  • API keys for integration partners
  • Admin dashboard, permissions, audit logs

Permissions

Granular staff capabilities are registered on activation. Assign them under Setup → Staff → Roles for the Mobile SFA 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

  1. Go to Setup → Modules and activate Mobile SFA.
  2. If prompted, click Upgrade Database or reload admin — migrations run automatically.
  3. Assign permissions under Setup → Staff → Roles.
  4. Open the module menu and configure settings.
  5. BIXCRM 3.0+
  6. PHP 7.4+ (8.1+ recommended)
  7. MySQL 5.7+ / MariaDB 10.3+ (InnoDB)
  8. PHP extensions: mysqli, json, mbstring, curl, fileinfo

Staff permissions (from module)

Assign under Setup → Staff → Roles. Each feature can expose different actions:

FeatureActions
Dashboard
msfa_dashboard
view
Sales Reps
msfa_sales_reps
view, create, edit, delete
Territories
msfa_territories
view, create, edit, delete
Mobile Devices
msfa_devices
view, edit, delete
Visits
msfa_visits
view, delete
Routes & Beats
msfa_routes
view, create, edit, delete
Orders
msfa_orders
view, edit, delete
Collections
msfa_collections
view, edit, delete
API Keys
msfa_api
view, create, delete
Settings
msfa_settings
view, edit
Webhooks
msfa_webhooks
view, create, edit, delete
Executive Reports
msfa_reports
view

One-time setup (first time only)

  1. Setup → Modules → activate Mobile SFA.
  2. Setup → Staff → Roles → assign Mobile SFA permissions (view, create, edit, delete, approve, export, settings as needed).
  3. Open Mobile SFA → Settings and complete company defaults, prefixes, integrations, and notification options.
  4. Create master data (warehouses, products, templates, accounts, routes, etc.) before processing live transactions.
  5. Enable BIXCRM cron (php /path/to/bixcrm/index.php cron/index) for sync, retries, alerts, and scheduled jobs.
  6. Optionally enable REST API / webhooks in module settings if you integrate external systems.

BIXCRM Knowledge Base — usage guide generated from module README and documentation.

Did you find this article useful?