Function Subscription_Update

General

The Subscription_Update API function allows you to change status of the subscription (cancel, suspend, etc.) or mofidy subscription settings (requires client's approval).

In order to update subscription status it is enough to provide Sub structure with new status. When subscription status is changed to Modified you can also update subscription settings (title, trial and regular cycle parameters, etc).

Using this function as a merchant you are able to:

  1. Change the terms of subscription for your client when it is active (Active -> Modified).
  2. Cancel subscription, i.e. set "Cancel" status.
  3. Pause subscription renewals (Active -> Suspended, Failed-> Suspended).
  4. Reactivate paused subscription, if it was previously suspended by merchant (Suspend-> Active).

Function

Subscription Subscription_Update(
string WalletID, 
string SecurityToken, 
Subscription Sub, 
string Comment);

Parameters

Argument Type Description Example
WalletID Wallet ID String The wallet user wishes to query with enabled API access. "WZ123456789"
SecurityToken String This parameter consists of a hashed line of text formed by concatenating the API's access password and UTC date. Creating a security token. "5950F9BDA723ECDF9859AD205412BB44...
...E0DAB16630CA4462490DE64B02305F8D"
Sub Subscription Structure New subscription parameters that are going to replace current subscriptions parameters. -
Comment String Comment for a customer regarding subscription modification. "Dear Client, we have updated subscription price."

Return Value

Subscription Structure containing updated subscription data.

Error Handling

This function can throw Authentication and Security exceptions and specific exceptions listed below:

Code Samples

Refer to Code Samples in Various Programming Languages, section of Subscription Billing Integration Guide.