Articles in this section

Sync NetSuite orders and customers to Magento 2

The Business sellers that use Magento 2, often sell their products in multiple channels. Most of the Magento B2B and B2C customers create and track the sales order or customer data in the ERP system. In this scenario, the orders either are tracked in NetSuite, not logged-in at all, or manually written to Magento 2. As a merchant, you can sync the NetSuite order and customer data to Magento 2 using the NetSuite order to Magento 2 order (add) and the NetSuite customer to Magento 2 customer (add/update) integration flows.

Understand the data flows

The NetSuite order to Magento 2 order (add) and the NetSuite customer to Magento 2 customer (add/update) integration flows are added to the Flows > Order section.

Note

These flows are available only in the premium edition of the Integration App.

NetSuite order to Magento 2 order (add)

The NetSuite order to Magento 2 order (add) flow syncs the order and customer from NetSuite to Magento 2. On a scheduled basis, the flow gets the orders from NetSuite and syncs to Magento 2. The “Get orders from NetSuite” export gets the orders from NetSuite and the “Post orders to Magento 2” import creates the order in Magento 2.

The “Update Magento 2 order sync status” import marks the “is_exported_to_io” field as 1. This is to make sure that the orders synced using the NetSuite order to Magento 2 order (add) flow are not considered by the Magento 2 order to NetSuite order (add) flow.

The “Add or ignore a customer in Magento 2” import checks for the Magento 2 customer ID to confirm if the customer record already exists in Magento 2. If the customer record doesn’t exist in Magento 2, it creates a new customer record. If the customer already exists, the flow ignores to create a new customer record.

The “Write back order ID and line IDs to NetSuite” import sync back the order ID and order item line IDs to NetSuite. The flow checks for the item ID in Magento 2 and adds the appropriate items to the order. The flow also syncs:

  • Line details such as item, quantity, and price.

  • Shipping details such as shipping method and shipping address details. The shipping method is fetched using the 1:1 lookup in the NetSuite order to Magento 2 order (add) flow mappings.

  • Payment method. The payment method is fetched using the 1:1 lookup in the NetSuite order to Magento 2 order (add) flow mappings.

  • Cart-level discount amounts.

When you check the Sync order to Magento 2 when matching SKU is not found checkbox in the Settings > Order section > Order to Magento 2 tab, the flow syncs the orders to Magento 2 when a matching order SKU is not found in Magento 2. When you create an order in Magento 2 with a custom item that has no SKU, the order is synced and the flow writes back the line ID in the “eTail Order Line ID” field. If you uncheck the checkbox, the NetSuite order to Magento 2 order (add) flow doesn’t sync the order to Magento 2, and an error message “Unable to create the NetSuite order #### in Magento 2 as matching SKU(s) #### are not found in Magento 2.” is displayed on the Integration App Dashboard. By default, this checkbox is unchecked.

Important

Important :
  • The NetSuite order to Magento 2 order (add) flow syncs only cart-level discounts and does not sync line-level discounts and automatic discounts.

  • The flow syncs only order with inventory and matrix items.

The “Celigo Magento 2 Order Export” saved search criteria for this flow is by default defined as:

Order_saved_search_Criteria.jpg

Note

By default, the Transaction Type is set to “is Sales Order,” you can change this to cash sale or invoice as per your business needs.

NetSuite customer to Magento 2 customer (add/update)

The NetSuite customer to Magento 2 customer (add/update) flow adds or updates the customer information from NetSuite to Magento 2. The flow then writes back the customer IDs and address IDs to NetSuite. This is a real-time flow.

The “Get customer from NetSuite” export gets the customer information from NetSuite and the customers who qualify the defined lookup criteria are synced to Magento 2. The flow also writes back the customer ID and address IDs to NetSuite. For each customer record, the flow performs a lookup for the corresponding customer in Magento 2 using the parameter “ID” (Magento 2 Customer Id):

  1. If a customer already exists, the flow updates the existing customer record. The success count is shown as “1” on the Integration App Dashboard page.

  2. If a customer is not found, the flow then searches using the customer email and website. The customer ID is written back to NetSuite,

    1. If an existing customer record is found, update the existing customer record.

    2. If no match is found, create a new customer record in Magento 2.

Along with the customer data, the flow also syncs:

  • The address to Magento 2. The addresses are considered as the default shipping and billing address only if they are marked as the same on the NetSuite customer record.

Important

Important :
  • Different customers should be created in Magento 2 based on the website.

  • The customer records that are already synced using the Magento Customer to NetSuite Customer Add/Update flow, will not be synced again using the NetSuite customer to Magento 2 customer (add/update) flow.

  • The flow only performs the update or create action on the fields which exists in the NetSuite customer to Magento 2 customer (add/update) flow mappings.

  • The flow doesn’t delete any existing data on the customer record in Magento 2.

  • For any list type data such as address list, the existing values are not replaced by the new data.

  • Please ensure that the 'Celigo Async Realtime Export Runner' scripts are in the release status.

Before you run the flow

