# Single Sign On

## Single Sign On by subscription reference

> Create Single Sign On links into 2Checkout myAccount based on subscription references.

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/subscriptions/{SubscriptionReference}/signon/{PageType}/":{"get":{"tags":["Single Sign On"],"summary":"Single Sign On by subscription reference","description":"Create Single Sign On links into 2Checkout myAccount based on subscription references.","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"SubscriptionReference","in":"path","description":"Unique, system-generated subscription identifier.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"PageType","in":"path","description":"The specific myAccount page you want the user to be redirected to. Possible values: view_order, my_license, change_card, my_products, payment_methods, user_data, order_lookup, faq - default: index page","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Email","in":"query","description":"End user email address belonging to the customers associated with the subscription.","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"LanguageCode","in":"query","description":"ISO language codes for the product - ISO 639-1.","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"ValidityTime","in":"query","description":"The time, in seconds, before the single sign-on URL expires. By default, the URL expires after 10 seconds.","required":false,"style":"form","explode":true,"schema":{"type":"integer"}},{"name":"ValidationIp","in":"query","description":"The IP address of the shopper, necessary for security purposes. Can be an empty string or a valid IP, or null.","required":false,"style":"form","explode":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## Retrieve Single Sign On customer info by SSOToken

> \*\*\*\
> \
> \*\*Overview\*\*\
> \
> Retrieve the details of a customer entity from the 2Checkout system. Send the SSO token you create by generating tokenized cart payment links.\
> Click \[here]\(#reference/single-sign-on/sso-in-cart) to learn how to generate a single-sign-on URL.\
> \
> Here's an example of a single-sign-on URL:\
> \
> \<pre>\
> \<code>\
> <https://store.YourCustomDomain.com/order/checkout.php?PRODS=1112233\\&logintoken=8b74ac97f8277654563c44da6915b054ba0d21be\\>
> \</code>\
> \</pre>\
> \
> The SSO token used for retrieving customer information is \*\*8b74ac97f8277654563c44da6915b054ba0d21be\*\*.

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/customers/":{"get":{"tags":["Single Sign On"],"summary":"Retrieve Single Sign On customer info by SSOToken","description":"***\n\n**Overview**\n\nRetrieve the details of a customer entity from the 2Checkout system. Send the SSO token you create by generating tokenized cart payment links.\nClick [here](#reference/single-sign-on/sso-in-cart) to learn how to generate a single-sign-on URL.\n\nHere's an example of a single-sign-on URL:\n\n<pre>\n<code>\nhttps://store.YourCustomDomain.com/order/checkout.php?PRODS=1112233&logintoken=8b74ac97f8277654563c44da6915b054ba0d21be\n</code>\n</pre>\n\nThe SSO token used for retrieving customer information is **8b74ac97f8277654563c44da6915b054ba0d21be**.","parameters":[{"name":"ssotoken","in":"query","required":true,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerInformation"}}}}}}}},"components":{"schemas":{"CustomerInformation":{"type":"object","properties":{"ExternalCustomerReference":{"type":"string"},"FirstName":{"type":"string"},"LastName":{"type":"string"},"Company":{"type":"string"},"FiscalCode":{"type":"string"},"Address1":{"type":"string"},"Address2":{"type":"string"},"City":{"type":"string"},"State":{"type":"string"},"Zip":{"type":"string"},"CountryCode":{"type":"string"},"Phone":{"type":"string"},"Fax":{"type":"string"},"Email":{"type":"string"},"ExistingCards":{"type":"array","items":{"type":"string"}},"Enabled":{"type":"boolean"},"Trial":{"type":"boolean"},"Language":{"type":"string"},"CustomerReference":{"type":"string"},"Credit":{"type":"object","properties":{"Limit":{"type":"number","description":"The credit limit available for customer","format":"float"},"Remaining":{"type":"number","description":"The remaining credit available for customer","format":"float"},"Currency":{"type":"string","description":"The credit currency"}}}}}}}}
```

## Single Sign On by customer reference

> \*\*\*\
> \
> \*\*Overview\*\*\
> \
> Create Single Sign On links into 2Checkout myAccount based on customer references (IDs). Use either the 2Checkout Customer Reference or the External Customer Reference to identify specific customers.

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/customers/{CReference}/account/{PageType}/":{"get":{"tags":["Single Sign On"],"summary":"Single Sign On by customer reference","description":"***\n\n**Overview**\n\nCreate Single Sign On links into 2Checkout myAccount based on customer references (IDs). Use either the 2Checkout Customer Reference or the External Customer Reference to identify specific customers.","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"CReference","in":"path","description":"Internal 2Checkout customer reference or your customer identifier string","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"PageType","in":"path","description":"The specific myAccount page you want the user to be redirected to. Possible values: index, my_subscription, user_data, order_lookup, faq, payment_methods","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Lang","in":"query","description":"ISO language codes for the product - ISO 639-1.","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"ValidityTime","in":"query","description":"The time, in seconds, before the single sign-on URL expires. By default, the URL expires after 10 seconds.","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"ValidationIp","in":"query","description":"The IP address of the shopper, necessary for security purposes. Can be an empty string or a valid IP, or null.","required":false,"style":"form","explode":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{}}}}}}}}
```

## Single Sign On in cart

> Generate tokenized payment links for returning customers, and display their previously used credit cards in the shopping cart, along with their prefilled billing information. 2Checkout attaches a unique token to links, designed to identify the returning shoppers and support the automatic extraction of payment data and billing information from the 2Checkout system. For example, you can generate \<strong>single sign on in cart\</strong> links for existing customers logged into your website based on their external or 2Checkout customer IDs.

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/customers/{CReference}/cart/":{"get":{"tags":["Single Sign On"],"summary":"Single Sign On in cart","description":"Generate tokenized payment links for returning customers, and display their previously used credit cards in the shopping cart, along with their prefilled billing information. 2Checkout attaches a unique token to links, designed to identify the returning shoppers and support the automatic extraction of payment data and billing information from the 2Checkout system. For example, you can generate <strong>single sign on in cart</strong> links for existing customers logged into your website based on their external or 2Checkout customer IDs.","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"CReference","in":"path","description":"Internal 2Checkout customer reference or your customer identifier string","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Url","in":"query","description":"The specific shopping cart page you want the user to be redirected to.","required":true,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"ValidityTime","in":"query","description":"The time, in seconds, before the single sign-on URL expires. By default, the URL expires after 10 seconds.","required":false,"style":"form","explode":true,"schema":{"type":"number"}},{"name":"ValidationIp","in":"query","description":"The IP address of the shopper, necessary for security purposes. Can be an empty string or a valid IP, or null.","required":false,"style":"form","explode":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{}}}}}}}}
```


---

# 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/api-reference/reference/single-sign-on.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.
