Manual for NetSuite Integration Add-on for Magento 2 of Improved Import

- E-Commerce, Magento 2, Our extensions

This is an add-on of Improved Import and Export extension for Magento 2. With the NetSuite integration add-on, you can organize data exchange between your Magento 2 store and Oracle NetSuite ERP. 

'

Table of contents

Installation and configuration

Creating the API credentials in the Netsuite system

It is necessary to create appropriate credentials in the NetSuite ERP system before importing entities to Magento. To start configuration, go to https://system.netsuite.com and follow these steps:

Create a New Role

  1. Go to Setup > Users/Roles > Manage Roles > New
  2. Specify the Role Name
  3. Set the following permissions for the Role: 
Type Permissions
Transactions – Sales Order Level Full
Transactions – Adjust Inventory Level Full
Lists – Customers Level Full
Lists – Documents and Files Level Full
Lists – Item/Category Layouts Level Full
Lists – Items Level Full
Lists  – Presentation Categories Level Full
Setup – Login using Access Tokens Level Full
Setup – Web Services Level Full
  1. Click the ‘Save’ button

Create a New Employee

  1. Go to Lists > Employees > Employees > New
  2. Specify the required Employee attributes
  3. Set the role you have created for this very Employee

Create a New Integration

  1. Go to Setup > Integration > Manage Integrations > New
  2. Specify the required Integration attributes
  3. Set Authentication to ‘Token-based Authentication’ option
  4. Remember consumerKey and consumerSecret parameters

Create a new Access Token

  1. Go to Setup > Users/Roles > Access Tokens > New
  2. Click ‘New Access Token’ button
  3. Specify the required attributes
  4. Remember token and tokenSecret parameters.

Installing Improved Import extension, NetSuite Add-on and PHP libraries for your Magento 2

Improved Import extension and NetSuite Add-on

  1. Backup your web directory and Magento 2 store database
  2. Download Improved Import and NetSuite Add-on installation packages from your Firebear Studio account ‘Downloads’ section
  3. Copy the contents of the packages into /app/code/Firebear/ImportExport and to /app/code/Firebear/PlatformNetsuite folders. Make sure to create folders if required
  4. Navigate to your store root folder in the SSH console of your server:

  5. Run the setup upgrade command:

  6. Run the static content deploy command:

  7. Run the cache clean command:

Netsuite PHP library

  1. Navigate to your store root folder in the SSH console of your server:

  2. Run the command:

User Guide

Import categories to Magento 2 store

Configuring the import job

  1. Go to your Magento 2 store admin panel
  2. Go to System > Improved Import/Export > Import Jobs
  3. Click ‘Add New Job’ button

‘General Settings’ section of the job

  1. Go to the General Settings section of the import job
  2. Specify the ‘Job Title’

‘Import Settings’ section of the job

  1. Go to the Import Settings section
  2. SetUse API’ option to ‘Yes’
  3. In the ‘Entity’ field select ‘Categories’
  4. In the ‘Select A Platform’ field select ‘NetSuite Categories’

‘Import Behavior’ section of the job

  1. Go to the Import Behavior section
  2. In the ‘Import Behavior’ field select ‘Add/Update’
  3. Set ‘Category Level separated by’ field to : (colon)

Import Source section of the job

  1. Go to the Import Source section
  2. Fill in the ‘Saved search id’ field. It is necessary to create a saved search with items in the Netsuite system. All saved search data will be available for the import.
  3. Fill in the ‘Start Import from Page’ field
  4. Fill in the ‘Stop Import on Page’ field
  5. Fill in the ‘Endpoint’ field
  6. Fill in the ‘Host’ field
  7. Fill in the ‘Netsuite Account id to the Account’ field
  8. Fill in the ‘Consumer Key’ field
  9. Fill in the ‘Consumer Secret’ field
  10. Fill in the ‘Token’ field
  11. Fill in the ‘Token Secret’ field
  12. Click the ‘Validate file’ button

Map Attributes section of the job

  1. Go to the Map Attributes section
  2. Click the ‘Add New’ button and specify the attribute mapping

For example:

Run import

Click ‘Save & Run’ button to run the import procedure.

Import product items to Magento 2 store

