> 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/integrate-with-lti/commerce-tools.md).

# Commerce Tools

ESW Light Touch Integration (LTI) lets you connect ESW services to your Commerce Tools storefront.

This integration supports:

* Country Selector
* Dynamic Pricing
* Checkout
  * User Data Sent to Checkout
  * Stored Cards in Checkout
* Returns Integration
* Order Status Synchronization

### Integration overview

{% stepper %}
{% step %}

#### Set up the API permissions

Grant ESW the access needed for carts and orders.
{% endstep %}

{% step %}

#### Share the credentials with ESW

Provide the client details so ESW can generate your script URL.
{% endstep %}

{% step %}

#### Add the ESW script

Load the ESW script across your storefront pages.
{% endstep %}

{% step %}

#### Pass the cart ID during checkout

Share the `cartId` with ESW after the checkout request is made.
{% endstep %}
{% endstepper %}

### Step 1: Set up the API permissions

Grant ESW the permissions needed to complete the Commerce Tools integration.

Set the following access levels in your Commerce Tools environment:

| **Parameter**        | **Scope (Permission Level)** |
| -------------------- | ---------------------------- |
| Cart                 | Edit/Modify/Change           |
| Order                | Edit/Modify/Change           |
| All other parameters | \<No change>                 |

After you assign these permissions, Commerce Tools typically generates the credentials ESW needs.

Copy and store these values securely:

* Client ID
* Client Secret
* Access Token

You may not be able to view these values again later.

### Step 2: Share the credentials with ESW

Share the generated credentials with ESW KeyVault.

ESW uses this information to create your script URL.

Provide the values in this format:

{% code title="Commerce Tools credentials" %}

```json
{
  "Client": {
    "ClientId": "clientId",
    "ClientSecret": "clientSecret",
    "AuthorizationBaseAddress": "https://auth.europe-west1.gcp.commercetools.com/",
    "Scope": "manage_project:project-key",
    "ProjectKey": "project-key",
    "ApiBaseAddress": "https://api.europe-west1.gcp.commercetools.com/"
  }
}
```

{% endcode %}

{% hint style="warning" %}
Passing these credentials to ESW is required. ESW uses them to generate the script URL for your storefront.
{% endhint %}

### Step 3: Add the ESW script to your storefront

Load the ESW JavaScript URL across your storefront.

1. Get the ESW-provided script URL from your ESW point of contact.
2. Add the script to your index page.
3. Add the same script to all other storefront pages that require LTI support.

The ESW script overrides the storefront components needed for Light Touch Integration.

Some overrides are visible in the UI, such as checkout. Others affect behavior behind the scenes, such as pricing and currency calculations.

### Step 4: Pass the cart ID to ESW

Share the `cartId` with ESW after the checkout request is made.

ESW uses the `cartId` passed from the storefront to continue the checkout flow.

{% hint style="info" %}
You need the ESW-provided script URL before you can finish the Commerce Tools setup. Contact your ESW point of contact if you do not have it yet.
{% 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/integrate-with-lti/commerce-tools.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.
