cancel()

void cancel(string usn, date fromTimestamp)

This method closes a subscription at the specified date and time. If the specified time is before the current time, Smile closes the subscription immediately.

To close a subscription, Smile adds a plan schedule item with the close date to the plan schedule. This lets you calculate early termination fees or issue a credit for recurring charges in the next billing run.

After Smile closes a subscription, the subscription is deprovisioned and the subscription username is released and reset to the USN. Smile also releases any other resources held by the subscription.

If an account has multiple subscriptions, you must call this method for each subscription to close each subscription individually. You cannot close a subscription that is under contract; you must terminate the contract before you close the subscription.

Parameters

usn
Format: string
Purpose: Specifies the USN of the subscription to cancel.
fromTimestamp
Format: dateTime
Purpose: Specifies the date and time to close the subscription. Any usage after this time is unchargeable. For example, you cannot charge for any usage after the specified timestamp if your upstream provider does not immediately terminate the subscription.

Results

This method does not return any output, and adds a plan schedule item with the close date to the plan schedule.

After the subscription is closed, Smile sends the SubscriptionClosed message to the message bus.

Faults

CancelException

This fault is returned when the subscription cannot be cancelled, or the caller does not have permission to perform this action.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.CancelSubscription usn
usn
Purpose: Specifies the USN of the subscription to immediately close. You cannot use the Java client to close a subscription on a future date.
Note: For more information about the Java client and the options it accepts, see Java client syntax.