Connectors / Service / Magento 2

Magento 2

Magento 2

The Tray.io Magento 2 connector allows you to manage your store/stores in Magento 2.

Overview

Magento is an e-commerce platform built on open source technology which provides online merchants with a flexible shopping cart system, as well as control over the look, content and functionality of their online store.

API INFO: The Base URL used for the Magento connector is https://[host]/rest/V1. More information can be found on their main API documentation (v1.0) site.

Authentication

Within the workflow builder, highlight the Magento connector.

In the Magento connector properties panel to the right of the builder, click on the Authenticate tab and the 'Add new authentication' button.

This will result in a Tray.io authentication pop-up modal. The first page will ask you to name your authentication and select the type of authentication you wish to create ('Personal' or 'Organisational').

The next page asks you for your 'Host' and 'Access token'.

The 'Host', aka Hostname, is a web URL of your Magento application.

In order to fetch your 'Access token', head to your Magento Admin account. Log in and navigate to System -> Extensions -> Integrations. This will open the Integrations page.

On the Integrations page, click the 'Add New Integration' button available at the top right corner.

Enter a unique name for the integration in the 'Name' field. Then enter your admin account password in the 'Your Password' field. You can also provide values for the other optional field as per your preference.

Now on the same page, click the 'API ' tab. Select the Magento resources the integration can access. You can select all resources or select a custom list.

Once done, click 'Save' to save your changes and return to the Integrations page. On the Integration page click the 'Activate' link in the grid that corresponds to the newly-created integration.

Then click 'Allow' to approve the access.

This will further prompt a modal displaying the newly generated 'Access token'.

Copy and paste the access token to your Tray.io authentication pop-up window. Now, click the 'Create authentication' button.

Go back to your settings authentication field (within the workflow builder properties panel), and select the recently added authentication from the dropdown options now available.

Your connector authentication setup should now be complete.

Available Operations

The examples below show one or two of the available connector operations in use.

Please see the Full Operations Reference at the end of this page for details on all available operations for this connector.

Example

In the following example we create a workflow that searches through the store's products and filter's results by simple products. We then get a product from the list based on the product SKU and Store ID.

To begin with, create a workflow with a Manual Trigger, then add a step from the Magento 2 connector with the operation set to Search products.

We are going to filter the search by simple products (not setting any filter will return all products available for the store). Select the Add filter element button to create a new filter object.

To filter by a simple product type we want to set the condition to Equals. The Filter field value will be set to type_id and the Filter value value will be simple.

;

Next, we add a step from the Magento 2 connector with the operation set to Get store configs, to retrieve the Store ID of our current store.

;

Next, we add a step from the Magento 2 connector with the operation set to Get product sku, to retrieve information about the simple product. Set the Store ID to the ID of one of the stores (returned by our Get store configs operation), by using a JsonPath as shown in the example:

We then need to the same for the SKU ID field, but setting a JsonPath to the Search products operation as shown in the example:

We will now be able to see information about an existing simple product in the Debug panel, as shown here in the example:

All Operations

Latest version:

1.0