Skip to main content

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 of 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 Organization Object for more information.
operatorJSON ObjectOperator information, see Operator Object for more information.
simJSON ObjectSubscriber Identification Module, see SIM Object for more information.
tariffJSON ObjectTariff details, see Tariff Object for more information.
traffic_typeJSON ObjectType of traffic of the Usage Event, see Traffic Type Object for more information.
endpointJSON ObjectEndpoint/Device information object, see Endpoint Object for more information.
detailJSON ObjectAdditional details specific to the usage type, see Detail Object for more information.

Object Specifications

Currency Object

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.

Organisation Object

Information about the organization of the SIM that generated the volume usage event.

PropertyData TypeDescription
idINTEGERUnique identifier of the organisation.
nameSTRING1NCE Customer ID.

SIM Object

Details about the SIM that is responsible for the volume usage.

PropertyData TypeDescription
idINTEGERUnique ID of the SIM.
iccidSTRINGIntegrated Circuit Card Identifier of the SIM.
msisdnSTRINGMobile Subscriber ISDN of the SIM Card.

Operator Object

Operator the SIM was attached to when the usage was generated.

PropertyData TypeDescription
idINTEGERUnique identifier of visited operator.
mncSTRINGMobile Network Code of the roaming operator.
nameSTRINGName of the roaming mobile operator.
countryJSON ObjectCountry information object, see Country Object for more information.

Country Object

Country of the device with the 1NCE SIM where the usage was generated.

PropertyData TypeDescription
idINTEGERUnique identifier of visited country.
mccSTRINGMobile Country Code of the operator.
nameSTRINGName of visited country.

Tariff Object

Specific tariff assigned to the 1NCE SIM.

PropertyData TypeDescription
idINTEGERUnique identifier of applied tariff.
nameSTRINGName of the applied tariff.
ratezoneJSON ObjectRatezone information object, see Ratezone Object for more information.

Ratezone Object

The ratezone in which the SIM generated the indicated usage.

PropertyData TypeDescription
idINTEGERUnique identifier of applied Ratezone.
nameSTRINGName of the Ratezone.

Traffic Type Object

Identifies what kind of traffic was used and is shown in the Usage Event. This could either be Data or SMS.

PropertyData TypeDescription
idINTEGERUnique identifier of traffic type. 5 = Data, 6 = SMS
nameSTRINGName of traffic type either "Data" or "SMS".

Endpoint Object

Details about the endpoint/device with the 1NCE SIM that generated the usage.

PropertyData TypeDescription
idINTEGERUnique identifier of traffic type.
tagsSTRINGUser-defined tags set for this endpoint.
ip_addressSTRINGThe IP address assigned to this endpoint.
imeiSTRINGThe IMEI of the endpoint hardware.
nameSTRINGThe user-defined name set for this endpoint.
balanceSTRING(Legacy field, may not be present)

Volume Object

Exact volume, either data in MegaBytes or number of SMS used by the SIM.

PropertyData TypeDescription
totalDECIMAL(14,6)Total traffic consumed, sum of tx and rx.
txDECIMAL(14,6)Dependent on Traffic Type: Upstream traffic (MiB - Binary unit based) send by the endpoint. or Number of sent MO-SMS
rxDECIMAL(14,6)Dependent on Traffic Type: Downstream traffic (MiB - Binary unit based) received by the endpoint. or Number of sent MT-SMS

Detail Object

Additional details specific to the usage type. This object may contain different information depending on the type of usage event.

For Data Usage Events:

PropertyData TypeDescription
pdp_contextJSON ObjectPDP context information for data connections.

PDP Context Object:

PropertyData TypeDescription
rat_typeINTEGERRadio Access Technology type identifier.
ipcan_session_idSTRINGIP-CAN session identifier for the data connection.