# Shopify > Brightpearl - sales orders

## Introduction

This flow retrieves new sales orders from Shopify (for a given lookback period) and syncs to Brightpearl. For `paid` orders, the order is created and payment terms are set. For pending orders, the order is created.

## Process flow snapshot

<details>

<summary><img src="/files/y1IE71BfODU6ZRj1HNMM" alt="" data-size="line"> Click to view process flow snapshot</summary>

<figure><img src="/files/6anX9qJN2cNSP2bNFxMD" alt=""><figcaption></figcaption></figure>

</details>

## Limitations

No limitations to note.

## Assumptions

<table><thead><tr><th width="266.79296875">Assumption</th><th>Summary</th></tr></thead><tbody><tr><td>Existing data status</td><td>Assumes all products and contacts are already synced in both systems.</td></tr></tbody></table>

## 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

The table below summarises [flow variables](/product-documentation/process-flows/building-process-flows/dynamic-variables/flow-variables.md) defined for this process flow.

<table><thead><tr><th width="163.5078125">Flow variable</th><th>Summary</th><th>Default value</th></tr></thead><tbody><tr><td><code>datefrom</code></td><td>Set the relative number of days to look back for updates. Update the default value as required.<br><br>This variable is referenced in the first Shopify connector, where a filter query is defined to determine which orders to pull.</td><td>-10 minutes UTC</td></tr></tbody></table>

{% hint style="info" %}
For information on working with flow variables, please refer to our [flow variables documentation](/product-documentation/process-flows/building-process-flows/dynamic-variables/flow-variables.md).
{% endhint %}

### 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="220.09375">Shape</th><th>Notes</th></tr></thead><tbody><tr><td>Trigger</td><td>The default schedule for this flow is to run <code>every 10 minutes</code>. This is the recommended run frequency but the schedule can be changed if necessary.</td></tr><tr><td>Connector (Shopify)</td><td><p>If you did not add or select a Shopify instance during the blueprint <a href="/pages/IUEvmNmJ8fj8u3vFE4Rn">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 orders via graphql for Brightpearl</code><br><code>Filter</code> : The default is set as below:</p><pre data-overflow="wrap"><code>fulfillment_status:partial OR fulfillment_status:unshipped OR fulfillment_status:unfulfilled AND (financial_status:authorized OR financial_status:paid OR financial_status:pending) AND created_at:>='{{flow.variables.datefrom}}'
</code></pre><p>If you need to pull more information for sales orders, you can extend this query. If you do so, check subsequent map shapes to ensure new fields are mapped where needed. </p></td></tr><tr><td>Connector (Brightpearl)</td><td><p>If you did not add or select a Brightpearl instance during the blueprint <a href="/pages/IUEvmNmJ8fj8u3vFE4Rn">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Brightpearl</code> instance</p><p><code>Source endpoint</code> :  Set to <code>GET Search contacts in company</code><br><code>Parameters</code> :  A default filter is defined to search (and match) on <code>primaryEmail</code> where the value is set to <code>[[payload.email]]</code>.</p></td></tr><tr><td>Connector <br>branch: <code>paid orders</code></td><td><p>If you did not add or select a Brightpearl instance during the blueprint <a href="/pages/IUEvmNmJ8fj8u3vFE4Rn">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Brightpearl</code> instance</p><p><code>Source endpoint</code> :  Set to <code>POST Create sales orders</code></p></td></tr><tr><td>Connector <br>branch: <code>paid orders</code></td><td><p>If you did not add or select a Brightpearl instance during the blueprint <a href="/pages/IUEvmNmJ8fj8u3vFE4Rn">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Brightpearl</code> instance</p><p><code>Source endpoint</code> :  Set to <code>POST Take payment</code> </p></td></tr><tr><td>Connector <br>branch: <code>pendinng orders</code></td><td><p>If you did not add or select a Brightpearl instance during the blueprint <a href="/pages/IUEvmNmJ8fj8u3vFE4Rn">installation process</a>, the following settings must be configured:<br><br><code>Source instance</code> : Set to your required <code>Brightpearl</code> instance</p><p><code>Source endpoint</code> :  Set to <code>POST Create sales orders</code>   </p></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

This process flow does not use scripts.

### Cross-reference lookups in this process flow

This process flow does not use cross-reference lookups.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.wearepatchworks.com/product-documentation/blueprints/patchworks-blueprints/shopify-and-brightpearl/available-process-flows-shopify-and-brightpearl/shopify-greater-than-brightpearl-sales-orders.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
