Proposal summary
A process to create and update Matrix items through API calls from Magento to Netsuite.
Requirement
To create and update matrix parent items as well as child items as per the request. The API call will be for either creating parent items or adding subitems under the parent items.
Our Solution
As per the understanding, the JSON response from Magento will have the details regarding the items to be created. After fetching the details from the JSON response we will look at whether it is to be created as a parent or sub-item.
If the matrix type is “PARENT” then we will create it as a parent item and if the type is “CHILD” then we will create it as a child item.
The rest of the default values and the field values will be set as per the mappings given inside the sheet:ElementVAPE – Data Mappings
And about the Custom list creation, we will not be able to create a new custom list, but we can change the list values inside the already existing one. So we will be looking at the option and will insert/choose the value from the already existing list.
For example, if the option “Flavour: Orange” is inside the JSON structure, then we will be looking at whether this option already exists. If an option called Flavour is existing, then we will add/insert the value “Orange” inside the option “Flavour”. But if this option is not available then we cannot add it as a new option.
We will create a RESTLET script to trigger this functionality. Upon calling this script credential, regarding the JSON data we will be creating the parent and child items respectively.
And after creating the items we will be creating a custom record to store the progress in the functionality. So by looking at the custom record we will be able to identify the script performance and also we will store the request, error response in the custom record.
Note
●The JSON data must include the details regarding the items. If it is a parent, the data should be wrapped with the details like ‘matrix type’, etc. If it is a child item/sub-item the data should contain details regarding the parent item.
●We assume there will be a difference in the JSON format for the “EDIT’ and “CREATE’ functionality.
●If the item is to be edited then please provide the status as “EDIT” and only send the fields that are to be edited along with the JSON format.
●We assume there will always be only a call to create either a Parent or child item. And there won’t be any combination of both.
●This proposal covers the update and creation of matrix items only, so if the products are to be enabled or not (Inactivation), then please let us know regarding it.
●For the Item Options given inside the JSON structure if it is not already created, then we cannot add it as a new option. But if the option exists then we can choose that value from the existing list or we can add a new value to the option. If the results of options are empty after the search then we will not be choosing any options on the creation of the Matrix items.
●This scenario will be applicable for both the Create and Update scenarios.
●Same credentials except for script id and Base, the URL will be changed for the integration.