PrepaidExpiryWarningEvent

Smile emits this message when a usage block for a subscription is due to expire in a certain amount of time.

The advance intervals of time when warnings are issued are set by creating a prepaid warning threshold for a given prepaid block under Prepaid Time and Data in Smile. For more information, see the Configuration Guide.

Message header

The following table lists the parameters in the PrepaidExpiryWarningEvent message header.

Table 1. PrepaidExpiryWarningEvent header parameters
Parameter Type Values
sid integer The service ID
usn string The unique subscription ID number for the subscription
smileMessageType string "PrepaidExpiryWarningEvent"

Message body

The message body contains the <PrepaidExpiryWarningEvent> element and has the following format:
{http://xml.inomial.com/smile/2.xsd}PrepaidExpiryWarningEvent

Example: The <PrepaidExpiryWarningEvent> element

This example shows a PrepaidExpiryWarningEvent XML document for a message issued 24 hours before this usage block is due to expire.

The subscriber purchased a usage block, with prepaid ID 34359, on 4th June 2015 at 2:56:54pm. The block provided 6 hours of online time and would expire after 30 days. At the time of the event message the subscriber has consumed 2 hours and 25 minutes of online time from their total quota of 6 hours.

Although the time-to-expiry and quantity consumed are not present in the message, they can be derived by the following formula:

time_to_expiry = EndDate - EventTimestamp

quantity_consumed = PurchasedQuantity - RemainingQuantity

<PrepaidExpiryWarningEvent xmlns="http://xml.inomial.com/smile/2.xsd">
  <Subscription>
    <USN>2142423785</USN>
    <SID>770</SID><
  </Subscription>
  <PrepaidWarningLogId>13413</PrepaidWarningLogId>
  <EventTimestamp>2015-07-03T14:56:54.231+10:00</EventTimestamp>
  <PrepaidState>
    <PrepaidId>34359</PrepaidId>
    <StartDate>2015-06-04T14:56:54.231+10:00</StartDate>
    <EndDate>2015-07-04T14:56:54.231+10:00</EndDate>
    <PrepaidDescription key="beanctr">Bean Counter Pack</PrepaidDescription>
    <PurchasedQuantity formatted="0:06:00">360</PurchasedQuantity>
    <RemainingQuantity formatted="0:03:35">215</RemainingQuantity>
    <ChargeType key="0">Online time</ChargeType>
  </PrepaidState>
</PrepaidExpiryWarningEvent>