> For the complete documentation index, see [llms.txt](https://developer.esw.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.esw.com/adobe-commerce-magento/additional-features/stored-cards.md).

# Stored Cards

Stored Cards lets registered shoppers save payment cards and reuse them at ESW checkout. This shortens checkout time and improves the payment experience for returning customers.

### Stored Cards configuration

Enable the feature in **eShopWorld → Settings → Checkout → General Configuration**.

{% hint style="info" %}
Stored Cards requires the shopper to be logged in. The checkout must run in a secure context, and the retailer domain and checkout domain should use the same top-level domain.
{% endhint %}

### How the feature works

<div data-with-frame="true"><figure><img src="/files/lZCxfYCfcjrIxdDKRGqR" alt=""><figcaption></figcaption></figure></div>

When a logged-in shopper starts checkout, Adobe Commerce passes the shopper identifier to ESW as part of the preorder request. If ESW returns a shopper access token, the extension stores it in the browser as the `esw-shopper-access-token` cookie.

ESW Checkout uses that token to identify the shopper and load any previously saved cards.

The flow works like this:

1. The shopper signs in to the storefront account.
2. The shopper adds items to the cart and clicks **Checkout**.
3. Adobe Commerce sends the cart data and shopper ID in the ESW preorder request.
4. ESW returns the checkout URL and, when available, the `shopperAccessToken`.
5. Adobe Commerce sets the `esw-shopper-access-token` cookie in the browser and redirects the shopper to ESW Checkout.
6. ESW Checkout reads and validates the cookie.
7. ESW Checkout loads any saved cards linked to that shopper.
8. The shopper selects a saved card or adds a new one to complete payment.

### Shopper experience

#### Save a card for the first time

When a shopper enters card details for the first time, ESW Checkout can prompt the shopper to save that card for future use.

#### Use a saved card

On later checkouts, saved cards appear as selectable payment options in the checkout payment step.

### Testing in sandbox or staging

When testing Stored Cards in sandbox or staging, pay attention to the checkout domain setup.

#### Same top-level domain

If the Adobe Commerce test environment and ESW Checkout use the same top-level domain, the stored card flow should work without extra setup.

#### Different top-level domain

If the Adobe Commerce sandbox domain is different from the ESW Checkout domain, you may need to add the `esw-shopper-access-token` cookie manually on the ESW Checkout domain.

To do that:

1. Sign in to the storefront account.
2. Navigate to ESW Checkout.
3. Create or update the `esw-shopper-access-token` cookie on the ESW Checkout top-level domain.
4. Refresh the checkout page.
5. Confirm that the stored cards payment option is available.

### Expected result

After setup is complete:

* logged-in shoppers can save cards during checkout
* returning shoppers can reuse saved cards on later purchases
* sandbox testing works when the shopper token cookie is available to ESW Checkout


---

# 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://developer.esw.com/adobe-commerce-magento/additional-features/stored-cards.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.
