getSubscriptionSpendLimitStates()

SubscriptionSpendLimitState getSubscriptionSpendLimitStates(string usn)

This method returns information about the current state of all spend limits associated with a subscription. Use this method to retrieve and display information about a subscription's spend limits.

Note: You must enable pre-rating before you use this method.

Parameters

usn
Format: string
Purpose: Specifies the USN of the subscription associated with the spend limits.

Results

This method returns a SubscriptionSpendLimitState XML document that lists information about the current state of each of the subscription's spend limits, for example, the spend limit value, amount spent in the period to date, alert thresholds and reset date.

Note: Smile updates the values in this XML document each time the pre-rating process runs.

There are no messages defined by this method.

Example: A returned SubscriptionSpendLimitState XML document

This example shows a SubscriptionSpendLimitState XML document for a subscription with two spend limits. The Data spend limit has a limit of $10 and the SMS spend limit has a limit of $50. The subscription has exceeded both spend limits.

<SubscriptionSpendLimitState xmlns="http://xml.inomial.com/smile/2.xsd">
  <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>
  <SubscriptionSpendLimit>
    <SpendLimit>
      <spendLimitId>7</spendLimitId>
      <sid>137</sid>
      <name>SMS</name>
      <limit>50</limit>
      <alertThresholds>
        <alertThreshold>50</alertThreshold>
        <alertThreshold>80</alertThreshold>
        <alertThreshold>100</alertThreshold>
      </alertThresholds>
    </SpendLimit>
    <periodEnd>2012-08-31+10:00</periodEnd>
    <effectiveLimit>50</effectiveLimit>
    <effectiveAlertThresholds>
      <alertThreshold>50</alertThreshold>
      <alertThreshold>80</alertThreshold>
      <alertThreshold>100</alertThreshold>
    </effectiveAlertThresholds>
    <currentSpend>56.178000</currentSpend>
    <currentThreshold>100</currentThreshold>
    <previousThreshold>50</previousThreshold>
  </SubscriptionSpendLimit>
</SubscriptionSpendLimitState>

Faults

NoSuchItemException

This fault is returned when the subscription does not exist.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.GetSubscriptionSpendLimitStates usn
usn
Purpose: Specifies the USN of the subscription associated with the spend limits.
Note: For more information about the Java client and the options it accepts, see Java client syntax.