Shopify > NetSuite - create/update companies, locations & contacts
Introduction
Before pushing sales orders from Shopify to NetSuite, companies and contacts must exist in both systems. Running the NetSuite > Shopify - create/update companies, contacts & payment terms flow first ensures that companies are synced with payment terms. Thereafter, this flow can be run to update NetSuite with new/updated companies in Shopify.
The Shopify > NetSuite - create/update companies, locations & contacts flow does NOT sync payment terms.
Having received company details from Shopify and NetSuite, a script compares the two sets of data to determine new and updated records for NetSuite.
Companies are matched based on the company name. If an exact match is NOT found, the company is considered new; if an exact match IS found, the company exists. New companies follow one processing route and existing companies follow another:
New companies are created ( 'customers' are configured to be companies), followed by contacts, and finally, locations.
Existing companies are updated with new addresses and/or new contacts - updating existing addresses is not supported.
The time period for pulling new/updated data from Shopify is set using a flow variable. This value is passed into a Shopify variable via a mapping transform function. For more information, please refer to How the lookback period is set.
Process flow snapshot
Limitations
Payment terms
Payment terms are not synced from Shopify to NetSuite (they are synced from NetSuite to Shopify).
Addresses
For existing companies, new addresses are added but existing addresses are not updated.
Shopify GraphQL error handling
There is a known limitation with error handling for Shopify GraphQL. Please refer to the Error handling for Shopify GraphQL section for more information and a suggested approach that you may wish to adopt in your flows.
Assumptions
No assumptions to note.
Customisation
To ensure that this process flow runs as required, some customisation options are available. These are documented in the following sections:
Flow variables
The table below summarises flow variables defined for this process flow.
datesince
Sets a date and time relative to the given period. This is used to calculate the lookback period for company updates. Update as required. For more information, please refer to How the lookback period is set.
-1 hour UTC
How the lookback period is set
When retrieving company data from Shopify, the lookback period is determined as follows:
The relative date flow variable named
datesinceis defined with a lookback time period (the default setting is-360 minutes).A map shape outputs the
datesince(relative date) value as a custom string and converts this to an ISO date format.The relative date is passed into the Shopify connector shape.
The Shopify connector shape requests company details, passing in the relative date as a variable value (in the connector shape, this variable is displayed
Updated Sincebut its key istimestamp).The GraphQL query for the request endpoint includes constraints for
timestamp.
Process flow shapes
This process flow includes some shapes that can be configured with your own settings. Please see guidelines in the table below.
Shape settings determine the outcome of process flows. Do not change shape settings unless they are listed below.
Trigger
The default setting is to run hourly, which is recommended. You can change the schedule if required. Keep in mind that flow variables determine the lookback period, so these settings should align.
This flow is designed in a try/catch structure, so notifications are generated if any part of the flow fails. To achieve this, the catch route includes a notify shape, which must be configured for your own notification preferences.
Alert level: Defaults to error but can be changed if needed
Channel: Defaults to email + log but can be changed if needed
Email Limit: Defaults to 5 but can be changed if needed
Notification Group: Replace the notify placeholder which your required notification group.
Message: If required, you can change the placeholder message.
For more information please refer to our Notify shape and Notification groups pages.
Connector (Shopify)
If you did not add or select a Shopify instance during the blueprint installation process, the following settings must be configured:
Source instance : Set to your required Shopify instance.
Source endpoint : Set to POST Get updated companies and contacts V2
Connector (NetSuite)
If you did not add or select a NetSuite instance during the blueprint installation process, the following settings must be configured:
Source instance : Set to your required NetSuite instance.
Source endpoint : Set to POST suiteQL
Query: Leave as the default
Connector (NetSuite)
Route: New company
If you did not add or select a NetSuite instance during the blueprint installation process, the following settings must be configured:
Source instance : Set to your required NetSuite instance.
Source endpoint : Set to POST Create Customer
Connector (NetSuite)
Route: New company
If you did not add or select a NetSuite instance during the blueprint installation process, the following settings must be configured:
Source instance : Set to your required NetSuite instance.
Source endpoint : Set to POST Create Contact
Connector (NetSuite)
Route: New company
If you did not add or select a NetSuite instance during the blueprint installation process, the following settings must be configured:
Source instance : Set to your required NetSuite instance.
Source endpoint : Set to PATCH Update company address
Connector (NetSuite)
Route: Update company
If you did not add or select a NetSuite instance during the blueprint installation process, the following settings must be configured:
Source instance : Set to your required NetSuite instance.
Source endpoint : Set to POST suiteQL
Query: Leave as the default
Connector (NetSuite)
Route: Update company ➤ First branch
If you did not add or select a NetSuite instance during the blueprint installation process, the following settings must be configured:
Source instance : Set to your required NetSuite instance.
Source endpoint : Set to PATCH Update company address
Connector (NetSuite)
Route: Update company ➤ First branch
If you did not add or select a NetSuite instance during the blueprint installation process, the following settings must be configured:
Source instance : Set to your required NetSuite instance.
Source endpoint : Set to POST Create Contact
Reference
Reference information for this process flow is documented in the following sections:
Scripts in this process flow
Determine new or current company
For branching out the companies.
Output new company ID
Extracts and outputs the NS ID of the new company.
Add a Random Sleep
Adds a random sleep for 1 to 5 seconds.
Determine new contacts and locations v3
Determine new contacts and locations.
Cross-reference lookups in this process flow
No cross-reference lookups to note.
Last updated
Was this helpful?
