SubscriptionSpendLimitStatusUpdated
Smile emits this message after a subscription crosses a spend limit alert threshold, or when a new rating period begins and all spend limits for the subscription are reset. For example, alert thresholds may be configured when a subscription consumes 60%, 80% and 100% of a spend limit.
Listen for this message if you need to send an alert to a customer when a subscription crosses an alert threshold. To avoid sending alerts when the spend limit is reset, filter the messages using the currentThreshold and previousThreshold parameters.
Message header
The following table lists the parameters in the SubscriptionSpendLimitStatusUpdated message header.
Parameter | Type | Values |
---|---|---|
sid | integer | The service ID |
usn | string | The unique subscription ID number for the subscription |
spendLimitId | integer | The spend limit ID |
currentThreshold | integer | The threshold limit that the subscription will next exceed |
previousThreshold | integer | The threshold limit that the subscription has most recently exceeded |
smileMessageType | string | "SubscriptionSpendLimitStatusUpdated" |
Message body
{http://xml.inomial.com/smile/2.xsd}SubscriptionSpendLimits
Example: The <SubscriptionSpendLimits> element
This example shows a SubscriptionSpendLimits XML document that contains the <SubscriptionSpendLimits> element.
<SubscriptionSpendLimits xmlns="http://xml.inomial.com/smile/2.xsd">
<Subscription>
<USN>2142425376</USN>
<SID>137</SID>
<ServiceName>Example Telecom Voice</ServiceName>
<Parent>2142422670</Parent>
<Properties>
<Object>
<String name="username">0491570156</String>
<Boolean name="billPrintName">false</Boolean>
<Boolean name="streetPrintName">true</Boolean>
<Timestamp name="dob"/>
</Object>
</Properties>
<ProvisionStatus>Provisioned</ProvisionStatus>
<SuspendStatus>Active</SuspendStatus>
<ActivateStatus>NotActivated</ActivateStatus>
<EnableStatus>Enabled</EnableStatus>
<AccessoryDataList/>
</Subscription>
<Limits>
<SubscriptionSpendLimit>
<SpendLimit>
<spendLimitId>1</spendLimitId>
<sid>137</sid>
<name>Data</name>
<limit>10</limit>
<alertThresholds>
<alertThreshold>50</alertThreshold>
<alertThreshold>80</alertThreshold>
<alertThreshold>100</alertThreshold>
</alertThresholds>
</SpendLimit>
<periodEnd>2012-08-31+10:00</periodEnd>
<effectiveLimit>10</effectiveLimit>
<effectiveAlertThresholds>
<alertThreshold>50</alertThreshold>
<alertThreshold>80</alertThreshold>
<alertThreshold>100</alertThreshold>
</effectiveAlertThresholds>
<currentSpend>33.473000</currentSpend>
<currentThreshold>100</currentThreshold>
<previousThreshold>0</previousThreshold>
</SubscriptionSpendLimit>
</Limits>
</SubscriptionSpendLimits>