Skip to main content

Charging Session Management

The Sessions module (Charging Sessions) mirrors the real-time status of charges and maintains the historical record (System of Record). We use Firestore coupled with a BullMQ bus to ensure fault tolerance.


Session Lifecycle

  1. CREATED: Initial record created.
  2. AUTHORIZED: Payment validated (RemoteStart dispatched).
  3. CHARGING: Hardware confirmed the start.
  4. STOPPING: RemoteStop dispatched.
  5. COMPLETED: Transaction completed with financial capture.
  6. ERROR: Hardware or bank failure. Automatic refunds triggered.

Query Sessions

Returns a paginated list with the session history of the authenticated company.

GET /charging-session


Automatic Failure Handling (Self-Healing)

  • Auto-Stop due to Balance Limit: If the dynamic cost exceeds the pre-authorized amount, the transaction ends automatically.
  • Refund due to Hardware Failure: If the charger reports an anomaly (CHARGER_FAULT), the API consolidates the consumption and refunds the remainder.