# NetSuite > Shopify - catalogs & pricing

## Introduction

This flow syncs new/updated catalogs and pricing from NetSuite to Shopify.

To start, we prepare SKUs and variant IDs to support catalog creation. Catalogs are then retrieved from NetSuite via a custom field named `custitemshopify_catalog`. Catalogs are pulled if this field is not empty and at least one price set.&#x20;

Having searched Shopify catalogs, a script determines whether new or updated catalogs are needed. Processing then continues down one of two branches:

* **New catalogs**. Creates the catalog, followed by price lists and publications; then new catalogues are updated with price lists and products.
* **Update catalogs**. Updates price lists and products.&#x20;

{% hint style="warning" %}
Catalog syncing is highly custom - every business has different product data structures, matching rules, and business logic. For example, some businesses match on SKU, others on UPC code, or custom fields. This flow provides base functionality; however, updates may be required to meet your own business needs.
{% endhint %}

## Process flow snapshot

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FSUvxsp8XwrC9qsafJMIe%2Ficon%20process%20flow.svg?alt=media&#x26;token=ad1dc886-4a4e-4cad-9ad0-3d755e0f3b5a" alt="" data-size="line"> Click to view process flow snapshot</summary>

<img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FxIszNkmFa8VSxwrxEodt%2FNetSuite%20%3E%20Shopify%20-%20catalogs%20%26%20pricing%20full%20flow.png?alt=media&#x26;token=43e79d63-86e1-4975-b26a-da199e5aec78" alt="" data-size="original">

</details>

## Limitations

<table><thead><tr><th width="316.98828125">Limitation</th><th>Summary</th></tr></thead><tbody><tr><td>Catalog creation</td><td>In NetSuite, catalogs are not available out of the box. This flow is designed to create and update catalogs - it does not add catalogs to companies.</td></tr><tr><td>Shopify GraphQL error handling</td><td>There is a known limitation with error handling for Shopify GraphQL. Please refer to the <a href="../../installation-guide-shopify-and-netsuite/stage-5-review-update-and-test-process-flows-shopify-and-netsuite#error-handling-for-shopify-graphql">Error handling for Shopify GraphQL</a> section for more information and a suggested approach that you may wish to adopt in your flows. </td></tr></tbody></table>

## Assumptions