Configuring the Saved Search in the Netsuite System

  1. Navigate into your NetSuite ERP and go to Lists > Search > Saved Searches
  2. Create a new search with the ‘Item search’ type
  3. In the search results tab, specify all the attributes which you will need imported to Magento 2

For example:

In the screenshot above you can see the fields which will be imported to Magento 2 as product attributes.

Configuring the import job

  1. Go to your Magento 2 store admin panel
  2. Go to System > Improved Import/Export > Import Jobs
  3. Click ‘Add New Job’ button

‘General Settings’ section of the job

  1. Go to the General Settings section of the import job
  2. Specify the ‘Job Title’

‘Import Settings’ section of the job

  1. Go to the Import Settings section
  2. SetUse API’ option to ‘Yes’
  3. In the ‘Entity’ field select ‘Products’
  4. In the ‘Select A Platform’ field select ‘Netsuite Items’ option

‘Import Behavior’ section of the job

  1. Go to the Import Behavior section
  2. In the ‘Import Behavior’ field select ‘Add/Update’
  3. Set ‘Category Level separated by’ field to > (greater-than sign)

‘Import Source’ section of the job

  1. Go to the Import Source section
  2. Fill in the ‘Saved search id’ field. It is necessary to create a saved search with items in the Netsuite system. All saved search data will be available for the import.
  3. Fill in the ‘Start Import from Page’ field
  4. Fill in the ‘Stop Import on Page’ field
  5. Fill in the ‘Endpoint’ field
  6. Fill in the ‘Host’ field
  7. Fill in the ‘Netsuite Account id to the Account’ field
  8. Fill in the ‘Consumer Key’ field
  9. Fill in the ‘Consumer Secret’ field
  10. Fill in the ‘Token’ field
  11. Fill in the ‘Token Secret’ field
  12. Click the ‘Validate file’ button

‘Map Attributes’ section of the job

  1. Go to the Map Attributes section
  2. Click the ‘Add New’ button and specify the attribute mapping

For example:

Tier price import

  1. Make sure the NetSuite saved search you have composed contains the attribute ‘Other Prices’ – this attribute is used to store tier prices
  2. Go to the Map attribute values section of the import job
  3. Specify the customer group mapping if needed

For example:

‘Map categories’ section of the job

  1. Go to the Map categories section
  2. Select a Root Category to which the product categories will be added

‘Custom logic for creation of configurable products’ section of the job

  1. Create a ‘Lot Numbered Assembly/Bill of Materials Items’ in the Netsuite system
  2. Specify matrix item name template option like as per the example below
    {itemid}-{custitem_attribute}

For example:

  1. Go to the Map Attributes section of the import job and map the ‘Netsuite Matrix item attribute’ to the configurable product attribute you will be using to create configurable products inside your Magento 2 store
  2. Go to Custom logic for creation of configurable products section of the import job
  3. Set the section settings as per the example below

For example:

Run import

Click ‘Save & Run’ button to run the import procedure.

Export simple products to NetSuite ERP

Configuring the Netsuite API Credentials

  1. Go to the Magento 2 admin panel
  2. Go to Stores > Settings > Configuration 
  3. Go to Firebear Studio > Import/Export > Netsuite Integration Details
  4. Fill in the ‘Endpoint’ field
  5. Fill in the ‘Host’ field
  6. Fill in the ‘Netsuite Account id to the Account’ field
  7. Fill in the ‘Consumer Key’ field
  8. Fill in the ‘Consumer Secret’ field
  9. Fill in the ‘Token’ field
  10. Fill in the ‘Token Secret’ field
  11. Click ‘Save Config’ button
  12. Go to System > Tools > Cache Management
  13. Refresh the ‘Configuration Cache’

Configuring the export job

  1. Go to the admin panel
  2. Go to System > Improved Import/Export > Export Jobs 
  3. Click the ‘Add New Job’ button

‘General Settings’ section of the job

  1. Go to the General Settings section
  2. Specify the ‘Job Title’

‘Export Settings’ section of the job

  1. Go to the Export Settings section
  2. In the ‘Entity’ field select ‘Products’

