# Stage 5: Review & test the Orders process flow (Shopify & Virtualstock Supplier)

## Introduction

In this stage you will access the *\[\[Orders]] Virtualstock >> Shopify* process flow.&#x20;

The process flow is pre-configured with all required settings, including any connector instances you defined as part of the [installation stage](https://doc.wearepatchworks.com/product-documentation/blueprints/patchworks-blueprints/shopify-and-virtualstock-supplier/installation-guide-shopify-and-virtualstock-supplier/stage-3-define-instances-and-install-the-app-shopify-and-virtualstock-supplier). On this page, we guide you through recommended checks so you can ensure the flow meets your requirements. &#x20;

## The steps

**Step 1**\
Select *process flows* > *process* from the left-hand navigation menu (or click [here](https://app.wearepatchworks.com/flows)). Your process flow list is displayed - for example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FpgVVZG2R50uJo2uZNn9q%2Fprocess%20flow%20list%20.png?alt=media&#x26;token=7a27d216-a481-4856-8571-f9409d5afdd6" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you've used Patchworks before installing the *Shopify & Virtualstock Supplie*r blueprint, you might see more than the three process flows shown here.
{% endhint %}

**Step 2**\
Click the *\[\[Orders]] Virtualstock >> Shopify* entry to open the process flow in edit mode.

**Step 3**\
Access settings for the [trigger shape](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/trigger-shape/trigger-shape-schedule) and edit the default schedule to reflect the frequency you want this process flow to run:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FX07w9m0Ta8C1lpdtets1%2Ftrigger%20shape%201.png?alt=media&#x26;token=8676555a-87ad-49a4-8f04-78c1158749af" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="info" %}
For guidance on defining trigger schedules, please see our [Trigger shape](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/trigger-shape/trigger-shape-schedule) page.
{% endhint %}

{% hint style="info" %}
Any schedule you define here won't affect the number of new orders received - just how frequently you collect them.&#x20;

New orders are determined by order status (rather than any time-based conditions). When the process flow runs, any orders with an `ORDER` status are pulled from Virtualstock Supplier and sent into Shopify - you can see this if you check the settings for the first connector shape in the flow:

<img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FjBW64uWWaMja75uRFnxb%2Forder%20status.png?alt=media&#x26;token=6afd2f6a-b07b-46ff-ab46-8e405717ac78" alt="" data-size="original">

When this operation is completed successfully, the order changes to an `ORDER_ACK` status, so it will never be picked up again in subsequent flow runs.
{% endhint %}

**Step 4**\
Access settings for the *first* [map shape](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/map-shape) and scan down the list to ensure the default settings meet your requirements. Here we are mapping FROM *Virtualstock Supplier* TO *Shopify*.

Generally, **default mappings do not need to be changed** however, the following fields should be checked with particular care and changes can be made if necessary:

<table><thead><tr><th width="312">Field</th><th>Notes</th></tr></thead><tbody><tr><td><code>Order.Inventory_behaviour</code></td><td>This affects your Shopify stock levels, and whether or not you will allow Shopify to receive the order if Shopify is out of stock. The default setting is: <code>decrement_obeying_policy</code>.  For more information, please see <a href="https://shopify.dev/docs/api/admin-rest/2024-07/resources/order#post-orders">Shopify's API documentation</a>.</td></tr><tr><td><code>part_number</code> > <code>variant_id</code></td><td>This field mapping uses a cross-reference-lookup transform function to convert <em>Shopify</em> SKUs to <em>Virtualstock Supplier</em> part numbers. Make sure that your <a href="stage-4-update-cross-reference-lookups-shopify-to-virtualstock-supplier">SKU Lookup cross-reference table</a> has been updated accordingly.</td></tr></tbody></table>

{% hint style="danger" %}
The following fields must NOT be changed:

* `Order Line Properties`
* `Order notes`
* `Order source_name`
  {% endhint %}

{% hint style="info" %}
If you would like to map additional fields (for example, billing address), this is fine. For guidance on defining field mappings, please see our [Working with field mappings](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/map-shape/working-with-field-mappings) page.
{% endhint %}

**Step 5**\
Access settings for the *second* [map shape](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/map-shape) and scan down the list to ensure the default settings meet your requirements. Here we are mapping FROM *Shopify* TO *Virtualstock Supplier*.

Generally, default mappings do not need to be changed however, the following fields should be checked with particular care:

<table><thead><tr><th width="312">Field</th><th>Notes</th></tr></thead><tbody><tr><td><code>supplier_delivery_date</code></td><td><p>The supplier delivery date is generated using a script transform function on this field. Here, we call the <a href="stage-5-review-and-test-the-orders-process-flow-shopify-and-virtualstock-supplier/changing-the-supplier-delivery-date-calculation-for-orders">Calculate dispatch date using order date script</a>, which calculates the supplier delivery date by adding a given number of days to the order creation date. </p><p></p><p>By default, <code>5</code> days are added. If you want to change this value, see <a href="stage-5-review-and-test-the-orders-process-flow-shopify-and-virtualstock-supplier/changing-the-supplier-delivery-date-calculation-for-orders">Changing the supplier delivery date calculation</a>. </p></td></tr><tr><td><code>Fulfillment_route</code></td><td><p>This attribute is used to send an acknowledgement back to <em>Virtualstock Supplier</em> after an order is created in Shopify. </p><p></p><p>By default, a custom string transform sends a text value of: <code>Direct to customer</code>. If necessary, you can change this value by editing the transform function. For guidance, please see our <a href="../../../../process-flows/building-process-flows/process-flow-shapes/standard-shapes/map-shape/working-with-field-transformations">Working with field mapping transforms</a> page.</p></td></tr></tbody></table>

{% hint style="info" %}
It should not be necessary to map additional fields here.
{% endhint %}

**Step 6**\
In *Virtualstock Supplier*, make sure you have some test orders (with an ORDER status) using part numbers that you added to the SKU lookup table [previously](https://doc.wearepatchworks.com/product-documentation/blueprints/patchworks-blueprints/shopify-and-virtualstock-supplier/installation-guide-shopify-and-virtualstock-supplier/stage-4-update-cross-reference-lookups-shopify-to-virtualstock-supplier).

**Step 7**\
Access settings for every connector shape in the flow (there are four) and double-check that the *source instance* is for a sandbox environment - for example:&#x20;

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FytetQo5ks6W4Fu8RYxek%2Fdemo%20instance.png?alt=media&#x26;token=45f93496-1a5b-4dd5-8434-f0c0a7db2fb5" alt=""><figcaption></figcaption></figure>

**Step 8**\
When you're satisfied that the flow is ready to test, click the *initialise flow* button from the actions bar:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FKmVpxqZd7Ciwto5LK3aD%2Finitialise%20flow.png?alt=media&#x26;token=edc23a95-e595-462d-aae7-3a042e6626a5" alt="" width="341"><figcaption></figcaption></figure></div>

The process flow should run and complete successfully. Check that the outcome is as expected in *Shopify* and *Virtualstock Supplier*.

**Step 9**\
Go to the [next stage](https://doc.wearepatchworks.com/product-documentation/blueprints/patchworks-blueprints/shopify-and-virtualstock-supplier/installation-guide-shopify-and-virtualstock-supplier/stage-6-review-and-test-the-fulfillments-process-flow-shopify-to-virtualstock-supplier).
