> For the complete documentation index, see [llms.txt](https://alhena.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alhena.gitbook.io/docs/integrations/ecommerce/platforms/integrating-alhena-ai-with-magento.md).

# Magento

Integrate Alhena with Magento to provide AI-powered customer support with real-time order and product information.

Alhena supports Magento 2 stores.

## Prerequisites

* A Magento 2 store with admin access
* Magento API credentials (Consumer Key, Consumer Secret, Access Token, Access Token Secret)

## Getting Your API Credentials

1. In your Magento Admin, go to **System > Extensions > Integrations**
2. Click **Add New Integration**
3. Enter a name (e.g., "Alhena AI")
4. Under **API**, select the resources Alhena needs access to:
   * Sales (for order information)
   * Catalog (for product information)
5. Save and activate the integration
6. Copy the Consumer Key, Consumer Secret, Access Token, and Access Token Secret

## Setup

### Step 1: Enable Magento in Alhena

1. In Alhena, go to **Settings > Integrations**
2. Find **Magento** and click **Enable**
3. You'll be taken to the Magento configuration page

### Step 2: Connect Your Store

Enter your Magento API credentials:

1. **Store URL** - Your Magento store URL (e.g., `https://mystore.com`)
2. **Consumer Key** - From your Magento integration
3. **Consumer Secret** - From your Magento integration
4. **Access Token** - From your Magento integration
5. **Access Token Secret** - From your Magento integration

Click **Connect** to complete the setup.

***

## Enabled Agents

When you connect your Magento store, the following agents are enabled:

| Agent                      | Description                                                                |
| -------------------------- | -------------------------------------------------------------------------- |
| **Order management agent** | Handles order inquiries, tracking, and order-related customer support      |
| **Product expert agent**   | Provides detailed product information, specifications, and recommendations |

You can configure these agents in **AI Settings > Agents**.

***

## Custom Product Fields

Magento supports custom product attributes. You can configure which custom product attributes to sync so they're included when Alhena fetches product information and answers customer questions about them.

1. Go to **Settings > Integrations > Magento**
2. Scroll to **Custom Product Fields**
3. In the **Custom fields** input, type the attribute code you want to include (e.g., `meta_title`, `features`, `specs`).
4. Press **Enter**, **comma**, or **space** to add it. Each field appears as a tag. You can also paste a comma- or space-separated list to add several at once.
5. To remove a field, click the **×** on its tag (or press **Backspace** when the input is empty to remove the last one).
6. Click **Save Changes** to apply. The button appears only when you have unsaved changes.

***

## Recommended: Add Your Store to Training

After connecting, we recommend adding your Magento store's domain to your training URLs so Alhena can learn from your product pages and help articles. See [Training on Websites](/docs/ai-configuration/data-sources/websites.md) for more information.

***

## Disconnecting

To disconnect your Magento store:

1. Go to **Settings > Integrations > Magento**
2. Click **Disconnect**
3. Confirm the disconnection

This will disable the Magento-connected agents and revoke access to your store data.
