> 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).

# Set up Magento

Connecting Magento screen by screen: create the integration in Magento Admin, copy the four values it gives you, and paste them with your store URL into the secure form in eesel.

Connecting Magento, 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](/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 notices.
* **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.

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](/automations-and-schedules/automations-and-schedules.md) on your helpdesk, Slack or chat bubble. Then set each action to run on its own, ask you first, or stay off. Most stores keep refunds and cancellations on approval.

On a Magento storefront the chat bubble needs a wrapped snippet. That snippet, and why Magento needs it, is on the [Magento overview](/integrations/e-commerce/magento.md).

Two limits:

* **Orders.** An order is found by its exact order number or by the email address on it. There is no free-text order search, and Magento matches an order number literally, so a mistyped number finds nothing.
* **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); 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 notices 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>

If that action is set to ask you first, it is waiting on a person. Approve it and it runs.

</details>

## Related pages

* [Magento](/integrations/e-commerce/magento.md) for what your teammate does with the store, the full action list, and how it is billed
* [E-commerce Sales Rep](/use-cases/e-commerce-sales-rep.md) for the job your agent does on a store
* [Chat Bubble](/integrations/chat-surfaces/chat-bubble.md) for putting your agent on the storefront
* [Actions and Approvals](/instructions-and-memory/actions-and-approvals.md) for setting each action to run on its own, ask you first, or stay off
* [Integrations overview](/integrations/overview.md) for how sources, triggers and actions fit together
* [Set up from Claude Code or the terminal](/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 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://docs.eesel.ai/integrations/e-commerce/magento/magento-setup.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.
