For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update a subscription

Use the updateSubscription method to change specific details about a subscription.

Request parameters

Parameter
Type / Description

sessionID

Required (string) Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect. The sessionID expires in 10 minutes.

Subscription

Required (object) You need to include the entire Subscription object keeping its structure unchanged (retrieve it using Retrieve a subscription details) but you can update only specific parameters enumerated below.

Subscription.EndUser

Subscription.ExpirationDate

String

Subscription expiration date. If you changed the time zone for the 2Checkout API by editing system settings under Account settings, then 2Checkout calculates the ExpirationDate according to your custom configuration.

The default 2Checkout API time zone is GMT+02:00. You cannot set an expiration date from the past.

Subscription.ActivationDate

String

Subscription activation date. If you changed the time zone for the 2Checkout API by editing system settings under Account settings, then 2Checkout calculates the ActivationDate according to your custom configuration.

The default 2Checkout API time zone is GMT+02:00.

This field is optional. If provided, it cannot be set lower than the subscription start date (creation/purchase date) and it can be changed only while the subscription is in pending activation.

Subscription.SubscriptionEnabled

Boolean

Possible values: TRUE/FALSE

Subscription.RecurringEnabled

Boolean

Possible values: TRUE/FALSE

Subscription.ExternalCustomerReference

String

Unique customer alphanumeric (string) identifiers that you control. Use this to move a subscription from under a customer to another customer entity. 2Checkout moves subscription under the customer for which you provide the External customer reference during the subscription update process. View example: update a subscription and assign it to another customer.

Subscription.ProductId

Int

System-generated unique product ID. Needs to be the ID of an existing product in the 2Checkout system created under your account. The product ID governs the product to which the subscription is associated with. Product types must match Regular - Regular or Bundle - Bundle. IDs must identify products with the renewal system enabled (max billing cycle 36 months).

Subscription.ProductName

String

The name of the product for identifier used under ProductID.

Subscription.ProductQuantity

Int

Ordered quantity.

Subscription.PriceOptionCodes

Array

Array of product options codes. Pricing options codes are case sensitive. To impact the renewal price, the PriceOptionsCodes need to belong to price options of pricing configurations used for the product with which the subscription is associated.

ChurnReasons

Array

This payload can be sent only when the Subscription object (from above) will have RecurringEnabled set as TRUE. Possible values for this field are:

  • CHURN_REASON_NOT_SATISFIED_PRODUCT

  • CHURN_REASON_ENABLED_BY_MISTAKE

  • CHURN_REASON_PREFER_MANUAL

  • CHURN_REASON_ALREADY_RENEWED

  • CHURN_REASON_DONT_NEED

  • CHURN_REASON_WANT_PAUSE

  • CHURN_REASON_COVID

  • CHURN_REASON_HIGH_PRICE

  • CHURN_REASON_NOT_SATISFIED_SUPPORT

  • CHURN_REASON_EXTRAORDINARY

  • CHURN_REASON_OTHER

ChurnReasonOther

String

This field should have a value only if the ChurnReasons has the CHURN_REASON_EXTRAORDINARY or CHURN_REASON_OTHER values.

Currency

String

ISO 4217 code.

All other parameters of the Subscription object are non-editable. The 2Checkout system uses the updated subscription information for:

  • Manual and automatic renewals

  • Upgrades

  • Trial conversions

Request sample

Response parameters

Type
Description

Boolean

true or false depending on whether the changes were successful or not.

Last updated

Was this helpful?