‘Export Behavior’ section of the job

  1. Go to the Export Behavior section
  2. Set ‘File Format’ field to ‘Netsuite product’
  3. Specify ‘Netsuite Image Folder Internal Id’ to import export product images to a special folder. The folder must be created in the Netsuite system. To get the folder id, open the Netsuite system https://system.netsuite.com and go to Documents > Files > File Cabinet.
  4. Specify ‘Netsuite Location Internal Id’ to import product qty to a specific location. To create a location record open the Netsuite system https://system.netsuite.com and go to Setup > Company > Classifications > Locations > New.
  5. Specify ‘Netsuite Subsidiary Internal Id’. To manage a Subsidiary open the Netsuite system https://system.netsuite.com and go to Setup > Other Setup > Subsidiaries.
  6. Specify ‘Netsuite Tax Schedule Internal Id’. To manage a Tax Schedules open the Netsuite system https://system.netsuite.com and go to Financial > Lists > Tax Schedules.
  7. Specify ‘Netsuite Tax Code Internal Id’. To manage a Tax Codes open the Netsuite system https://system.netsuite.com and go to Setup > Accounting > Tax Codes.
  8. Specify ‘Net Currency Internal Id’. To manage currencies open the Netsuite system https://system.netsuite.com and go to Financial > Lists > Currencies.
  9. Specify ‘Export Product Images’ option to export product images to Netsuite.

‘Export Source’ section of the job

  1. Set ‘Export Source’ field to ‘File’
  2. Fill in the ‘File Path’ field

Run export

Click ‘Save & Run’ button to run the export procedure. Check results on the Netsuite after export has been finished.

Import sales and orders to Magento 2 store

The order status labels MUST MATCH on both Magento 2 and Netsuite systems. To create a custom Magento status go to Stores > Settings > Order Status.

Configuring the import job

  1. Go to your Magento 2 store admin panel
  2. Go to System > Improved Import/Export > Import Jobs
  3. Click ‘Add New Job’ button

‘General Settings’ section of the job

  1. Go to the General Settings section of the import job
  2. Specify the ‘Job Title’ field

‘Import Settings’ section of the job

  1. Go to the Import Settings section
  2. SetUse API’ option to ‘Yes’
  3. In the ‘Entity’ field select ‘Orders’
  4. In the ‘Select A Platform attribute’ field select ‘Netsuite Orders’

‘Import Behavior’ section of the job

  1. Go to the Import Behavior section
  2. In the ‘Import Behavior’ field select ‘Add/Update’

‘Import Source’ section of the job

  1. Go to the Import Source section
  2. Fill in the ‘Endpoint’ field
  3. Fill in the ‘Host’ field
  4. Fill in the ‘Netsuite Account id to the Account’ field
  5. Fill in the ‘Consumer Key’ field
  6. Fill in the ‘Consumer Secret’ field
  7. Fill in the ‘Token’ field
  8. Fill in the ‘Token Secret’ field
  9. Click the ‘Validate file’ button

‘Map Attributes’ section of the job

  1. Go to the Map Attributes section
  2. Click the ‘Add New’ button and specify the attribute mapping

For example: 

Run import

Click ‘Save & Run’ button to run the import procedure.

Export sales and orders to NetSuite ERP

Creating a new order in Magento

Go to the Magento 2 store admin panel or frontend and create a new order.

Configuring the Netsuite API Credentials

  1. Go to the Magento 2 admin panel
  2. Go to Stores > Settings > Configuration 
  3. Go to Firebear Studio > Import/Export > Netsuite Integration Details
  4. Fill in the ‘Endpoint’ field
  5. Fill in the ‘Host’ field
  6. Fill in the ‘Netsuite Account id to the Account’ field
  7. Fill in the ‘Consumer Key’ field
  8. Fill in the ‘Consumer Secret’ field
  9. Fill in the ‘Token’ field
  10. Fill in the ‘Token Secret’ field
  11. Click ‘Save Config’ button
  12. Go to System > Tools > Cache Management
  13. Refresh the ‘Configuration Cache’

Configuring the export job

  1. Go to the admin panel
  2. Go to System > Improved Import/Export > Export Jobs 
  3. Click the Add New Job button

‘General Settings’ section of the job

  1. Go to the General Settings section
  2. Specify the ‘Job Title’

‘Export Settings’ section of the job

  1. Go to the Import Settings section
  2. In the ‘Entity’ field select ‘Order’

