addPrepaid()

void addPrepaid(string usn, string prepaidCode, AddPrepaidRequestOverride addPrepaidRequestOverride)

This method adds a prepaid block to a subscription, but does not raise an invoice or charge for the prepaid block. This functionality lets you add prepaid to a subscription without using vouchers. Before you use this method, you must define prepaid blocks in Smile.

Parameters

usn
Format: string
Purpose: Specifies the USN of the subscription to which the prepaid block is added.
prepaidCode
Format: string
Purpose: Specifies the code of the prepaid block to add. You can view the prepaid code when you view the prepaid block configuration in Smile.
addPrepaidRequestOverride
Format: AddPrepaidRequestOverride XML
Purpose: (Optional) Defines an AddPrepaidRequestOverride XML document that specifies the fields to override.

Example: AddPrepaidRequestOverride XML document

This example shows an AddPrepaidRequestOverride XML document for the prepaid block being purchased. The usage of the block has been set to be unlimited and it is expired at midnight of 25th Oct 2013.

<AddPrepaidRequestOverride xmlns="http://xml.inomial.com/smile/2.xsd">
  <Quantity unlimited="true">0</Quantity>
  <ExpiryDate>2013-10-25T00:00:00+11:00</ExpiryDate>
</AddPrepaidRequestOverride>      

Results

This method adds the value of the block to the subscription. Depending on your Smile configuration and the value of the prepaid, the subscription's features may be updated after the prepaid is added, for example, the subscription may be unshaped or unwall-gardened. Smile may also reload the subscription's billing configuration and communicate with other network applications.

If AddPrepaidRequestOverride XML is provided, the value of the block will be overridden accordingly, for example, expiry date and purchased quantity. For quantity, if the ‘unlimited’ attribute is set to true, the quantity value will be ignored. In terms of expiry, either expiry date time or expiry duration can be specified.

This method does not return any output.

Smile emits the PrepaidAdded message after it adds prepaid to the subscription. If the prepaid causes the subscription's features to change, Smile emits the SubscriptionFeaturesChanged message when the feature change is complete.

Faults

PrepaidException

This fault is returned when the prepaid code is invalid, the subscription does not support the prepaid block or the caller does not have permission to perform the action.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.AddPrepaid usn prepaidCode [filename]
usn
Purpose: Specifies the USN of the subscription to which the prepaid block is added.
prepaidCode
Purpose: Specifies the code of the prepaid block to add.
fileaname
Purpose: (Optional) Defines the filename of the AddPrepaidRequestOverride XML document that contains the fields to override.
Note: For more information about the Java client and the options it accepts, see Java client syntax.