NetSuite order to Magento 2 order (add)

  • Be sure to configure the payment method (entity.payment.method) and shipping method (entity.extension_attributes.shipping_assignments[*].shipping.method) in the NetSuite order to Magento 2 order (add) flow’s mappings as defined in Magento 2.

  • Select at least one store in the Select active Magento 2 stores setting in the Settings > General section > General tab.

  • In Magento 2, if your store is tax inclusive, be sure to select the store in the Select Tax Inclusive Stores setting in the Settings > General section > Tax tab.

  • If your Magento 2 store is tax inclusive, the values in the “Price” and “Subtotal” tabs on the Magento 2 orders are tax inclusive.

  • While creating the order in NetSuite, be sure to select the eTail channel as Magento 2, and select the appropriate Magento 2 instance and Magento 2 store .

    eTail_tab_Magento2.jpg
  • If the multiple currencies check box is unchecked in NetSuite, it is recommended to update the existing mapping with a hard-coded value (Post orders to Magento 2).

    Export field (NetSuite)

    Import field (Magento 2)

    “USD”

    entity.base_currency_code

    “USD”

    entity.order_currency_code

  • In NetSuite, if the multiple currencies checkbox is checked (Setup > Company > EnableFeatures > Company tab > International section), it is recommended that you manually add the “currency” column to the Celigo Magento2 Order Export Search as follows:

    1. In NetSuite, go to the “Celigo Magento 2 Order Export Search [MAG2-INS1]: Results” page.

    2. Click Edit this Search .

    3. Go to Results tab > Columns sub-tab.

    4. Add a column as follows:

      Field

      Custom Label

      Currency : Symbol

      Currency

  • Be sure to verify the following columns are added in the Results tab in the Celigo Magento2 Order Export Search:

    Results

    Custom label

    Customer (Main Line): First Name

    First Name

    Customer (Main Line): Last Name

    Last Name

    Customer (Main Line): Email

    Email

    Customer (Main Line): Internal ID

    Customer Internal ID

NetSuite customer to Magento 2 customer (add/update)

Be sure to have the following details on the NetSuite customer record:

  • The customer is of type Individual .

  • The first name, last name, email address, and company name exists.

  • If the customer record is a company type, the first name and last name wouldn't be available, hence use the company name as both the first and last name. To accomplish this, use a handlebar expression in the field mapping.

  • In the eTail tab, eTail channel, Magento 2 instance, Magento 2 customer group (optional), and Magento 2 website are specified.

  • The qualification criteria match. The eTail channel must be Magento 2. The Magento 2 instance ID matches with the Magento 2 instance (InternalId) mapping. The customer is not a guest customer.

Important

Important: There is a known issue that the customer record is synced to Magento 2 for every alternate update and is scheduled to be fixed in the Q3 2021 release. To sync the customer record in real-time to Magento 2, configure the following steps as a workaround:
  1. Log in to your integrator.io account.

  2. Click Magento 2 - NetSuite integration app.

  3. Go to Flows > Order.

  4. Click on the NetSuite customer to Magento 2 customer (add/update) flow.

  5. On the flow builder page, click Get customer from NetSuite listener processor.

  6. In the Execution context drop-down menu, check the Suitelet / Restlet 1.0 box.

  7. Click Done.

  8. Click Save.

Run the data flow

  1. Log in to your integrator.io account

  2. Click Magento 2 - NetSuite Integration App tile.

  3. Go to Flows > Order.

  4. Enable the NetSuite order to Magento 2 order (add) flow using the on/off toggle switch.

  5. Run the flow.

Understand the records in NetSuite and Magento 2

The NetSuite order to Magento 2 order (add) flow syncs,

  • Shipping address and billing address to Magento 2.

  • Customer details such as customer name, email address, and customer group.

  • Order total, shipping total, cart-level discounts, and taxes.

  • Line-level details such as line items, tax items, and tax rate.

    Magento_2_order_export.jpg
  • After the order is synced to Magento 2, in NetSuite, on the sales order in the eTail tab, the eTail order exported checkbox is checked.

  • The flow later syncs back the values in the eTail Order Line ID field at the line-level, eTail Order ID, PO Number, and Magento 2 order number.

    Write_back_IDs.jpg
  • The payment method and shipping method as defined in the NetSuite order to Magento 2 order (add) flow’s mappings are synced to Magento 2 order.

  • The default order status of the order created in Magento 2 is Pending.

    Magento_Order.jpg

NetSuite customer to Magento 2 customer (add/update)

The NetSuite customer to Magento 2 customer (add/update) flow syncs the customer record from NetSuite to Magento 2. The flow writes back values to the Customer ID , eTail Address ID , Magento 2 Instance ID , and Magento 2 Website ID custom fields on the NetSuite customer record.

The Is Updated Via Celigo checkbox (NetSuite customerrecord > eTail tab) is checked to make sure that the customer synced to Magento 2 to ensure that the customer is not synced again using the NetSuite Customer to Magento 2 customer Add/Update flow.

Is_Updated_Via_Celigo.jpg

On the “Celigo Magento 2 Customer Id Map” record in NetSuite, the flow syncs the values in the Customer ID , Magento 2 Instance , Magento 2 Instance ID , and Magento 2 Website ID fields.

Celigo_Magento_2_customer_ID_map.jpg
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.