setTemporarySpendLimitOverride()

void setTemporarySpendLimitOverride(string usn, TemporarySubscriptionSpendLimitOverrideRequest temporarySubscriptionSpendLimitOverrideRequest)

This method overrides the value of a subscription spend limit for a specified rating period. Use this method to temporarily increase or decrease the value of a spend limit. If you have previously changed the value of a spend limit, you can also use this method to temporarily revert the spend limit to its default value.

Note that you cannot remove a spend limit from 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 to change.
temporarySubscriptionSpendLimitOverrideRequest
Format: TemporarySubscriptionSpendLimitOverrideRequest XML
Purpose: Defines a TemporarySubscriptionSpendLimitOverrideRequest XML document that specifies the spend limit ID, override value and rating period.
If you do not specify an override value and the spend limit has an existing permanent override, Smile temporarily removes the override and reverts the spend limit value to the service default.
If you do not specify an override value and the spend limit has an existing temporary override, Smile removes the temporary override and reverts the spend limit to the subscription-specific value. If no subscription-specific value is defined, Smile reverts the spend limit value to the service default.

Example: Set a temporary spend limit override

This example changes the value of the spend limit with an ID of 7 to $10 in the current rating period only.

<TemporarySubscriptionSpendLimitOverrideRequest xmlns="http://xml.inomial.com/smile/2.xsd">
  <spendLimitId>7</spendLimitId>
  <RatingPeriod>
    <currentPeriod/>
  </RatingPeriod>
  <limitOverride>10.00</limitOverride>
</TemporarySubscriptionSpendLimitOverrideRequest>

Results

This method does not return any output, and changes the value of the specified spend limit.

There are no messages defined by this method. However, if the new spend limit value causes the subscription to cross an alert threshold, Smile emits the SubscriptionSpendLimitStatusUpdated message after the pre-rating process runs.

Faults

NoSuchItemException

This fault is returned when the subscription does not exist.

InvalidRequestException

This fault is returned when the spend limit does not exist, the spend limit or rating period is not associated with the subscription, or an invalid value is provided for the new spend limit, for example, a negative number.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.SetTemporarySpendLimitOverride usn filename
usn
Purpose: Specifies the USN of the subscription associated with the spend limit to change.
filename
Purpose: Defines the filename of the TemporarySubscriptionSpendLimitOverrideRequest XML document.
Note: For more information about the Java client and the options it accepts, see Java client syntax.