> For the complete documentation index, see [llms.txt](https://docs.adpage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adpage.io/data-and-insights/marketing-integrations/magento.md).

# Magento

Connect Magento 2 with integration credentials for orders, revenue, products and stock.

Connect Magento 2 so AdPage reads orders and product data from your shop directly. Magento has no consumer OAuth flow, so this is a credential connection: you create an integration in the Magento admin and paste four values into AdPage.

AdPage only reads. It never writes an order, a product or a price.

### Before you start

You need **administrator access to the Magento admin**, and your shop's REST API must be reachable from the internet. A staging environment behind an IP allowlist or basic auth will fail the connection test — correctly, because AdPage genuinely cannot reach it.

You will create a Magento *integration*, which yields four values:

| Value               | Magento's name for it |
| ------------------- | --------------------- |
| Consumer key        | Consumer Key          |
| Consumer secret     | Consumer Secret       |
| Access token        | Access Token          |
| Access token secret | Access Token Secret   |

{% hint style="warning" %}
**Magento shows these once.** After you activate the integration, the four values are displayed on a single screen and never again. Copy all four before closing it. Losing them means deleting the integration and creating a new one.
{% endhint %}

### Create the integration in Magento

{% stepper %}
{% step %}

#### Open the integrations screen

In the Magento admin, go to **System → Extensions → Integrations** and select **Add New Integration**. Name it something recognisable, such as `AdPage`.
{% endstep %}

{% step %}

#### Grant read access to the right resources

Under **API**, set Resource Access and select at least **Sales → Orders**, **Catalog → Products**, and **Stores → Settings** (the connection test reads the store configuration). Granting full access also works if your policy allows it.
{% endstep %}

{% step %}

#### Activate and copy the four values

Save, then select **Activate** on the integration row and approve. Magento displays the four values — copy all of them now.
{% endstep %}
{% endstepper %}

### Connect Magento in AdPage

{% stepper %}
{% step %}

#### Open the tile

Go to **Integrations**, select the container, and open the **Magento** tile.
{% endstep %}

{% step %}

#### Fill in the base URL and the four values

The **base URL** is your REST endpoint, including the API path — for example `https://yourshop.nl/rest/V1`. A trailing slash is removed automatically.

Paste the consumer key, consumer secret, access token and access token secret.
{% endstep %}

{% step %}

#### Save

AdPage calls your shop before storing anything and reads the store configuration to prove the credentials work. Credentials that fail are never saved, so the tile cannot claim to be connected while every widget stays empty.

On success the tile shows your store name, read from Magento itself — which is also your confirmation that you connected the shop you meant to.
{% endstep %}
{% endstepper %}

### What you get

Orders, revenue and product data in **Business & Revenue** and **Product Performance**, plus inventory available to the Data Assistant: stock levels, out-of-stock views, and demand against availability.

Order revenue also feeds the **Marketing Mix Model**, which needs a reliable revenue series far more than it needs tracked conversions.

### Reading the numbers

**Order status matters.** Magento keeps pending, processing, complete, cancelled and closed orders in the same place. A revenue figure that looks too high usually includes statuses you would not count as a sale.

**Multi-store views share one endpoint.** A Magento installation with several store views returns all of them. If a container should cover only one, say so to support so the scope can be set.

**Tax display varies.** Magento can report totals including or excluding tax depending on configuration. Check which yours does before comparing to another source.

### Troubleshooting

**The connection test fails immediately.** Check the base URL first — it must include `/rest/V1`, and it must be the public URL. `http://` instead of `https://`, or a staging host AdPage cannot reach, both fail here.

**"Unauthorized" or a 401.** One of the four values is wrong, or the integration was never activated. An integration that is saved but not activated produces tokens that do not work.

**"Forbidden" or a 403.** The credentials are valid but the integration lacks resource access. Edit it in Magento and grant the resources listed above.

**It worked and then stopped.** Someone deleted or reactivated the integration in Magento — reactivating issues new tokens and invalidates the old ones. Create fresh credentials and paste them again.

**Orders are missing for one store view.** See multi-store above.

Still stuck? Contact <support@adpage.io> with the container and the base URL — never the keys.


---

# 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.adpage.io/data-and-insights/marketing-integrations/magento.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.
