getSubscriptionSpendLimitState()

SubscriptionSpendLimit getSubscriptionSpendLimitState(string usn, string spendLimitId)

This method returns information about the current state of a specified spend limit. Use this method to retrieve and display information about a specific spend limit for a subscription.

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 limit.
spendLimitId
Format: string
Purpose: Specifies the ID of the spend limit for which to retrieve information.

Results

This method returns a SubscriptionSpendLimit XML document that lists information about the current state of the spend limit, 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 SubscriptionSpendLimit XML document

This example shows a SubscriptionSpendLimit XML document for the SMS spend limit. The subscription has exceeded the spend limit of $50.

<SubscriptionSpendLimit xmlns="http://xml.inomial.com/smile/2.xsd">
  <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>

Faults

NoSuchItemException

This fault is returned when the subscription or spend limit does not exist.

InvalidRequestException

This fault is returned when the spend limit is not associated with the subscription.

Java client syntax

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