Shopify > Brightpearl - order refunds

Introduction

The process flow retrieves refunded orders from Shopify, searches for a correlating order in Brightpearl and adds a credit note.

Process flow snapshot

Click to view process flow snapshot

Limitations

Limitation
Summary

'Hard coded' tax code

The last map shape in this flow includes a rows.*.taxCode rule, where a transform function outputs the value as T20. Further development would be needed to retrieve and utilise other tax codes.

Assumptions

There are no assumptions to consider for this flow.

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 refunds to pull.

-1 hour 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 hour. 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 refunded orders via graphql Filter : The default filter references the datefrom flow variable as below:

If you need to pull more information for refunded orders, you can extend this query. If you do so, check subsequent map shapes to ensure new fields are mapped where needed.

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 orders Parameters : A default filter is defined to search (and match) on externalRef where the value is set to [[payload.name]].

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 Order details Id : Set to [[payload.order_number]].

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 POST Create sales credit note

Reference

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

Scripts in this process flow

Script
Summary

Bp Order refunds

  • Builds a SKU → refund amount map from Shopify refund line items.

  • Matches those SKUs against Brightpearl order rows.

  • Collects matched Brightpearl items, attaching their refund amount and basic BP order/customer info.

  • Extracts the total Shopify refund amount and currency.

  • Outputs a structured JSON containing all matched BP rows with refund amounts plus the overall refund summary.

Cross-reference lookups in this process flow

This process flow does not use cross-reference lookups.

Last updated

Was this helpful?