# 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: 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:

```
GET https://docs.personaldiscount.io/woocommerce-and-magento/create-an-access-token-in-magento2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
