> For the complete documentation index, see [llms.txt](https://docs.eesel.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eesel.ai/integrations/e-commerce/magento/magento-setup.md). Agents can also search and read this documentation through its [MCP server](https://docs.eesel.ai/~gitbook/mcp).

# Set up Magento

Magento setup for your AI agent, screen by screen: everything to do in Magento Admin and in eesel to connect your store, with a screenshot for each step.

Setting up Magento for your AI agent takes one integration in Magento Admin and one secure form in eesel. This page walks through it screen by screen. You create an integration in your Magento Admin, and Magento hands you four values. You paste those four values, plus your store URL, into a secure form in the eesel chat. You do it once. For what your teammate does with the store, see the [Magento overview](https://docs.eesel.ai/integrations/e-commerce/magento.md).

## Before you begin

* You need **admin access** to your Magento store, so you can reach **System > Extensions > Integrations**.
* Your store should be **Magento 2**. The screens here are Magento 2's. Every 2.x version connects the same way.
* Have your store's base URL ready, for example `https://store.example.com`.

## Walkthrough

{% stepper %}
{% step %}

### Create a new integration in Magento Admin

Sign in to your Magento Admin as an admin. In the left sidebar open **System**, then under **Extensions** choose **Integrations**, and click **Add New Integration**.

<figure><img src="https://3732419023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2xXO0947TYoPIhGoBgSE%2Fuploads%2Fgit-blob-7253515acb533e67778dd7e088e298a2a482a80f%2Fmagento-admin-add-new-integration.png?alt=media" alt="The Magento Admin Integrations list with a callout on the Add New Integration button"><figcaption><p>The Integrations list in Magento Admin.</p></figcaption></figure>

Give it a name you will recognise later. Leave **Callback URL** and **Identity link URL** blank, because eesel uses neither. Magento may ask for your admin password further down the form, under Current User Identity Verification.

<figure><img src="https://3732419023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2xXO0947TYoPIhGoBgSE%2Fuploads%2Fgit-blob-d3931f98079f9922381b1845526afc7c08992631%2Fmagento-admin-integration-info.png?alt=media" alt="The Magento New Integration form with callouts to give it a name and to leave Callback URL and Identity link URL blank"><figcaption><p>The New Integration form, with the name filled in.</p></figcaption></figure>
{% endstep %}

{% step %}

### Grant the API resource access

Open the **API** tab, set **Resource Access** to **All**, then click **Save**. That gives the integration everything your admin account can reach, and returns you to the Integrations list.

<figure><img src="https://3732419023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2xXO0947TYoPIhGoBgSE%2Fuploads%2Fgit-blob-264975c0c3779faa44c7577eaf16716d449bd0c3%2Fmagento-admin-api-resource-access.png?alt=media" alt="The API tab of the Magento New Integration form, with callouts to set Resource Access to All and then click Save"><figcaption><p>The API tab, with Resource Access set to All before saving.</p></figcaption></figure>

To grant less than that, set **Resource Access** to **Custom** and tick only what your agent needs:

* **Sales / Orders** (read and write). Read covers order lookups; write covers cancel, hold, unhold and order comments.
* **Sales / Invoices**, **Sales / Orders / Actions / Credit Memos**, and **Sales / Credit Memos**. A refund is a credit memo raised against the order's invoice, and Magento splits it across two separate resources: the Orders action (Sales > Operations > Orders > Actions > Credit Memos) lets the agent issue the refund, and the separate top-level Credit Memos resource (Sales > Operations > Credit Memos) lets it read the created memo back to confirm the money moved. Grant both, or the agent can issue a refund it then reports as failed because it cannot read it back. Skip all three if you don't want the agent issuing refunds.
* **Sales / Shipments** (read), for shipment status and tracking numbers.
* **Catalog / Products** and **Catalog / Inventory** (read), for product and stock lookups, and for the product catalogue your agent can search.
* **Customers** (read), only if you want your agent to be able to search your customer records. Add **Customers > All Customers** if it should update a customer's address; Magento has no narrower permission for that, and it also allows editing and deleting customers. (A store connected with the eesel extension doesn't grant it in this version, so address updates aren't available there.)
* **Stores > Settings > All Stores** (read), so product links and images in the chat use your store's own address.

Grant read-only if you only want lookups. Granting a resource does not turn an action on. You choose that later, per action.
{% endstep %}

{% step %}

### Activate the integration and copy the four values

Back on the Integrations list, the integration you saved shows as **Inactive**. Click **Activate**.

<figure><img src="https://3732419023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2xXO0947TYoPIhGoBgSE%2Fuploads%2Fgit-blob-9f592ebf9deb5f9c3c741be171d3434d6c92eff4%2Fmagento-admin-activate-integration.png?alt=media" alt="The Magento Integrations list with the newly saved integration showing as Inactive and a callout on its Activate link"><figcaption><p>The saved integration, waiting to be activated.</p></figcaption></figure>

Magento lists the API resources the integration is asking for. Read the list, then click **Allow**.

<figure><img src="https://3732419023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2xXO0947TYoPIhGoBgSE%2Fuploads%2Fgit-blob-fb7f57426e37ce3f9fafd363a59fef76751ed556%2Fmagento-admin-allow-access.png?alt=media" alt="The Magento approval pop-up listing the requested API resources in a tree, with a callout on the Allow button"><figcaption><p>Magento's approval screen, listing the requested resources.</p></figcaption></figure>

Magento now shows the **Integration Tokens for Extensions** pop-up. It holds four masked values: **Consumer Key**, **Consumer Secret**, **Access Token** and **Access Token Secret**. Copy all four, then click **Done**. A person approves this in the browser.

<figure><img src="https://3732419023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2xXO0947TYoPIhGoBgSE%2Fuploads%2Fgit-blob-e259bc59ee4c833a8f6e7b8784fd7e9e0f2970ce%2Fmagento-admin-integration-tokens.png?alt=media" alt="The Magento Integration Tokens for Extensions pop-up with the four values masked, callouts to copy all four and then click Done"><figcaption><p>The Integration Tokens pop-up with all four values.</p></figcaption></figure>

{% hint style="warning" %}
Copy all four before you close the pop-up. Magento 2.4.4 and newer signs every request using all of them, so one token on its own will not connect.
{% endhint %}
{% endstep %}

{% step %}

### Paste the four values into eesel

In the eesel dashboard, ask the chat to connect your Magento store. It asks for your store base URL first, including `https://` and no trailing path. Then it opens a secure form with one field for each of the four values.

<figure><img src="https://3732419023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2xXO0947TYoPIhGoBgSE%2Fuploads%2Fgit-blob-39481a4ae2fc004dce8c0ee91ded8465d4c53ed5%2Fmagento-secure-form.png?alt=media" alt="A secure form in the dashboard chat with empty fields for Consumer Key, Consumer Secret, Access Token and Access Token Secret, and a Save securely button"><figcaption><p>The secure form, with a field for each of the four Magento values.</p></figcaption></figure>

Paste each value exactly as Magento shows it, with no extra spaces, and click **Save securely**. The values go straight to eesel, never into the chat, and the form expires in 30 minutes. This part is a human step. An AI agent running the setup waits for a person to paste the values in. It waits for the connection status to change, and does not retry.

<figure><img src="https://3732419023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2xXO0947TYoPIhGoBgSE%2Fuploads%2Fgit-blob-4ddcefb70fbba2c6b436639c3fecc388007759df%2Fmagento-secure-form-filled.png?alt=media" alt="The same secure form with all four values filled in and masked, ready to save securely"><figcaption><p>The form filled in, with the values masked.</p></figcaption></figure>

eesel makes one test call to your store. Your agent then confirms the store is connected, and Magento appears in the left sidebar with your store URL.

**Check it worked.** The Magento integration page reads **Connected** with your store URL. From a terminal, `eesel status` shows the integration as connected with its source counts. If the connection reads **needs reconnect**, the values did not authenticate, so work through the Troubleshooting notes below and reconnect.
{% endstep %}

{% step %}

### Put it to work

Connecting alone does not start your agent. It needs an automation first.

Tell your agent when to use the store data. That goes in the instructions of an [automation](https://docs.eesel.ai/automations-and-schedules/automations-and-schedules.md) on your helpdesk, Slack or chat bubble. Then choose what your agent may do on the integration page.

On a Magento storefront the chat bubble needs a wrapped snippet. That snippet, and why Magento needs it, is on [Embed the chat bubble in Magento](https://docs.eesel.ai/integrations/e-commerce/magento/magento-embed-chat-bubble.md).

Two limits:

* **Orders.** On a customer's ticket or chat, an order is found by its exact order number or by the email address on it. Magento matches an order number literally, so a mistyped number finds nothing. Search by name, and listing by date or status, work only in chats with your own team.
* **Stock.** A stock check reads one product at a time and needs that product's exact SKU. Your written content, such as a returns policy, is not part of Magento at all.
  {% endstep %}
  {% endstepper %}

## Why four credentials

Magento 2.4.4 and newer, released in 2022, checks each request against all four values, not the Access Token alone. One token on its own is refused.

Some older eesel connections were made with only an access token. Those keep working, so reconnect only when the connection stops working. Reconnecting uses all four values from the same integration.

## Troubleshooting

<details>

<summary>The connection reads "needs reconnect", or it keeps failing</summary>

* Check the **Store URL** is exact, including `https://`, with no trailing path.
* Make sure the integration is **Activated** in Magento, not only saved.
* Confirm you pasted all four values, and that every one came from the **same** integration. The Consumer Secret and the Access Token Secret are easy to mix up. Re-copy both from the Integration Tokens screen in Magento.

</details>

<details>

<summary>It worked, then every Magento read started failing</summary>

Re-activating the integration in Magento Admin issues a new set of four values. The old ones stop working at that moment. Ask your agent to reconnect Magento, and paste the new four values into the secure form it opens.

</details>

<details>

<summary>Connected, but your agent cannot find an order or a lookup comes back empty</summary>

The integration needs read access to the matching resource. That is **Sales / Orders** for order lookups, **Sales / Shipments** for tracking, and **Catalog / Products** plus **Catalog / Inventory** for stock. Then check the identifier, because Magento matches it literally. Look the customer's orders up by their email address and compare the order number against that list.

</details>

<details>

<summary>A refund, cancel, hold or unhold fails</summary>

A refund needs the **Invoices** read resource and both Credit Memos resources: **Sales > Operations > Orders > Actions > Credit Memos** to issue the refund and the top-level **Sales > Operations > Credit Memos** to read it back and confirm the money moved. Grant only one and the agent can move the money but reports the refund as failed. It also needs an invoice on the order to refund against, and only refunds orders paid by an offline method (check, bank transfer, cash on delivery, purchase order); a card or other online-gateway order is refused, because that refund has to be issued in the Magento admin to reach the customer's account. Cancel, hold, unhold and order comments need write access on **Sales / Orders**. The order also has to be in a state that allows it. You cannot cancel an order that already shipped, or release a hold on an order that is not on hold.

</details>

<details>

<summary>A write action did not happen</summary>

Open the run on your **Activity** page. If the action is waiting on a person, approve it and it runs.

</details>

## FAQ

<details>

<summary>What do I need before I set up Magento with eesel?</summary>

You need admin access to a Magento 2 store, so you can reach **System > Extensions > Integrations**, and your store's base URL. Nothing needs installing on the store.

</details>

<details>

<summary>Should I give the Magento integration full or custom resource access?</summary>

Either works. **All** gives it everything your admin account can reach. **Custom** limits it to the resources you tick, which is a hard ceiling on what your agent can see and change. Granting a resource does not turn an action on; you choose that later, per action.

</details>

<details>

<summary>Is it safe to paste Magento credentials into eesel?</summary>

Yes. The four values go into a secure form, straight to eesel, never into the chat, and the form expires in 30 minutes.

</details>

## Related pages

* [Magento](https://docs.eesel.ai/integrations/e-commerce/magento.md) for what your teammate does with the store, and the full action list
* [E-commerce Sales Rep](https://docs.eesel.ai/use-cases/e-commerce-sales-rep.md) for the job your agent does on a store
* [Chat Bubble](https://docs.eesel.ai/integrations/chat-surfaces/chat-bubble.md) for putting your agent on the storefront
* [Actions and Approvals](https://docs.eesel.ai/instructions-and-memory/actions-and-approvals.md) for choosing what your agent may do
* [Integrations overview](https://docs.eesel.ai/integrations/overview.md) for how sources, triggers and actions fit together
* [Set up from Claude Code or the terminal](https://docs.eesel.ai/getting-started/set-up-from-a-coding-agent.md)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.eesel.ai/integrations/e-commerce/magento/magento-setup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
