# Magento

This guide is intended for Magento 2 merchants who are connecting their store to Violet. During this process, the merchant will install and configure the Violet extension through their Magento 2 admin dashboard and then generate and provide credentials to Violet through the Violet Connect onboarding tool. *Total time for completion is around 10 minutes.*

## Step 1: Install the Violet Extension

In this step you will obtain the Violet extension and install install it in your Magento store.

1. From the Magento Extension Marketplace grab the free [Violet extension](https://marketplace.magento.com/violet-violetconnect.html) by adding it your cart then completing the checkout. This will connect the extension to your Magento Connect account and immediately make it available for installation on any of your Magento stores.
2. In the following steps you will be using a terminal to connect to your Magento store and install the extension. If you are not familiar with this process you can learn more about it in the [Magento Documentation.](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/tutorials/extensions.html)
3. Open your terminal and connect to your Magento store.
4. Navigate to the root of your Magento installation.
5. Add the Violet extension to Composer and install it:

{% hint style="warning" %}
**Composer 2 is required.** Composer 1 has been deprecated and can no longer be used to install packages from Packagist. If you haven't already, [upgrade to Composer 2](https://getcomposer.org/upgrade/UPGRADE-2.0.md) before proceeding.
{% endhint %}

* Install from the [Magento Marketplace](https://marketplace.magento.com/violet-violetconnect.html):

  `composer require violet/violetconnect:1.2.0`
* Install from [Packagist](https://packagist.org/packages/violetio/magento2):

  `composer require violetio/magento2:1.4.3`

6. Enable the Violet extension:

   `php bin/magento module:enable Violet_VioletConnect`
7. Update the database schema to include Violet:

   `php bin/magento setup:upgrade`
8. Deploy static files:

   `php bin/magento setup:static-content:deploy -f`
9. Flush the Magento cache:

   `php bin/magento cache:flush`
10. The Violet extension is now installed in your Magento store.

![](/files/wGh2g2IrQvzsCI8XtvZ1)

## Step 2: EnableStandalone Bearer Tokens (v2.4.4+)

Violet requires the use of long-lived access tokens when interacting with your stores backend systems. If you are running Magento 2.4.4 or newer you will need to enable these tokens. For older versions these tokens are enabled by default.

1. Navigate to your Magento admin dashboard and sign in.
2. Navigate to Stores → Configuration → Services → OAuth.
3. In the selector labeled Allow OAuth Access Tokens to be used as standalone Bearer tokens, select `Yes`.
4. Click the Save Config button.

![](/files/R0P4gLS4G0mqYHz9tU49)

## Step 3: API Credentials

Violet requires API credentials to authenticate requests when interacting with your stores backend systems.

1. Navigate to your Magento admin dashboard and sign in.
2. From the left sidebar click **Violet**.
3. Click the **Create API Credentials** button.
4. A new API user with the necessary access scopes has now been created. You will provide these credentials to Violet in the next step.

![](/files/77qaDmWdX8KMdlHyAIse)

## Step 4: Provide Configured Credentials to Violet

**Store URL**\
This is the fully formed URL to where you have Magento installed. If you provide an incorrect URL the credentials will be rejected until the correct one is provided.

**API Key**\
This key is used in combination with the API Secret to verify and authenticate certain actions or events.

**API Secret**\
This key is used in combination with the API Key to verify and authenticate certain actions or events.

Once entered, click the **Connect** button to validate the credentials and complete the connection between your store and Violet. If the credentials are invalid you should check for any spaces or other copy/paste errors and try again.

Upon success you will be redirected back to the channel who first sent you to Violet.

![](/files/eYdGQ6SdE9kmhPQPUSaF)

***


---

# 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://merchant-help.violet.io/platform-guides/magento.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.
