Brightpearl > Shopify - create/update companies, contacts & payment terms

Introduction

This flow starts by retrieving contact details from Brightpearl. A script aggregates all contacts under their respective companies, designating a primary contact to populate the company's financial details. New companies are added to Shopify, and existing companies are updated.

Process flow snapshot

Click to view process flow snapshot

Limitations

Limitation
Summary

Identifying updated companies in Brightpearl

Brightpearl does not have the facility to search for 'updated' companies, so all companies are retrieved and searched in Shopify.

Assumptions

Assumption
Summary

Sync direction

Running this flow assumes that you want to sync data in this direction (i.e. from Brightpearl to Shopify). If required, a flow for the reverse direction is available (Shopify > Brightpearl - company and contact update/create). You should run one or the other.

Customisation

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

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.

Shape
Notes

Trigger

The default schedule for this flow is to run daily at 05:00 PM. This is the recommended run frequency but the schedule can be changed if necessary.

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 all contacts

Filter

Having retrieved all contacts from Brightpearl, this filter shape determines the lookback period for the updatedOn timestamp. The default setting is -24 hours - you can change this as required (keeping your trigger schedule in mind).

Connector (Shopify) branch: first branch

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 all companies contacts and locations Company name : Set to [[payload.name]]

Connector (Shopify) branch: first branch

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 Add new contact to company

Connector (Shopify) branch: first branch

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 Add new company location via graphql

Connector (Shopify) branch: first branch

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 all locations of company Company ID : Set to [[payload.shopify_company_id.0.shopify_company_id]]

Connector (Shopify) branch: first branch

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 Update payment terms

Connector (Shopify) branch: second branch new contact

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 Add new contact to company

Connector (Shopify) branch: second branch new location

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 Add B2B company location via graphql

Connector (Shopify) branch: second branch update net terms

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 Update payment terms

Reference

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

Scripts in this process flow

Script
Summary

Brightpearl - group companies

Groups Brightpearl companies for easier splitting.

BP to Shopify - Determine new or updated companies

Creates an array of Shopify addresses.

Inject company ID into multiple contacts

Structures a company contact correctly (for adding a new contact).

Brightpearl - inject company id when adding new location

Structures a company location correctly (for adding a new location).

Split locations for payment terms

Splits locations as needed for the creation of payment terms.

BP to Shopify - determine new contact and new locations to add

Creates arrays for new contacts and locations.

Cross-reference lookups in this process flow

This process flow does not use cross-reference lookups.

Last updated

Was this helpful?