# Magento

With Magento (Adobe Commerce) connected, the agent recognises a customer from the number they call from, finds an order by the order number the customer reads out, answers product questions by name or SKU, estimates shipping for an address and, if you allow it, places the order in the store for the identified customer or as a guest. **Integrations - Catalogue - Magento - Connect** opens the connect dialog. One connection is shared by every agent in the company.

  <ShotPlaceholder
    src="/assets/integrations/magento.png"
    name="magento-connect"
    alt="Connect Magento dialog with Store URL, Store view code, Authentication and the four OAuth keys"
    capture="Connect Magento dialog."
  />

## What you need before you start

An Integration in the Magento admin:

1. **System - Extensions - Integrations - Add New Integration**. Name it `Voice Logica`.
2. Under **API**, give it access to Customers, Sales and Catalog. Placing orders goes through the Magento cart, so allow cart access too if the agent will take orders.
3. **Save**, then **Activate**. Magento shows four values: Consumer Key, Consumer Secret, Access Token and Access Token Secret. Copy all four.

This OAuth 1.0a method works on every Magento 2.4 release and does not expire. A single bearer / integration token is also accepted, but Magento 2.4.4 and later reject integration tokens used that way unless the store's OAuth settings allow it.

## What you enter

- **Store URL** (required) — The store's base address with `https://`, no trailing slash, for example `https://myshop.example`.
- **Store name** — Display name for the connection. Optional.
- **Store view code** — For multi-store setups. Leave empty for the default store view.
- **Authentication** (required) — **OAuth 1.0a (4 keys)** or **Bearer / integration token**.
- **Consumer key** (required) — OAuth 1.0a only.
- **Consumer secret** (required) — OAuth 1.0a only.
- **Access token** (required) — OAuth 1.0a only.
- **Access token secret** (required) — OAuth 1.0a only.
- **Bearer / integration token** (required) — Bearer / integration token only.

**Connect** checks the credentials against the store before saving. There is no separate test button.

## First setup

1. **Integrations - Catalogue - Magento - Connect**, fill the store URL and the four keys, **Connect**. Magento appears under **Connected** and customers and products start copying in the background.

2. Open **My Agents**, pick the agent, then **Skills - Tools & Workflows**. Turn on **Magento** and click **Configure**.

3. Pick the operations. **Identify caller by phone** is on by default. Add **Get orders by customer**, **Get order by id** and **Search products** for order and product questions. Add **List shipping options** and **Create order** only if the agent should take orders, and set **Max order lines**.

4. Click **Save** in the settings window, then **Save** the agent.

5. Call the agent from a phone number saved on a Magento customer (or use **Try this agent**). Ask "Can you check order 000000123?" with a real order number from your store. The agent should read back its status and items. Then ask for a product by name or SKU.

## What the agent can do

| Job | What happens on the call |
|-----|--------------------------|
| Recognise the caller | Matches the caller's number to a Magento customer. Can also find a customer by name or email and remember the number for next time. |
| Order questions | Reads the caller's recent orders, or one order by the order number the customer sees. **Pre-fetch recent orders on call start** loads them before the agent speaks. |
| Product questions | Searches by name or SKU and reads one product's details. |
| Take an order | Estimates shipping methods and rates for an address, then places the order through the cart for the identified customer or a guest. Shipping and payment methods are chosen from those the store offers for that order. |

Customers and products are refreshed daily.

## Troubleshooting

**Connect fails with an authentication error**

Check that the Integration is **Active** in Magento and that the four values come from the same Integration. If you chose **Bearer / integration token** on Magento 2.4.4 or later, switch to **OAuth 1.0a (4 keys)**: those versions reject integration tokens used as bearer tokens by default.

**The agent says no shipping or payment method is available**

Magento returned no shipping method for the caller's address, or no payment method for the order. Check the shipping methods and payment methods enabled for that store view, and that the agent collected a full shipping address.

**The agent cannot place an order for a product it found**

Orders are placed by SKU. When an item cannot be matched to a SKU, the order is refused. Make sure the product has a SKU and that **Search products** is selected, so the agent picks the item from your catalogue rather than from the caller's wording.

## Next Steps

[Get an integration working](https://docs.voicelogica.ai/integrations/) - company connection, then the agent tool.  
[Tools & Workflows](https://docs.voicelogica.ai/agent-configuration/built-in-tools/) - where the Magento tool is switched on.  
[WooCommerce](https://docs.voicelogica.ai/integrations/eshops/woocommerce/) - [Shopify](https://docs.voicelogica.ai/integrations/eshops/shopify/) - other store platforms.
