Inventory (Shopify & Virtualstock Supplier)

Introduction

This process flow retrieves the product listing associated with the Patchworks sales channel that you defined in Shopify, and then updates Virtualstock Supplier with new stock levels:

It's important to ensure that ONLY SKUs that you want to sync with Virtualstock Supplier are associated with the Patchworks app sales channel in Shopify - otherwise processing time will be longer.

Any SKUs pulled from Shopify are checked against the SKU Lookup cross-reference table and mapped to the relevant Virtualstock Supplier part number.

Then, Patchworks makes a call to Virtualstock Supplier to retrieve the product by part number (this is needed to obtain the associated URL ID of the product). We then use the URL ID to make a second call into Virtualstock Supplier to update the stock level.

Process flow snapshot

Process flow snapshot

Operations count

The operations count for this process flow is: 3 per sync.

Process flow shapes

For reference, all shapes in this process flow are documented below. Do not change shape settings unless advised to do so in our installation guide.

Shape
Notes

Trigger

Connector

Script

These settings should not be changed. For reference, the required settings are: Script: Replace negative qtys with 0 Version: v1 (latest)

Flow control

There should be no need to change any settings for this shape. For reference, the required settings are: Source instance: N/A Source endpoint: N/A

Batch level: * Batch size: 1

Flow control

There should be no need to change any settings for this shape. For reference, the required settings are: Source instance: N/A Source endpoint: N/A

Batch level: *.variants Batch size: 1

Set variables

There should be no need to change any settings for this shape. For reference, the required settings are: Meta: Set as key: sku value: [[payload.0.sku]]

Add to cache

These settings should not be changed. For reference, the required settings are: Cache: (Flow run) ShopifyVariantStockLevel Cache key: ShopifyVariantStockLevel.[[payload.0.sku]] Append: OFF Save all pages: OFF

Map

Filter

There should be no need to change any settings for this shape. For reference, the required settings are:

Source instance: N/A Source endpoint: N/A Filters: Set as: *.part_number string not equals 0 Keep matching: ON

Connector

If instance credentials are provided as part of the blueprint installation, there should be no need to change any settings for this shape. For reference, the required settings are:

Source instance: Virtualstock Supplier Source endpoint: GET Retrieve a product by part number Variables: Set as part number / [[payload.0.part_number]]

Add to cache

These settings should not be changed. For reference, required settings are: Cache: (Flow run) ShopifyVariantStockLevel Cache key: ShopifyVariantStockLevel.[[meta.sku]] Append: ON Save all pages: OFF

Load from cache

These settings should not be changed. For reference, the required settings are: Cache: (Flow run) ShopifyVariantStockLevel Cache key: ShopifyVariantStockLevel.[[meta.sku]] Fail on cache miss: OFF Load all pages: OFF

Script

These settings should not be changed. For reference, the required settings are: Script: Extract ProductId from URL Version: v3 (latest)

Map

Connector

If instance credentials are provided as part of the blueprint installation, there should be no need to change any settings for this shape. For reference, the required settings are:

Source instance: Virtualstock Supplier Source endpoint: PATCH Update stock availability Variables: Set as Product Rest Id / [[meta.productId]]

Scripts used in this process flow

Script
Summary

Replace negative qtys with 0

Replaces negative inventory quantities to zero quantities

Extract ProductId from URL

Extracts the URI from product details

Cross-reference lookups used in this process flow

Cross-reference lookup
Summary

SKU Lookup

Last updated