Syncing Shopify Sales Orders with Netsuite

Syncing Shopify Sales Orders with Netsuite

Table of Contents

  1. Introduction
  2. Retrieving Sales Orders from Shopify
  3. Handling Shopify Customers in Netsuite
    1. Updating Existing Customers
    2. Creating New Customers
  4. Extracting and Manipulating Customer Details
  5. Creating or Updating Sales Orders
  6. Final Steps and Testing
  7. Conclusion

Introduction

Welcome back to this Boomi Bundle demo. In this part, we will be diving into the sales of the sink and discussing the process that comes with the bundle for retrieving sales orders from Shopify and syncing them to Netsuite. In Part One of this series, I went through the inventory item sync and the inventory levels, so be sure to check that out if you haven't already. Now, let's jump into the Shopify orders to Netsuite process.

Retrieving Sales Orders from Shopify

To retrieve sales orders from Shopify, we first need to set up the connector components required to connect to each account: one for Netsuite and one for Shopify. In the previous video, I explained how to set up this process step by step. Now, we can proceed to fetch the sales orders from the Shopify account. We filter the orders based on the "updated at minimum date" field in Shopify. This ensures that we only retrieve orders that have been modified after a specific date. We then handle the customers first inside Netsuite. We check if the Shopify customer already exists in our ERP and either update their details if they do or create a new customer if they are new. This is the first part of the branch shape in our process. Once we have handled the customer, we proceed to extract the customer details and do the same for the sales order. We check if the sales order already exists in the Netsuite account and either create a new one or update it based on that check.

Handling Shopify Customers in Netsuite

In this section, we focus on handling Shopify customers in Netsuite. We start with a subprocess called "Customer Upset". Here, we set up an entry point and a try-catch branch. The first thing we do is handle the customer details by mapping them from the order profile retrieved from the Shopify response to a dedicated customer XML profile. This is done using a map shape, which allows us to drag and drop properties from one profile to another. We can also manipulate values along the way, such as concatenating strings or performing numeric calculations. Once we have mapped the customer details, we create the customer in Netsuite by making an external request using the Netsuite connector shape. We pass the mapped customer profile as the request input and specify the operation as "Customer Create". If the customer already exists in Netsuite, we can choose to update their details instead of creating a new customer. This is determined by a decision shape that compares the result of a document cache lookup for the customer's external ID. If the customer exists, we fetch their internal ID from the cache and proceed with the update operation. Otherwise, we create a new customer. Finally, we store the result of the customer operation in the cache using the external ID as the index.

Extracting and Manipulating Customer Details

In this step, we focus on extracting and manipulating customer details. We use a map shape to map the result of an external call to Netsuite to retrieve the internal ID of the successfully processed customer. This internal ID is then mapped to the associated object ID in the response profile. We also map the shopify customer ID to the customer IDs ID field in the profile. This mapping allows us to store the internal ID and external ID (shopify ID) of the customer for future use. We can use this customer information in subsequent steps of the process.

Creating or Updating Sales Orders

Now that we have handled the customer details, we can proceed to create or update the sales orders. This is done in a subprocess called "Sales Order Upset". Similar to the customer upset subprocess, we set up an entry point, a try-catch branch, and a connector call to Netsuite. We make a request to Netsuite using the shopify sales order ID as the external ID. If the sales order exists, we store the result in the cache using the external ID as the index. If the sales order does not exist, we proceed to create a new sales order. We map the necessary fields from the Shopify response to the sales order create request profile. We also perform a lookup in the cache to fetch the external ID of the sales order, which we will use as the primary key for the update operation. Once the sales order operation is complete, we store the result in the cache using the external ID as the index.

Final Steps and Testing

In the final steps of the process, we check the success of the customer and sales order operations using decision shapes. We compare the results to undefined to determine if the records were successfully processed. If they were, we can proceed with any additional actions or store the results in the cache for future use. We also log the results and details of each shape for debugging purposes. To test the process, we can modify the dates of the orders in Shopify and run the sync again. This will ensure that the logic we have set up to determine whether records already exist in the account is working correctly.

Conclusion

In conclusion, the process of retrieving sales orders from Shopify and syncing them to Netsuite involves handling Shopify customers and creating or updating sales orders in Netsuite. By following the steps outlined in this process, you can ensure a smooth and efficient synchronization of data between Shopify and Netsuite. The use of connectors, mappings, and caches allows for seamless integration and accurate data transfer.

I am a shopify merchant, I am opening several shopify stores. I use ppspy to find Shopify stores and track competitor stores. PPSPY really helped me a lot, I also subscribe to PPSPY's service, I hope more people can like PPSPY! — Ecomvy

Join PPSPY to find the shopify store & products

To make it happen in 3 seconds.

Sign Up
App rating
4.9
Shopify Store
2M+
Trusted Customers
1000+
No complicated
No difficulty
Free trial