Skip to main content

Billing Engine

The billing engine creates a billing file every month that contains all the usages of every customer

Overview

The Billing Engine consists of:

  • billing engine, a scheduled task is performed the 1st of every month. It will calculate the usages of every active device per customer. Create a SEAP file (billing file) and transfer this file to SEAP via an MFT file transfer.

flow

  1. Retrieve SSID for all companies

  2. Define how many active devices (NBIOT) per company(Postgesql)

  3. Define the amount of messages sent (per device or all devices) per company (Historian)

  4. calculate Usages

    • Calculating verticals product (use product billing field)
    • Calculating IOT connectivity (use iot bundle field)
      • retrieve data from ADX
    • Calculating IOT overages (use iot bundle field)
    • Calculating API subscription usage (PHASE 2)
    • Calculating additional streams usage (PHASE 2)
  5. Create xml SEAP file

  6. Persist SEAP file in storage account in the seap container

  7. Connect to MFT via SFTP connection (ssh check how to do it via node)

  8. Send SEAP file to MFT over SFTP

  9. Send mail when transfer failed

manual excecution

The billing is scheduled once a month but can also be triggered mannually by calling http://localhost:5000/calculate from inside the instance.