# SSO by subscription reference

Use the **getSingleSignOn** method to redirect and login shoppers automatically from your user portal into their 2Checkout myAccount based on subscription information. This method connects third-party user hubs with the 2Checkout myAccount, and allows your shoppers to seamlessly sign in to manage their information and perform tasks such as updating/changing credit card details.

## Request parameters

<table><thead><tr><th width="217.199951171875">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>subscriptionReference</code></td><td><strong>Required (string)</strong><br>Unique, system-generated subscription identifier.</td></tr><tr><td><code>email</code></td><td><strong>Optional (string)</strong><br>End user email address belonging to the customers associated with the subscription.</td></tr><tr><td><code>validityTime</code></td><td><strong>Optional (int)</strong><br>The time, in seconds, before the single sign-on URL expires. By default, the URL expires after 10 seconds. (optional)</td></tr><tr><td><code>accessPage</code></td><td><p><strong>Optional (string)</strong><br>The specific myAccount page you want the user to be redirected to. Possible values: <code>view_order</code>, <code>my_license</code>, <code>change_card</code>, <code>my_products</code>, <code>payment_methods</code>, <code>user_data</code>, <code>order_lookup</code>, <code>faq</code> — default: index page.<br>Details:</p><ul><li><strong>view_order</strong> - based on the <code>SubscriptionReference</code>, redirects shoppers to the myAccount page for the initial order that served to purchase the subscription. The 2Checkout system will match the subscription to the order automatically, displaying its associated myAccount view_order page.</li><li><strong>my_license</strong> - redirect shoppers to the subscription's page of myAccount based on the <code>SubscriptionReference</code> you provide.</li><li><strong>change_card</strong> - redirects shoppers to the subscription page of myAccount and opens up the change credit card pop-up window designed to update the payment details associated with a subscription.</li><li><strong>my_products</strong> - redirects shoppers to the myAccount page designed to list all products purchased from 2Checkout.<br>https://store.YourCustomDomain.com/m...t/my_products/?</li><li><strong>user_data</strong> - redirects shoppers to the Personal Information page in myAccount<br>https://store.YourCustomDomain.com/m...unt/user_data/?</li><li><strong>order_lookup</strong> - redirects shoppers to the Order Lookup page of myAccount.<br>https://store.YourCustomDomain.com/m.../order_lookup/?</li><li><strong>faq</strong> - redirects shoppers to the Support page of myAccount<br>https://store.YourCustomDomain.com/support/</li><li><strong>default: index page</strong> - redirects shoppers to myAccount homepage<br>https://store.YourCustomDomain.com/myaccount/?</li></ul></td></tr><tr><td><code>validationIp</code></td><td><strong>Optional (string)</strong><br>The IP address of the shopper, necessary for security purposes. Can be an empty string or a valid IP, or null.</td></tr></tbody></table>

### Request sample

```php
<?php

require ('PATH_TO_AUTH');

$subscriptionReference = 'DC47E143FA';
$email = 'iwanttestnow1981@yahoo.com';
$validityTime = 50;
$accessPage = 'my_license';
$validationIp = null;

try {
    $ssoLINK = $client->getSingleSignOn($sessionID, $subscriptionReference, $email, $validityTime, $accessPage, $validationIp);
}
catch (SoapFault $e) {
    echo "ssoLINK: " . $e->getMessage();
    exit;
}
var_dump("ssoLINK", $ssoLINK);
```

## Response parameters

<table><thead><tr><th width="191.5999755859375">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>Single sign-on URL</code></td><td><strong>String</strong><br>The string generated is the complete single sign-on URL pointing to 2Checkout myAccount, containing the unique URL. Shoppers using it log into their 2Checkout myAccount automatically.</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/single-sign-on-sso/sso-by-subscription-reference.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.
