> 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/light-touch-integration/features/checkout/user-data-sent-to-checkout.md).

# User Data Sent to Checkout

ESW can prefill checkout details for shoppers who are already logged in to your e-commerce platform. This reduces manual entry and makes checkout faster.

The data passed to checkout can include:

* First name
* Last name
* Email
* Phone
* Country

### Supported LTI platforms

<table data-view="cards"><thead><tr><th>Platform</th><th>Description</th></tr></thead><tbody><tr><td>BigCommerce</td><td>Supports passing shopper profile data to checkout through the standard LTI integration path.</td></tr><tr><td>WooCommerce</td><td>Supports passing shopper profile data to checkout through the standard LTI integration path.</td></tr><tr><td>Commerce Tools</td><td>Supports passing shopper profile data to checkout through the standard LTI integration path.</td></tr><tr><td>Callback API</td><td>Supports passing shopper profile data to checkout through the custom LTI integration path.</td></tr></tbody></table>

### How it works

When a logged-in shopper goes to checkout, LTI passes the shopper identifier through the PreOrder flow. ESW then uses that identifier to retrieve the shopper data needed to prefill checkout fields.

The prefilled fields remain editable on the checkout page.

If the feature is disabled, checkout does not receive this data and the shopper must enter each field manually.

### Platform-specific behavior

#### WooCommerce

WooCommerce does not expose a simple direct method for retrieving the shopper ID. Because of that, ESW uses the `wp_woocommerce_session_` cookie to identify the shopper session.

The WooCommerce flow works as follows:

{% stepper %}
{% step %}

#### Read the session cookie

ESW reads the value stored in the `wp_woocommerce_session_` cookie.
{% endstep %}

{% step %}

#### Store the session value safely

ESW generates an input on the page and sets its value to the session identifier instead of exposing the raw cookie value directly.
{% endstep %}

{% step %}

#### Retrieve the session during checkout

During checkout, ESW reads the session identifier from the browser and uses it without exposing the raw cookie directly.
{% endstep %}
{% endstepper %}

**WooCommerce encryption and decryption**

WooCommerce uses a public and private key pair for added security:

1. ESW encrypts the session identifier before it is set in the browser.
2. The LTI-side public key encrypts the value.
3. The ESW backend private key decrypts the value.
4. After decryption, ESW retrieves the shopper information linked to that session.
5. ESW then passes the session identifier and shopper details to checkout.

This lets ESW prefill checkout details without asking the shopper to enter them again.

#### BigCommerce

BigCommerce uses browser-side calls to retrieve the cart and shopper identifiers needed for checkout prefill.

The BigCommerce flow works as follows:

{% stepper %}
{% step %}

#### Get cart and customer identifiers

ESW calls `getCartById` from the browser to retrieve the cart ID and associated customer ID.
{% endstep %}

{% step %}

#### Pass the identifiers to Cart API

ESW sends the cart ID and customer ID to `cartAPI` during the checkout request.
{% endstep %}

{% step %}

#### Retrieve shopper details

ESW uses the cart ID to retrieve the cart again and gather the shopper information needed for checkout, including address data.
{% endstep %}
{% endstepper %}

Because this flow runs in the authenticated shopper context, it does not require encryption in the same way as WooCommerce.

#### Commerce Tools

Commerce Tools relies on a retailer-managed customer ID and a backend cart lookup.

The Commerce Tools flow works as follows:

{% stepper %}
{% step %}

#### Store the customer ID

The retailer sets the logged-in customer ID in a cookie.
{% endstep %}

{% step %}

#### Detect login state

The LTI SDK checks whether that customer ID exists and uses it to determine whether the shopper is logged in.
{% endstep %}

{% step %}

#### Retrieve the cart ID

ESW retrieves the cart ID from the backend response and stores it in browser local storage.
{% endstep %}

{% step %}

#### Send the cart to Cart API

The LTI SDK reads the cart ID and passes it to Cart API.
{% endstep %}

{% step %}

#### Fetch shopper information

ESW retrieves the cart from Commerce Tools and uses it to get the customer information required for checkout.
{% endstep %}
{% endstepper %}

#### Custom platforms

Custom platform implementations must expose the values needed for ESW to retrieve shopper data securely.

The custom platform flow works as follows:

{% stepper %}
{% step %}

#### Store the required values

Store the cart ID and encrypted customer ID in browser cookies.
{% endstep %}

{% step %}

#### Read the cookies in LTI

LTI reads those cookie values and passes them into the checkout flow.
{% endstep %}

{% step %}

#### Pass the customer ID to platform APIs

When `cartAPI` calls your platform APIs to retrieve the cart, it includes the customer ID as a parameter.
{% endstep %}

{% step %}

#### Return the cart and encrypted profile value

The browser-side LTI cart API calls `getCartById`, which returns the cart ID and encrypted customer ID value.
{% endstep %}

{% step %}

#### Decrypt in the platform

LTI does not decrypt the value. Your platform APIs decrypt it and retrieve the linked shopper record.
{% endstep %}

{% step %}

#### Return shopper details

Your platform returns the decrypted registered profile ID and the related shopper information, such as first name, last name, and country.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
For custom platforms, the `lti_encrypted_registered_profile_id` cookie is used as a query parameter when retrieving the shopper profile.
{% endhint %}


---

# 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/light-touch-integration/features/checkout/user-data-sent-to-checkout.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.
