Shopify > NetSuite - create & update products

Introduction

At a high level, this process flow will:

  1. Fetch updated products from Shopify. A GraphQL request retrieves products modified since the last sync date.

  2. Check if a product exists in NetSuite.The flow searches NetSuite by SKU to determine if each product already exists.

  3. Create new products in NetSuite, where needed. If the product doesn't exist in NetSuite, a parent matrix item is created first, followed by child matrix items for any variants.

  4. Update existing products in NetSuite, where needed. If the product already exists in NetSuite, the flow checks for new variants in Shopify. If yes, new child matrix items are created in NetSuite. If no, the product price is updated.

Process flow snapshot

Click to view process flow snapshot

Limitations

Limitation
Summary

Product updates (general)

Currently, updates are limited to product price details.

Product updates (NetSuite requirements)

Matrix options must already exist in NetSuite, with their unique internal IDs. These IDs are required for cross-reference lookups, defined during your initial Patchworks setup.

Fixed variant structure

When a product is first created, child matrix items determine which matrix options apply for the entire product. Given the current API and complexities around NetSuite matrix items, these matrix options cannot be changed or removed later; once set, the variant structure is locked for a product.

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

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.

Flow variable
Summary
Default value

updatedat

Set the relative number of days to look back for product updates. Update the default value as required.

-10 minutes UTC

For information on working with flow variables, please refer to our flow variables documentation.

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
Notes

Trigger

The default schedule is set run every 10 minutes. You can edit this shape and define your preferred run schedule. Keep in mind that the lookback period is determined by the updatedat flow variable, so these two settings should align.

Notify

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 new and updated products Updated at : Set to {{flow.variables.updatedat}} Updated at references a flow variable value, defined in process flow settings.

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: SuiteQL compares SKUs to a value in NetSuite. This NetSuite connector is configured with a query that expects the comparison value in upccode. If you use a different field, please update the query accordingly.

Script

The Determine new or updated products script expects NetSuite SKU comparison values in upccode. If you use a different field to store these values (and you updated the NetSuite connector above accordingly), you must update this script to reflect the required field. Having saved and deployed your updated script, come back to this shape and ensure that the correct script version is selected. For information about working with scripts, please refer to our Custom scripting section.

Connector (NetSuite) Branch: Create new products

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 inventory item

Map Branch: Create new products

If you do not use NetSuite's upccode field to store comparison values for Shopify SKUs, you must update this map shape - change the upccode mapping rule as appropriate.

Connector (NetSuite) Branch: Create new products

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 inventory item

Map

Branch: Update productsCreate new child product

If you do not use NetSuite's upccode field to store comparison values for Shopify SKUs, you must update this map shape - change the upccode mapping rule as appropriate.

Reference

Reference information for this process flow is documented in the following sections:

Scripts in this process flow

Script
Summary

Extract SKUs for NetSuite search

Checks Shopify SKUs against NetSuite for new and existing products.

Determine new or updated products

Checks if there is a matching NetSuite ID to the SKU, then creates two arrays - one for the new products branch and another for the update products branch.

Pull NetSuite ID from matrix header

Pulls the ID from the header after a parent matrix item is created.

Cross-reference lookups in this process flow

Cross-reference lookup
Summary

Shopify location > Netsuite Location ID

Maps locations from Shopify to NetSuite. Requires setup before this process flow is used.

Shopify variants > Netsuite internal ID

Maps Shopify product size values to the corresponding internal ID associated with NetSuite's matrixoptioncustitem1 field. Requires setup before this process flow is used.

Last updated

Was this helpful?