S
Sheba ISP ERPDOCS
Backend Modules

Customer Self-Care Portal Subsystem

Architecture, OTP/JWT authentication, live session telemetry, invoice retrieval, and support ticketing for the customer self-care portal.

Customer Self-Care Portal Subsystem

IMPLEMENTED

The Customer Self-Care Portal (/api/v1/portal/* and /portal) provides broadband subscribers with self-service capabilities to inspect their line health, pay bills, change packages, open complaints, and manage Wi-Fi settings.


1. Security & Authentication Architecture

Customer access is decoupled from internal staff authentication (Token / Django User):

  • Identifier: Customers log in using either their registered mobile number (Customer.mobile) or PPPoE username (Customer.pppoe_username).
  • OTP Verification: A 6-digit OTP is issued, valid for 5 minutes, rate-limited to 3 requests per 10 minutes per identifier.
  • Portal JWT: Upon OTP verification, ShebaFi issues a signed HMAC-SHA256 JWT containing:
    • customer_id: UUID of the authenticated customer.
    • tenant_id: UUID of the customer's ISP tenant.
    • pppoe_username: PPPoE login username.
    • type: 'customer_portal'.
    • exp: Token expiration timestamp (default: 30 days).
  • Tenant Isolation: If a JWT issued for Tenant A is presented under Tenant B's domain, the request is rejected with HTTP 401 Unauthorized.
  • Zero Credential Leakage: PPPoE passwords, router secrets, SNMP community strings, and staff-only notes are strictly omitted from all portal serializers.

2. API Endpoint Directory

All endpoints are mounted under /api/v1/portal/:

MethodPathAuthDescription
POST/api/v1/portal/auth/request-otp/PublicRate-limited request for 6-digit login OTP code.
POST/api/v1/portal/auth/verify-otp/PublicValidates OTP and issues customer-scoped JWT.
GET/api/v1/portal/profile/Customer JWTCustomer details, subscription status, due and advance balances.
GET/api/v1/portal/session/Customer JWTLive MikroTik PPPoE session diagnostics (IP, MAC, uptime, bytes transferred).
GET/api/v1/portal/packages/Customer JWTActive broadband packages available for subscription upgrade.
GET/api/v1/portal/invoices/Customer JWTItemized list of invoices strictly belonging to the authenticated customer.
GET/api/v1/portal/invoices/{id}/receipt/Customer JWTDownloadable/printable invoice breakdown receipt.
GET/api/v1/portal/notifications/Customer JWTPersonalized renewal reminders and maintenance notices.
POST/api/v1/portal/recharge/Customer JWTInstant renewal deducted from accumulated advance balance credit.
GET/api/v1/portal/recharge/history/Customer JWTSubscription recharge transaction ledger.
GET/api/v1/portal/payments/history/Customer JWTPayment transaction ledger.
POST/api/v1/portal/payments/bkash/create/Customer JWTInitializes bKash Tokenized Checkout session.
POST/api/v1/portal/payments/bkash/execute/Customer JWTExecutes bKash payment, offsets balance, restores internet connection.
POST/api/v1/portal/payments/claim/Customer JWTAllows subscriber to claim an unmatched manual MFS payment by TrxID.
GET/api/v1/portal/tickets/Customer JWTCustomer's submitted support complaints and technician notes.
POST/api/v1/portal/tickets/Customer JWTOpens a new technical support complaint.
POST/api/v1/portal/tickets/{id}/reply/Customer JWTAdds a subscriber reply to an existing support ticket thread.

On this page