> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kleep.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Magento

## Phase 1: Backend Configuration (OAuth1 API)

*This step allows Kleep to retrieve your product catalog, order history, and return data to calibrate the algorithm.*

### 1. Create OAuth1 Integration

1. Log in to your **Magento Admin Panel**.
2. Navigate to **System > Integrations**.
3. Click on **"Add New Integration"**.
4. Fill in the **Name** field (e.g., "Kleep Integration").
5. Enter your **Admin Password** to confirm.

### 2. Configure API Permissions

| **Routes**                        | Details                                       |
| --------------------------------- | --------------------------------------------- |
| `/products/*`                     | Access to all product resources               |
| `/categories/*`                   | Access to all category resources              |
| `/orders/*`                       | Access to all orders resources                |
| `/returns/*`                      | Access to all return resources                |
| `/returnsAttributeMetadata/*`     | Access to all return attributes resources     |
| `/returnsItemAttributeMetadata/*` | Access to all return item attribute resources |
| `/creditmemos/*`                  | Access to all credit memo resources           |
| `/creditmemo/*`                   | Access to single credit memo resources        |
| `/stockItems/*`                   | Access to all stock resources                 |
| `/store/*`                        | Access to all store resources                 |
| `/inventory/*`                    | Access to all inventory resources             |
| `/customers/*`                    | Access to all customer resources              |

**This should correspond to the following ACL’s in Magento**:

* `Magento_Catalog::products`
* `Magento_Catalog::categories`
* `Magento_Sales::sales`
* `Magento_Sales::creditmemo`
* `Magento_Sales::actions_view`
* `Magento_Rma::rma`
* `Magento_Rma::magento_rma`
* `Magento_Rma::rma_attributes`
* `Vendor_Module::returns`
* `Magento_CatalogInventory::cataloginventory`
* `Magento_Store::store`
* `Magento_Config::config`
* `Magento_Inventory::inventory`
* `Magento_Customer::customer`

**⚠️ Important:**

* If your Magento instance exposes additional API layers or custom endpoints (for example, custom returns/RMA APIs), please coordinate with us.
* If you use an external return provider with no integration through Magento API, please refer to the return data documentation or coordinate with us to pick the right integration method.

### 3. Activate and Retrieve Credentials

1. Click **"Save"** to create the integration.
2. Click **"Activate"** on the newly created integration.
3. A pop-up will display your **OAuth credentials**:
   * Consumer Key
   * Consumer Secret
   * Access Token
   * Access Token Secret
4. **Copy these credentials** – you will need to send them to your Kleep contact.

For guidance on creating and retrieving Magento 2 API credentials, please refer to:

> [Subscribe Pro tutorial: Create and get Magento 2 API credentials](https://docs.subscribepro.com/integrations/magento-2/installation/step-3-magento-api-connection/)
> [Adobe official tutorial: Magento 2 OAuth authentication](https://developer.adobe.com/commerce/webapi/get-started/authentication/gs-authentication-oauth/)

### 4. Send Credentials to Kleep

Please send the following information to your Kleep contact via email:

1. **Please provide the complete API base URL(s) for the shop(s).**
2. **OAuth1 Credentials**
   * Consumer Key
   * Consumer Secret
   * Access Token
   * Access Token Secret

***

## Phase 2: Frontend Integration (Widget)

*This step involves adding the Kleep script to your product pages (PDP). Compatible with all versions of Magento.*

Follow our [**JS Library Widget guide**](/cms/js-library) to install and configure the front-end CTA on your product pages.

***

## Phase 3: Missing Data Management (SFTP)

*This section applies when data cannot be retrieved through standard API endpoints.*

If your Magento API does not allow retrieving Returns or certain specific data, we proceed via CSV file exchange.

Please refer to the documentation below. This guide will walk you through the process of transmitting missing data step by step:

***

## **Phase 4: Validation & Production Deployment**

### 1. Test Environment

Deploy first on your **Preprod/Staging** environment.

### 2. Visual Validation

Before going live, verify the following:

* Does the button display correctly?
* Does clicking open the pop-up (Drawer)?
* No "CORS" errors in the browser console?

### 3. Go-Live

Once validated by you and by the Kleep team, deploy the modifications to your **Production** theme.---

## Cookies & data privacy

Kleep is fully gated by visitor consent: the script only loads **after** consent is collected through your CMP, and you must condition its loading accordingly. For the complete list of trackers, the data processed, the purposes and legal bases, hosting, subprocessors and security, see [Cookies, CMP & Data Privacy](/cookie-consent).