Export Behavior section of the job

  1. Go to the Export Behavior section
  2. Set ‘File format’ field to ‘Netsuite order’
  3. Specify ‘Netsuite Subsidiary Internal Id’. To manage a Subsidiary open the Netsuite system https://system.netsuite.com and go to Setup > Other Setup > Subsidiaries.
  4. Specify ‘Netsuite Customers Sales Rep Internal Id’. To manage Employees open the Netsuite system https://system.netsuite.com and go to Lists > Employees.
  5. Specify ‘Netsuite Customers Category Internal Id’. To manage a Customer Categories open the Netsuite system https://system.netsuite.com and go to Setup > Accounting > Accounting Lists.
  6. Specify ‘Netsuite Customers Terms Internal Id’. To manage Customer Terms open the Netsuite system https://system.netsuite.com and go to Setup > Accounting > Accounting Lists.
  7. Specify ‘Default Netsuite Customers Price Level Internal Id’. To manage Customer Price Levels open the Netsuite system https://system.netsuite.com and go to Setup > Accounting > Accounting Lists.
  8. Specify ‘Netsuite Order Department Internal Id’. To manage a Departments open the Netsuite system https://system.netsuite.com and go to Setup > Company > Classifications > Departments.
  9. Specify ‘Netsuite Order Location Internal Id’. To manage a Locations open the Netsuite system https://system.netsuite.com and go to Setup > Company > Classifications > Locations.
  10. Specify ‘Default Netsuite Order Shipping Item Internal Id’. To manage a Shipping Items open the Netsuite system https://system.netsuite.com and go to Lists > Accounting > Shipping Items.
  11. Check ‘Order’, ‘Items of Order’, ‘Addresses options for the Order’ entities attribute

‘Map Netsuite Custom Entity Fields’ section of the job

The section allows you to map the Magento 2 order attributes with Netsuite Transaction Body Fields.

For example:

Export Source section of the job

  1. Set ‘Export Source’ field to ‘File’
  2. Fill in the ‘File Path’ field

Run export

Click ‘Save & Run’ button to run the export procedure. Check results on the Netsuite after export has been finished.

Import customers to Magento 2 store

Configuring the Saved Search in the Netsuite System

  1. Navigate into your NetSuite ERP and go to Lists > Search > Saved Searches
  2. Create a new search with the ‘Customer search’ type
  3. In the search results tab, specify all the attributes which you will need imported to Magento 2

For example:

Configuring the import job

  1. Go to your Magento 2 store admin panel
  2. Go to System > Improved Import/Export > Import Jobs
  3. Click ‘Add New Job’ button

‘General Settings’ section of the job

  1. Go to the General Settings section of the import job
  2. Specify the ‘Job Title’

‘Import Settings’ section of the job

  1. Go to the Import Settings section
  2. SetUse API’ option to ‘Yes’
  3. In the ‘Entity’ field select ‘Customers And Addresses’
  4. In the ‘Select A Platform’ field select ‘Netsuite Customers’ option’

‘Import Behavior’ section of the job

  1. Go to the Import Behavior section
  2. In the ‘Import Behavior’ field select ‘Add/Update’

‘Import Source’ section of the job

  1. Go to the Import Source section
  2. Fill in the ‘Saved search id’ field. It is necessary to create a saved search with items in the Netsuite system. All saved search data will be available for the import.
  3. Fill in the ‘Start Import from Page’ field
  4. Fill in the ‘Stop Import on Page’ field
  5. Fill in the ‘Endpoint’ field
  6. Fill in the ‘Host’ field
  7. Fill in the ‘Netsuite Account id to the Account’ field
  8. Fill in the ‘Consumer Key’ field
  9. Fill in the ‘Consumer Secret’ field
  10. Fill in the ‘Token’ field
  11. Fill in the ‘Token Secret’ field
  12. Click the ‘Validate file’ button

‘Map Attributes’ section of the job

  1. Go to the Map Attributes section
  2. Click the ‘Add New’ button and specify the attribute mapping

For example:

Map Netsuite Customer Price Level’ section of the job

The section allows you to map the Magento 2 customer groups with Netsuite ‘Customer Price Level’ attribute. 

For example:

To manage a Customer Price Levels open the Netsuite system https://system.netsuite.com and go to Setup > Accounting > Accounting Lists.

Run import

Click ‘Save & Run’ button to run the import procedure.

