# Update a subscription

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

## Request parameters

<table><thead><tr><th width="351.5999755859375">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>sessionID</code></td><td><strong>Required (string)</strong><br>Session identifier, the output of the <strong>Login</strong> method. Include <code>sessionID</code> into all your requests. 2Checkout throws an exception if the values are incorrect. The <code>sessionID</code> expires in <strong>10 minutes</strong>.</td></tr><tr><td><code>Subscription</code></td><td><strong>Required (object)</strong><br>You need to include the <strong>entire Subscription object</strong> keeping its structure unchanged (retrieve it using <a href="/pages/e1f8b922fed255304d00711c19d0383c2ee8071f">Retrieve a subscription</a>) but you can update <strong>only specific parameters enumerated below</strong>.</td></tr><tr><td><code>Subscription.EndUser</code></td><td><strong>Object</strong>: <a href="/pages/UjGeyiCzOXeagPXLm8qC">End user details</a>.</td></tr><tr><td><code>Subscription.ExpirationDate</code></td><td><p><strong>String</strong></p><p>Subscription expiration date - If you changed the time zone for the 2Checkout API by editing system settings under Account settings, then 2Checkout calculates the <code>ExpirationDate</code> according to your custom configuration. </p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The default 2Checkout API time zone is GMT+02:00. You cannot set an expiration date from the past.</p></div></td></tr><tr><td><code>Subscription.ActivationDate</code></td><td><p><strong>String</strong></p><p>Subscription activation date - If you changed the time zone for the 2Checkout API by editing system settings under Account settings, then 2Checkout calculates the <code>ActivationDate</code> according to your custom configuration. </p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>he default 2Checkout API time zone is GMT+02:00. </p></div><p>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 status.</p></td></tr><tr><td><code>Subscription.SubscriptionEnabled</code></td><td><p><strong>Boolean</strong></p><p>Possible values: TRUE/FALSE</p></td></tr><tr><td><code>Subscription.RecurringEnabled</code></td><td><p><strong>Boolean</strong></p><p>Possible values: TRUE/FALSE</p></td></tr><tr><td><code>Subscription.ExternalCustomerReference</code></td><td><p><strong>String</strong></p><p>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 <strong>External customer reference</strong> during the subscription update process. <a href="/pages/51e530865690948a61acad20b0cbeb99607fdc46">View example</a>.</p></td></tr><tr><td><code>Subscription.ProductId</code></td><td><p><strong>Int</strong></p><p>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).</p></td></tr><tr><td><code>Subscription.ProductName</code></td><td><p><strong>String</strong></p><p>The name of the product for identifier used under <code>ProductID</code>.</p></td></tr><tr><td><code>Subscription.ProductQuantity</code></td><td><p><strong>Int</strong></p><p>Ordered quantity.</p></td></tr><tr><td><code>Subscription.PriceOptionCodes</code></td><td><p><strong>Array</strong></p><p>Array of product options codes. Pricing options codes are case sensitive. To impact the renewal price, the <code>PriceOptionsCodes</code> need to belong to price options of pricing configurations used for the product with which the subscription is associated.</p></td></tr><tr><td><code>ChurnReasons</code></td><td><p><strong>Array</strong><br>This payload can be sent only when the <strong>Subscription</strong> object (from above) will have <code>RecurringEnabled</code> <strong>set as TRUE</strong>. </p><p>Possible values for this field are:</p><ul><li>CHURN_REASON_NOT_SATISFIED_PRODUCT</li><li>CHURN_REASON_ENABLED_BY_MISTAKE</li><li>CHURN_REASON_PREFER_MANUAL</li><li>CHURN_REASON_ALREADY_RENEWED</li><li>CHURN_REASON_DONT_NEED</li><li>CHURN_REASON_WANT_PAUSE</li><li>CHURN_REASON_COVID</li><li>CHURN_REASON_HIGH_PRICE</li><li>CHURN_REASON_NOT_SATISFIED_SUPPORT</li><li>CHURN_REASON_EXTRAORDINARY</li><li>CHURN_REASON_OTHER</li></ul></td></tr><tr><td><code>ChurnReasonOther</code></td><td><strong>String</strong><br>This field should have a value only if the <code>ChurnReasons</code> has the <code>CHURN_REASON_EXTRAORDINARY</code> or <code>CHURN_REASON_OTHER</code> values</td></tr><tr><td><code>Currency</code></td><td><strong>String</strong><br>ISO 4217 code.</td></tr></tbody></table>

### Request sample

```php
<?php

require ('PATH_TO_AUTH');

$subscriptionReferenceTest = 'YOUR_SUBSCRIPTION_REFERENCE';

try{
    $retrievedSubscription = $client->getSubscription($sessionID, $subscriptionReferenceTest);
}

catch (SoapFault $e) {
    echo "Retrieved Subscription: " . $e->getMessage();
    exit;
}

var_dump ($updatedSubscription);

$retrievedSubscription->RecurringEnabled = false;
$retrievedSubscription->SubscriptionEnabled = false;
$retrievedSubscription->ExpirationDate = '2026-12-12';

$churnReasons = ['CHURN_REASON_OTHER'];
$churnReasonOther = 'I refuse to continue the subscription';

try {
    $updatedSubscription = $client->updateSubscription($sessionID, $retrievedSubscription);
}
catch (SoapFault $e) {
    echo "updatedSubscription: " . $e->getMessage();
    exit;
}
var_dump("updatedSubscription", $updatedSubscription);

?>
```

{% hint style="info" %}
All other parameters of the [Subscription](/soap-api-reference/soap-api-6.0/api-responses/subscription.md) object are non-editable.\
The 2Checkout system uses the updated subscription information for:

* Manual and automatic renewals
* Upgrades
* Trial conversions
  {% endhint %}

## Response parameters

<table><thead><tr><th width="97.73333740234375">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Boolean</strong></td><td><strong>true</strong> or <strong>false</strong> depending on whether the changes were successful or not.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/subscription/update-a-subscription.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
