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

Single Sign On

Single Sign On by subscription reference

get

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

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 115D3F5ED1
PageTypestringRequired

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

Example: change_card
Query parameters
EmailstringOptional

End user email address belonging to the customers associated with the subscription.

Example: 2Checkoutcustomer@email.com
LanguageCodestringOptional

ISO language codes for the product - ISO 639-1.

Example: en
ValidityTimeintegerOptional

The time, in seconds, before the single sign-on URL expires. By default, the URL expires after 10 seconds.

Example: 25
ValidationIpstringOptional

The IP address of the shopper, necessary for security purposes. Can be an empty string or a valid IP, or null.

Example: 127.0.0.1
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/subscriptions/{SubscriptionReference}/signon/{PageType}/
GET /rest/6.0/subscriptions/{SubscriptionReference}/signon/{PageType}/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
https://api.2checkout.org/myaccount/?login=41715b15b69dec74db4ad9895e47e956

Retrieve Single Sign On customer info by SSOToken

get

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 to learn how to generate a single-sign-on URL.

Here's an example of a single-sign-on URL:


https://store.YourCustomDomain.com/order/checkout.php?PRODS=1112233&logintoken=8b74ac97f8277654563c44da6915b054ba0d21be

The SSO token used for retrieving customer information is 8b74ac97f8277654563c44da6915b054ba0d21be.

Query parameters
ssotokenstringRequiredExample: 9387f43c0c4d52d57f315ef1e3d1c87443f2f4d3
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
ExternalCustomerReferencestringOptional
FirstNamestringOptional
LastNamestringOptional
CompanystringOptional
FiscalCodestringOptional
Address1stringOptional
Address2stringOptional
CitystringOptional
StatestringOptional
ZipstringOptional
CountryCodestringOptional
PhonestringOptional
FaxstringOptional
EmailstringOptional
ExistingCardsstring[]Optional
EnabledbooleanOptional
TrialbooleanOptional
LanguagestringOptional
CustomerReferencestringOptional
get/customers/
GET /rest/6.0/customers/?ssotoken=text HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

OK

{
  "ExternalCustomerReference": "Customer127",
  "FirstName": "John",
  "LastName": "Doe",
  "Company": "test company",
  "FiscalCode": "",
  "Address1": "Address details",
  "Address2": "55",
  "City": "London",
  "State": "London",
  "Zip": "WC1A1AH",
  "CountryCode": "gb",
  "Phone": "265897456",
  "Fax": "",
  "Email": "john.doe@example.com",
  "ExistingCards": [],
  "Enabled": false,
  "Trial": false,
  "CustomerReference": "423577932"
}

Single Sign On by customer reference

get

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.

Path parameters
CReferencestringRequired

Internal 2Checkout customer reference or your customer identifier string

Example: 260015052
PageTypestringRequired

The specific myAccount page you want the user to be redirected to. Possible values: index, my_subscription, user_data, order_lookup, faq, payment_methods

Example: index
Query parameters
LangstringOptional

ISO language codes for the product - ISO 639-1.

Example: en
ValidityTimestringOptional

The time, in seconds, before the single sign-on URL expires. By default, the URL expires after 10 seconds.

Example: 25
ValidationIpstringOptional

The IP address of the shopper, necessary for security purposes. Can be an empty string or a valid IP, or null.

Example: 127.0.0.1
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/customers/{CReference}/account/{PageType}/
GET /rest/6.0/customers/{CReference}/account/{PageType}/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

OK

http://secure.avangate.org/myaccount/?login=38c6110c6c4305e2818425676c264e7e

Single Sign On in cart

get

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 single sign on in cart links for existing customers logged into your website based on their external or 2Checkout customer IDs.

Path parameters
CReferencestringRequired

Internal 2Checkout customer reference or your customer identifier string

Example: 111222333
Query parameters
UrlstringRequired

The specific shopping cart page you want the user to be redirected to.

Example: https://store.avancart.com/order/checkout.php?PRODS=1234567&QTY=1&CART=1&CARD=2
ValidityTimenumberOptional

The time, in seconds, before the single sign-on URL expires. By default, the URL expires after 10 seconds.

Example: 25
ValidationIpstringOptional

The IP address of the shopper, necessary for security purposes. Can be an empty string or a valid IP, or null.

Example: 127.0.0.1
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/customers/{CReference}/cart/
GET /rest/6.0/customers/{CReference}/cart/?Url=text HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

OK

https://store.avancart.com/order/checkout.php?PRODS=1234567&logintoken=f3387c386650eaedd21c6859b85c5d51df024dc4

Last updated

Was this helpful?