> For the complete documentation index, see [llms.txt](https://docs.personaldiscount.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.personaldiscount.io/woocommerce-and-magento/create-an-access-token-in-magento2.md).

# Create an Access Token in Magento 2.x

In this little step-by-step tutorial we will learn how to allow Personal Discount to generate unique coupons in Magento.

### &#x20;1. Navigate to the Integrations panel

![](/files/-LZdbvm8nQnC-Yn0x6d0)

### 2. Click on Add New Integration

![](/files/-LZdcBoqUssyWJ5-3WEE)

### 3. Enter a name for the integration

![Click to enlarge the image](/files/-LZe12TJchyI2MjO_Fvj)

### 4. Open the API section and select Cart Price Rules

This resource will give Personal Discount full control over the coupons of your application.

![Click to enlarge the image](/files/-LZe0FQN5P9K88viA9Qr)

### 5. Hover over the Save button and click on Save & Activate

![](/files/-LZddkHOX3Xf13nJWV4u)

### 6. Click on Allow button to confirm access to Cart Price Rules

![](/files/-LZe0M636jLlFMxhTa6i)

### 7. Get your token

You will see a screen with 4 fields. The one you need is Access Token. Copy it to clipboard and click on Done.

![Click to enlarge the image](/files/-LZe0QQ-_dT62Tc-7vmp)


---

# 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.personaldiscount.io/woocommerce-and-magento/create-an-access-token-in-magento2.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.
