Magento 2
Provides integration into Magento 2 via the v2 REST API documented at https://devdocs.magento.com/guides/v2.3/get-started/bk-get-started-api.html.
Revision History
1.0.0.4 Initial Release
2.0.0.4 Added support for OpenAPI. Magento 2 rest definitions are now processed by OpenAPI. Made some changes among the property names to give all REST related nodes some form of familiarity.
2.0.1.0 Added support for store prefix in the URL.
Properties
Connection
Type: Connection Input
The Connection Property
MagentoBaseUrl
Type: String
Example: "https://magento.flowgear.net"
AccessToken
Type: Password
Example: "0lo8elslwlxql7lgtq9zf5cbskj7p1h6"
OperationId
Type: String Input
Populated by a GUID relevant to the selected Sample.
StorePrefix
Type: String Input
By default the Magento 2 node will target the default store as per the base URL (default/v1), here you can specify "all" or any other valid prefix to change the target store.
Request
Type: Multiline Text Input
The Request JSON payload, used for POST, PUT, and PATCH operations.
Response
Type: Multiline Text Output
The Response JSON payload, contains the response received from Magento 2.
ResponseCode
Type: String Input Output
The Response code that was received from the server such as 200 (success). Can be used to further validate calls.
Description
Type: String Input Output
The short description of the selected sample, usually detailing what kind of transaction that specific API call will perform. E.g. "Get a list of all stores"
Custom Inputs
Type: Text Input
Custom inputs are automatically created for the node when a sample containing url parameters has been selected. Url parameters that are part of the API call are required, while query type parameters can be removed or added based on individual need.
Example; the custom input "id" from the customerGroupRepositoryV1SavePut api call is required, while the custom input "searchCriteria[pageSize]" from quoteCartRepositoryV1GetListGet is not required.
Remarks
Setting up a Connection
This Node makes use of token-based authentication as described by Magento Token Based Authentication.
To set up a Connection, follow these steps:
- Capture the domain for the website as HTTPS into the MagentoBaseUrl property.
- Log in to Magento Admin and click System > Integrations to display the Integrations page.
- Click Add New Integration to display the New Integration page.
- Enter a unique name for the integration in the Name field. Then enter your admin password in the Your Password field. Leave all other fields blank.
- Click the API tab. Select the Magento resources the integration can access. You can select all resources, or select a custom list.
- Click Save to save your changes and return to the Integrations page.
- Click the Activate link in the grid that corresponds to the newly-created integration.
- Click Allow .
- Copy the value in Access Token and paste it into the AccessToken property in the Flowgear Connection.
Note: For Magento 2.4.4 and later, follow this additional step:
- Under
Configuration
,OAuth
, setAllow OAuth Access Tokens to be used as standalone Bearer tokens
toYes
. If you do not make this change, you will receive the errorThe consumer isn't authorized to access %resources
.
Using Search Criteria
When selecting samples that support query string parameters, your node will be populated with custom properties that look like this "searchCriteria[filterGroups][0][filters][0][field]". You can use these properties by filling in values such as the ones specified below.
An example of using search criteria for pulling a list of orders. If we wanted to find orders that belong to a certain customer and we know the customer e-mail address, we will use the following custom properties and their respective values.
searchCriteria[filterGroups][0][filters][0][field] = customer_email
searchCriteria[filterGroups][0][filters][0][value] = test@flowgear.net
searchCriteria[filterGroups][0][filters][0][conditionType] = eq
This will return orders that have a customer e-mail of test@flowgear.net
For a comprehensive guide on using Search Criteria, please see the Documentation.
Node Samples
Access Node Samples to see a list of available calls.
Examples
See this Sample Workflow for an example.