> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/shopping-carts/convertplus/returning-customers-order-flow-sso-in-cart.md).

# Returning customers order flow (SSO in Cart)

## Overview

2Checkout supports a streamlined order flow for returning customers (SSO in Cart) using ConvertPlus and Inline Cart. When a vendor generates a signed checkout link that includes a customer identifier, 2Checkout automatically retrieves the customer's billing details and saved payment methods, allowing them to complete a purchase with minimal effort.

{% hint style="info" %}
It is compatible with new acquisition order flows, catalogue products.
{% endhint %}

## Availability

The returning customers order flow(SSO in Cart) must be enabled on your merchant account before it can be used. Contact 2Checkout Support or your account manager to enable the setting.

## How it works

When a returning customer accesses a checkout link that meets all the conditions below (see Requirements), 2Checkout:

1. Retrieves and prefills the customer's billing details from their 2Checkout account.
2. Presents the saved payment methods as selectable options in the payment area, along with other available payment methods.

## Requirements

The returning customers order flow is activated when all of the following conditions are satisfied:

<table><thead><tr><th width="190" valign="top">Requirement</th><th valign="top">Details</th></tr></thead><tbody><tr><td valign="top">Feature enabled</td><td valign="top">The SSO in Cart setting is active on your merchant account.</td></tr><tr><td valign="top">Customer identifier</td><td valign="top">The buy-link includes either <code>customer-ref</code> (2Checkout customer reference) or <code>customer-ext-ref</code> (external customer reference).</td></tr><tr><td valign="top">Valid expiration</td><td valign="top">The buy-link includes an expiration parameter set to a UTC Unix timestamp in the future.</td></tr><tr><td valign="top">Valid signature</td><td valign="top">The buy-link is signed with a valid HMAC-SHA256 signature using your Buy Link Secret Word and includes all needed parameters.</td></tr></tbody></table>

## Checkout link setup

### Parameters

The following parameters are relevant to returning customer checkout links. Parameters marked as *Signed* must be included in the signature calculation.

<table><thead><tr><th width="164" valign="top">Parameter</th><th width="136" valign="top">Required</th><th width="99" valign="top">Signed</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>customer-ref</code></td><td valign="top">One of the two</td><td valign="top">Yes</td><td valign="top">The numerical 2Checkout customer reference ID.</td></tr><tr><td valign="top"><code>customer-ext-ref</code></td><td valign="top">One of the two</td><td valign="top">Yes</td><td valign="top">The external (vendor-side) customer reference.</td></tr><tr><td valign="top"><code>expiration</code></td><td valign="top">Yes</td><td valign="top">Yes</td><td valign="top">UTC Unix timestamp indicating when the buy-link expires.<br>e.g. <code>expiration=1893456001</code></td></tr><tr><td valign="top"><code>signature</code></td><td valign="top">Yes</td><td valign="top">—</td><td valign="top">HMAC-SHA256 hash generated from your signed parameters. See <a href="#signature-generation">Signature generation</a>.</td></tr><tr><td valign="top"><code>lock</code></td><td valign="top">No</td><td valign="top">Yes</td><td valign="top">When present, locks all cart content and thus makes it non-editable.</td></tr></tbody></table>

{% hint style="info" %}
A Unix timestamp is just a count of seconds that have elapsed since a fixed reference point in time — 00:00:00 UTC on January 1, 1970 (called "the Unix epoch"). It's a single integer, with no timezone info attached to it at all - that's actually the point of it.
{% endhint %}

#### Signature generation

See also [ConvertPlus Buy-Link signature for catalog products](/shopping-carts/convertplus/convertplus-buy-link-signature-for-catalog-products.md).

1. Collect all parameters that require signing. The signature must include all parameters marked *Signed* above, plus any other buy-link parameters you are signing (such as `return-url`, `return-type`, `order-ext-ref`, `product parameters`, etc.).
2. Sort them alphabetically by parameter name.
3. Serialize each value by prefixing it with its character length.
4. Concatenate the serialized values without separators.
5. Hash the resulting string using HMAC-SHA256 with your Buy Link Secret Word.
6. Append the hash as the signature parameter to your buy-link URL.

#### Buy link with SSO in Cart example:

{% code overflow="wrap" %}

```
https://secure.2checkout.com/checkout/buy?merchant=MERCHANT_CODE&prod=PRODUCT_CODE_1&customer-ref=CUSTOMER_REFERENCE&expiration=1893456001&signature=GENERATED_SIGNATURE
```

{% endcode %}

#### How to test the link

Open the link and confirm:

* Billing details prefill from the matched customer.
* Saved, non-expired cards show up in the payment area, with the CVV field blank.
* Apple Pay / Google Pay / PayPal (if enabled) and other payments methods are still selectable.
* Placing an order with the prefilled card completes successfully.

### **What shoppers see:**

* *Billing* fields prefilled with their account information (name, email, phone, billing address). Shoppers can review and edit these details before placing the order.
* A dedicated *Card details* section on the right displaying the credit and debit cards associated with their 2Checkout account from previous transactions.

<div data-with-frame="true"><figure><img src="/files/RMbglxLKBGvZvjvaehIK" alt="Prefilled checkout with editable fields and saved cards"><figcaption><p align="center">Variant 1 — Editable checkout with pre-filled billing details and saved cards.<br>The Card details section shows saved cards with an empty Security code field.</p></figcaption></figure></div>

#### **Saved payment methods behavior**

* Only valid, non-expired cards are displayed.
* CVV required: The Security code (CVV) field is empty for all saved cards. Shoppers must enter their CVV to confirm their intention to use the selected card. This is required because the transaction is treated as a Customer Initiated Transaction (CIT).
* If the shopper does not enter a CVV, they cannot proceed with the saved card.
* Shoppers can also choose to pay with a new card or use an available alternative payment method (e.g. Apple Pay, Google Pay, PayPal Express) instead of a saved card.

**What is not prefilled:**

* B2B US 2CO tax exempt ID
* Shipping details(for PSP accounts) — merchants can still use shipping parameters to pre-populate these fields.

**Fallback:** If no valid saved cards are found for the customer, or the customer reference does not match any account, the saved cards section is not displayed. The checkout loads normally with a standard payment form.

## Supported templates

<table><thead><tr><th valign="top">Cart type</th><th valign="top">Supported templates</th></tr></thead><tbody><tr><td valign="top">ConvertPlus</td><td valign="top">All templates</td></tr><tr><td valign="top">Inline Cart</td><td valign="top">All templates</td></tr></tbody></table>

## Troubleshooting quick reference

| What you see                           | Likely cause                                                                                                     |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Standard, non-prefilled checkout       | merchant setting disabled, missing/invalid signature, expired link, or missing (valid, active)customer reference |
| Empty cart                             | `customer-ref` / `customer-ext-ref` doesn't match any customer on the account                                    |
| Checkout loads but no saved card shown | Customer exists but has no valid (non-expired) card on file — billing details may still prefill                  |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.2checkout.com/shopping-carts/convertplus/returning-customers-order-flow-sso-in-cart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
