Usage Events

Stream Updates about the SMS and Data Volume Usage with detailed usage events and examples.

Usage Events

The 1NCE Data Streamer Service offers a stream of Usage Events. This chapter will focus on the Usage Event specification. In this chapter, the focus lies on the JSON Object format. For other integrations, the format might be different, but the data fields are comparable. Please refer to the setup of the offered integrations to get more information about the specific data formats used.

Usage Event Triggers

Data Connection Events

For an ongoing PDP data connection, at most, one event every 15 minutes if more than 100kB of data was used. This event contains the aggregated usage since the start of the PDP or since the last usage event.

Connection Closure Events

One event on the closure a PDP data connection. This event contains the usage since the last event or the entire aggregated usage if no prior event has been provided for the closed PDP data connection.

SMS Events

For SMS a usage event is provided per individual MO-/MT-SMS send.

The 1NCE Data Streamer provides two types of events for SMS and Data volume usage.

Usage Events

Data Usage Event

Data Usage events are sent for every Endpoint while the Endpoint is consuming data service. The frequency of Data Usage events depends on platform configuration parameters e.g. an event every 5 minutes and/or every 1 megabyte consumed.

SMS Usage Event

SMS Usage events are sent for every Endpoint while the Endpoint is consuming SMS service. A SMS Usage event is sent for every MO SMS or MT SMS. If SMS submission was rejected by the platform e.g. due to exceeded quota or monthly limit, then the SMS will be not charged and hence no SMS Usage event will be emitted.

Example Usage Events

Let us start with a few Example Usage Events in the form of JSON Objects from the Data Streamer. Please note that some fields only include placeholder or example values.

Data Usage Event Example
{
  "id": 819948096,
  "operator": {
    "id": 78,
    "name": "Bite GSM",
    "mnc": "05",
    "country": {
      "id": 110,
      "mcc": "247",
      "name": "Latvia"
    }
  },
  "organisation": {
    "id": 100018,
    "name": "81013181"
  },
  "tariff": {
    "id": 369,
    "name": "MVP Phase 2 Tarriff",
    "ratezone": {
      "id": 4,
      "name": "T369.RZ1"
    }
  },
  "traffic_type": {
    "id": 5,
    "description": "Data"
  },
  "endpoint": {
    "id": 100000519,
    "name": "8988228066605682521",
    "ip_address": "10.0.1.118",
    "imei": "3556200910473501"
  },
  "volume": {
    "total": 1.0049019,
    "rx": 1.0049019,
    "tx": 0
  },
  "sim": {
    "id": 10000299,
    "iccid": "8988228066605682521",
    "msisdn": "882285105682521"
  },
  "start_timestamp": "2024-12-15T06:24:47.000Z",
  "end_timestamp": "2024-12-15T06:25:10.000Z",
  "imsi": "901405105682521",
  "imsi_id": 100000299,
  "detail": {
    "pdp_context": {
      "rat_type": 6,
      "ipcan_session_id": "e17b3179-04e0-40e8-b982-0d5f826cea6e"
    }
  }
}
SMS Usage Event Example
{
  "id": 8884551,
  "start_timestamp": "2024-12-15T06:27:26Z",
  "end_timestamp": "2024-12-15T06:27:27Z",
  "organisation": {
    "id": 103820,
    "name": "81023262"
  },
  "operator": {
    "id": 77,
    "name": "LMT",
    "mnc": "01",
    "country": {
      "id": 110,
      "mcc": "247",
      "name": "Latvia"
    }
  },
  "tariff": {
    "id": 2703,
    "name": "Tariff 718916841",
    "ratezone": {
      "id": 11428,
      "name": "IoT Cloud Connect Complete"
    }
  },
  "imsi": "901405301000216",
  "imsi_id": 100003437,
  "traffic_type": {
    "id": 6,
    "description": "SMS"
  },
  "endpoint": {
    "id": 100001494,
    "name": "8988228530100000216",
    "imei": "8643510517167031",
    "ip_address": "10.0.0.1"
  },
  "volume": {
    "total": 1,
    "rx": 0,
    "tx": 1
  },
  "sim": {
    "msisdn": "882285301000216",
    "iccid": "8988228530100000216",
    "id": 10003354
  }
}

Usage Data Properties

These are the main properties of a Usage Event that help to identify the endpoint and provide an insight into the volume used.

PropertyData TypeDescription
idLONG (64-bit integer)Unique ID for each Usage Event sent. Duplicate received event IDs indicate possible retransmissions.
costDECIMAL(14,10)Does not reflect the real world cost, 1:1 translation of usage. (Legacy field, may not be present in newer events)
currencyJSON ObjectCurrency object with information about the cost currency. (Legacy field, may not be present in newer events)
start_timestampTIMESTAMP (UTC)Timestamp with date and time of the usage start in the ISO 8601 format.
end_timestampTIMESTAMP (UTC)Timestamp with date and time of the usage end in the ISO 8601 format.
volumeJSON ObjectObject with the exact volume used as part of the Usage Event. See Volume for more information.
imsiSTRINGThe International Mobile Subscriber Identity as String.
organisationJSON ObjectObject with the ID and the name of the organization. See Event Organization for more information.
operatorJSON ObjectOperator information, see Operator for more information.
simJSON ObjectSubscriber Identification Module, see SIM for more information.
tariffJSON ObjectTariff details, see Tariff for more information.
traffic_typeJSON ObjectType of traffic of the Usage Event, see Traffic Type for more information.
endpointJSON ObjectEndpoint/Device information object, see Endpoint for more information.
detailJSON ObjectAdditional details specific to the usage type, see Detail for more information.

Object Specifications

The cost object is set as a 1:1 relation to the used volume. It does not reflect the real world cost. This is a legacy field and may not be present in newer usage events.

PropertyData TypeDescription
idINTEGERUnique identifier of the currency of indicated cost.
symbolUTF-8 Char STRINGSymbol of the currency as UTF-8 Char.
codeISO 4217 STRINGCurrency Code in ISO format.