Export customers to Netsuite ERP

Configuring the Netsuite API Credentials

  1. Go to the Magento 2 admin panel
  2. Go to Stores > Settings > Configuration 
  3. Go to Firebear Studio > Import/Export > Netsuite Integration Details
  4. Fill in the ‘Endpoint’ field
  5. Fill in the ‘Host’ field
  6. Fill in the ‘Netsuite Account id to the Account’ field
  7. Fill in the ‘Consumer Key’ field
  8. Fill in the ‘Consumer Secret’ field
  9. Fill in the ‘Token’ field
  10. Fill in the ‘Token Secret’ field
  11. Click ‘Save Config’ button
  12. Go to System > Tools > Cache Management
  13. Refresh the ‘Configuration Cache’

Configuring the export job

  1. Go to the admin panel
  2. Go to System > Improved Import/Export > Export Jobs 
  3. Click the ‘Add New Job’ button

‘General Settings’ section of the job

  1. Go to the General Settings section
  2. Specify the ‘Job Title’

‘Export Settings’ section of the job

  1. Go to the Export Settings section
  2. In the ‘Entity’ field select ‘Customer addresses’

‘Export Behavior’ section of the job

  1. Go to the Export Behavior section
  2. Set ‘File Format’ field to ‘Netsuite customer’
  3. Specify ‘Netsuite Subsidiary Internal Id’. To manage a Subsidiary open the Netsuite system https://system.netsuite.com and go to Setup > Other Setup > Subsidiaries.
  4. Specify ‘Netsuite Customers Sales Rep Internal Id’. To manage a Employees open the Netsuite system https://system.netsuite.com and go to Lists > Employees.
  5. Specify ‘Netsuite Customers Category Internal Id’. To manage a Customer Categories open the Netsuite system https://system.netsuite.com and go to Setup > Accounting > Accounting Lists.
  6. Specify ‘Netsuite Customers Terms Internal Id’. To manage a Customer Terms open the Netsuite system https://system.netsuite.com and go to Setup > Accounting > Accounting Lists.
  7. Specify ‘Default Netsuite Customers Price Level Internal Id’. To manage a Customer Price Levels open the Netsuite system https://system.netsuite.com and go to Setup > Accounting > Accounting Lists.

‘Export Source’ section of the job

  1. Set ‘Export Source’ field to ‘File’
  2. Fill in the ‘File Path’ field

‘Map Netsuite Customer Price Level’ section of the job

The section allows you to map the Magento 2 customer groupы with the Netsuite ‘Customer Price Level’ attribute. 

For example: 

To manage a ‘Customer Price Levels’ open the Netsuite system https://system.netsuite.com and go to Setup > Accounting > Accounting Lists.

Map Netsuite Custom Entity Fields’ section of the job

The section allows you to map the Magento 2 order attributes with Netsuite ‘Transaction Body Fields’.

For example: 

Run export

Click ‘Save & Run’ button to run the export procedure. Check results on the Netsuite after export has been finished.

Export customers to Netsuite ERP
by Magento Queues for Magento 2.3 CE+

Configuring the Netsuite API Credentials

  1. Go to the Magento 2 admin panel
  2. Go to Stores > Settings > Configuration 
  3. Go to Firebear Studio > Import/Export > Netsuite Integration Details
  4. Set ‘Customers Export to the Netsuite’ option to ‘Yes’
  5. Fill in the ‘Endpoint’ field
  6. Fill in the ‘Host’ field
  7. Fill in the ‘Netsuite Account id to the Account’ field
  8. Fill in the ‘Consumer Key’ field
  9. Fill in the ‘Consumer Secret’ field
  10. Fill in the ‘Token’ field
  11. Fill in the ‘Token Secret’ field
  12. Click ‘Save Config’ button
  13. Go to System > Tools > Cache Management
  14. Refresh the ‘Configuration Cache’

Configuring Magento 2 cron

‘Customers and addresses’ data will be automatically imported to the Netsuite by Magento queues extension. To do this, you need to run Magento сron on the server.

More info:

https://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html

Export customer data

  1. Register a new customer at your Magento 2 store
  2. Add a new address for the newly created customer either billing or shipping
  3. ‘Customers and addresses’ data will be automatically imported to Netsuite

 

'