* Products must be synced in both systems (see [Shopify > NetSuite - create & update products](https://doc.wearepatchworks.com/product-documentation/blueprints/patchworks-blueprints/shopify-and-netsuite/available-process-flows-shopify-and-netsuite/shopify-greater-than-netsuite-create-and-update-products)).
* A custom price level must be set in NetSuite (see [Installation ➤ Stage 2: NetSuite prerequisites](https://doc.wearepatchworks.com/product-documentation/blueprints/patchworks-blueprints/installation-guide-shopify-and-netsuite/stage-2-netsuite-prerequisites-shopify-and-netsuite#price-level-shopify-catalogue-price-level)).
* A custom field for catalog name must be set in NetSuite (see [Installation ➤ Stage 2: NetSuite prerequisites](https://doc.wearepatchworks.com/product-documentation/blueprints/patchworks-blueprints/installation-guide-shopify-and-netsuite/stage-2-netsuite-prerequisites-shopify-and-netsuite#netsuite-custom-fields)).
* This flow assumes that SKUs are stored in NetSuite's `upccode` field. If you use a different field to store this value, any connector queries, mappings and scripts referencing the `upccode` field must be updated. Please see the [Customisation ➤ process flow shapes](#process-flow-shapes) section for details.

## Customisation

To ensure that this process flow runs as required, some customisation options are available. These are documented in the following sections:

* [Flow variables](#flow-variables)
* [Process shape shapes](#process-flow-shapes)

### Flow variables

This process flow does not use flow variables.

### Process flow shapes

This process flow includes some shapes that can be configured with your own settings. Please see guidelines in the table below.

{% hint style="warning" %}
Shape settings determine the outcome of process flows. Do not change shape settings unless they are listed below.&#x20;
{% endhint %}

<table data-full-width="false"><thead><tr><th width="165.34375">Shape</th><th>Notes</th></tr></thead><tbody><tr><td>Trigger</td><td>This process flow is designed to be run manually.</td></tr><tr><td>Notify</td><td>This flow is designed in a try/catch structure, so notifications are generated if any part of the flow fails. To achieve this, the <code>catch</code> route includes a <a href="../../../../process-flows/building-process-flows/process-flow-shapes/standard-shapes/notify-shape">notify shape</a>, which must be configured for your own notification preferences. <br><br><code>Alert level</code>: Defaults to <code>error</code> but can be changed if needed<br><code>Channel</code>: Defaults to <code>email + log</code> but can be changed if needed<br><code>Email Limit</code>: Defaults to <code>5</code> but can be changed if needed<br><code>Notification Group</code>: Replace the <code>notify</code> placeholder which your required notification group. <br><code>Message</code>: If required, you can change the placeholder message.<br><br>For more information, please refer to our <a href="../../../../process-flows/building-process-flows/process-flow-shapes/standard-shapes/notify-shape">Notify shape</a> and <a href="../../../../general-settings/notification-groups">Notification groups</a> pages.</td></tr><tr><td>Connector (NetSuite)</td><td><p>If you did not add or select a NetSuite instance during the blueprint <a href="../installation-guide-shopify-and-netsuite/stage-4-install-the-blueprint-shopify-and-netsuite">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>NetSuite</code> instance.<br><code>Source endpoint</code> :  Set to <code>POST suiteQL</code></p><p><code>Query</code>: SuiteQL compares SKUs to a value in NetSuite. This NetSuite connector is configured with a query that expects the comparison value in <code>upccode</code>. If you use a different field, please update the query accordingly.</p></td></tr><tr><td>Connector (Shopify)</td><td>If you did not add or select a Shopify instance during the blueprint <a href="../installation-guide-shopify-and-netsuite/stage-4-install-the-blueprint-shopify-and-netsuite">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Shopify</code> instance.<br><code>Source endpoint</code> :  Set to <code>POST Get variant IDs from SKU</code>        </td></tr><tr><td>Connector (Shopify)</td><td>If you did not add or select a Shopify instance during the blueprint <a href="../installation-guide-shopify-and-netsuite/stage-4-install-the-blueprint-shopify-and-netsuite">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Shopify</code> instance.<br><code>Source endpoint</code> :  Set to <code>POST Search Shopify catalogs</code> <br><code>Variables</code> : Leave the <code>Catalog Name</code> variable as it defaults. </td></tr><tr><td>Connector (Shopify)<br><br>Route: <code>New catalogs</code> </td><td>If you did not add or select a Shopify instance during the blueprint <a href="../installation-guide-shopify-and-netsuite/stage-4-install-the-blueprint-shopify-and-netsuite">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Shopify</code> instance.<br><code>Source endpoint</code> :  Set to <code>POST Create new catalog</code> <br><code>Variables</code> : Leave the <code>Catalog title</code> variable as it defaults. </td></tr><tr><td>Connector (Shopify)<br><br>Route: <code>New catalogs</code> </td><td>If you did not add or select a Shopify instance during the blueprint <a href="../installation-guide-shopify-and-netsuite/stage-4-install-the-blueprint-shopify-and-netsuite">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Shopify</code> instance.<br><code>Source endpoint</code> :  Set to <code>POST Create a price list after catalog creation</code> <br><code>Variables</code> : Leave the <code>Catalog title</code> and <code>Catalog ID</code> variables as the defaults. </td></tr><tr><td>Connector (Shopify)<br><br>Route: <code>New catalogs</code> </td><td>If you did not add or select a Shopify instance during the blueprint <a href="../installation-guide-shopify-and-netsuite/stage-4-install-the-blueprint-shopify-and-netsuite">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Shopify</code> instance.<br><code>Source endpoint</code> :  Set to <code>POST Create publication after pricelist</code> <br><code>Variables</code> : Leave the <code>Catalog ID</code> variable as it defaults. </td></tr><tr><td>Connector (Shopify)<br><br>Route: <code>New catalogs</code> </td><td>If you did not add or select a Shopify instance during the blueprint <a href="../installation-guide-shopify-and-netsuite/stage-4-install-the-blueprint-shopify-and-netsuite">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Shopify</code> instance.<br><code>Source endpoint</code> : Set to <code>POST Update pricelist catalog</code> <br><code>Variables</code> : Leave the <code>Price List ID</code> variable as it defaults. </td></tr><tr><td>Connector (Shopify)<br><br>Route: <code>New catalogs</code> </td><td>If you did not add or select a Shopify instance during the blueprint <a href="../installation-guide-shopify-and-netsuite/stage-4-install-the-blueprint-shopify-and-netsuite">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Shopify</code> instance.<br><code>Source endpoint</code> :  Set to <code>POST Update products on catalog</code> </td></tr><tr><td>Connector (Shopify)<br><br>Route: <code>Update catalogs</code> </td><td>If you did not add or select a Shopify instance during the blueprint <a href="../installation-guide-shopify-and-netsuite/stage-4-install-the-blueprint-shopify-and-netsuite">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Shopify</code> instance.<br><code>Source endpoint</code> : Set to <code>POST Update pricelist catalog</code> <br><code>Variables</code> : Leave the <code>Price List ID</code> variable as it defaults. </td></tr><tr><td>Connector (Shopify)<br><br>Route: <code>Update catalogs</code> </td><td>If you did not add or select a Shopify instance during the blueprint <a href="../installation-guide-shopify-and-netsuite/stage-4-install-the-blueprint-shopify-and-netsuite">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Shopify</code> instance.<br><code>Source endpoint</code> :  Set to <code>POST Update products on catalog</code> </td></tr></tbody></table>

## Reference

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

* [Scripts used in this process flow](#scripts-in-this-process-flow)
* [Cross-reference lookups used in this process flow](#cross-reference-lookups-in-this-process-flow)

### Scripts in this process flow

<table><thead><tr><th width="293">Script</th><th>Summary</th></tr></thead><tbody><tr><td>Generate graphql string to search SKUs</td><td>Pulls Shopify IDs as strings for searching.</td></tr><tr><td>Add shopify details and group parent and child</td><td>Adds variant details to the NetSuite results for new/update catalog processing.</td></tr><tr><td>Determine if a new or update catalog</td><td>Determine if a new or update catalog is needed and creates arrays for new/update catalogs processing.</td></tr><tr><td>Merge catalog and price list ids and output products</td><td>Creates a large array which is subsequently split by flow control.</td></tr></tbody></table>

### Cross-reference lookups in this process flow

There are no cross-reference lookups to note for this flow.
