Brightpearl > Shopify - inventory stock

Introduction

This process flow updates Shopify with Brightpearl inventory. With no direct facility to retrieve the latest inventory from Brightpearl, the flow is designed to pull SKUs from the latest orders; search products in Brightpearl and retrieve availability information; compare this data with Shopify and sync changes.

Process flow snapshot

Click to view process flow snapshot

Limitations

Limitation
Summary

Retrieving inventory from Brightpearl

With no direct way to retrieve inventory or 'last changed' items using the Brightpearl API, a number of steps are needed to achieve the required results. As a result, this flow cannot be run on an automated schedule.

Assumptions

Assumption
Summary

Existing data status

Assumes all products and contacts are already synced in both systems

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

datefrom

Set the relative number of days to look back for updates. Update the default value as required. This variable is referenced in the first Shopify connector, where a filter query is defined to determine which SKUs to pull.

-20 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 for this flow is to run every 20 minutes. This is the recommended run frequency but the schedule can be changed if necessary.

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 skus from recent orders Filter : The default filter references the datefrom flow variable as below:

Connector (Brightpearl)

If you did not add or select a Brightpearl instance during the blueprint installation process, the following settings must be configured: Source instance : Set to your required Brightpearl instance

Source endpoint : Set to GET Search products Parameters : A default filter is defined to search (and match) on SKU where the value is set to [[payload.sku]].

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 Retrieve inventory data by GraphQL Location ID : Enter the location ID associated with the Shopify location that you want to search. Note that this flow is configured to process a single location. If you have multiple locations, you would need to redefine this flow with multiple branches.

Connector (Brightpearl)

If you did not add or select a Brightpearl instance during the blueprint installation process, the following settings must be configured: Source instance : Set to your required Brightpearl instance

Source endpoint : Set to GET Get Product availability Id : Set to [[payload]].

Connector (Brightpearl)

If you did not add or select a Brightpearl instance during the blueprint installation process, the following settings must be configured: Source instance : Set to your required Brightpearl instance

Source endpoint : Set to GET Get warehouse by id Id : Set to [[payload]].

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 Inventory adjust quantities graphQL Inventory Id : Set to [[payload.inventoryItemId]] Delta : Set to [[payload.delta]] Location Id : Set to [[payload.locationId]]

Reference

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

Scripts in this process flow

Script
Summary

Pull ID after product search

Pulls the ID from the retrieved Brightpearl data.

BP - generate graphql string for search

Creates a searchable string for Shopify.

BP - generate query for inventory search

Creates a query to search for product availability. Allows wide product set searches.

BP - calculate inventory for Shopify

Calculates the delta if there is one.

Cross-reference lookups in this process flow

This process flow does not use cross-reference lookups.

Last updated

Was this helpful?