> For the complete documentation index, see [llms.txt](https://docs.rishvi.co.uk/linnworks/llms.txt).
> Use it to discover all available pages before exploring further.

# Missing Town & Region Fix

Automatically update selected Linnworks orders when customer delivery or billing address region and town fields are missing.

## Overview

Missing Town & Region Fix is an automated address-cleaning solution for Linnworks. It checks selected orders and fills missing **Region** and **Town** values in the customer delivery and billing addresses.

Incomplete address information can cause issues during order validation, courier allocation, shipping-label generation, fulfilment, and dispatch. The macro helps reduce these issues by applying a configured fallback region value where required.

When a Region field is empty, the macro applies the configured **RegionName** value. When a Town field is empty, it uses the relevant address Region value as the Town.

The macro processes only the order IDs supplied through the Linnworks Rule Engine and saves qualifying address corrections back to the order customer information.

> Keep selected Linnworks order addresses complete by automatically filling missing Region and Town values.

## Who Should Use Missing Town & Region Fix

<Columns cols="2">
  <Card title="Warehouse & Fulfilment Teams" icon="package" horizontal="false" target="_self">
    Teams preparing orders for picking, packing, label generation, and dispatch can reduce manual address corrections before fulfilment.
  </Card>

  <Card title="Logistics Teams" icon="truck" horizontal="false" target="_self">
    Logistics teams can improve address completeness before customer details are submitted to courier systems.
  </Card>

  <Card title="Integration Administrators" icon="settings" horizontal="false" target="_self">
    Administrators configure the default RegionName value, enable the macro, create the Rule Engine action, and monitor execution logs.
  </Card>

  <Card title="Operations Teams" icon="bar-chart-2" horizontal="false" target="_self">
    Operations teams benefit from more consistent delivery and billing address information across selected orders.
  </Card>
</Columns>

## Key Features

<Columns cols="2">
  <Card title="Missing Region Detection" icon="map-pin" horizontal="false" target="_self">
    Checks delivery and billing address Region fields and identifies values that are empty.
  </Card>

  <Card title="Configurable Region Value" icon="settings" horizontal="false" target="_self">
    Uses the RegionName configuration parameter as the fallback value for missing Region fields.
  </Card>

  <Card title="Automatic Town Completion" icon="building-2" horizontal="false" target="_self">
    Fills a missing Town field using the relevant delivery or billing Region value.
  </Card>

  <Card title="Delivery and Billing Support" icon="map" horizontal="false" target="_self">
    Reviews both customer delivery and billing address information during processing.
  </Card>

  <Card title="Conditional Customer Updates" icon="check-circle" horizontal="false" target="_self">
    Saves customer information only when the order qualifies for correction under the macro logic.
  </Card>

  <Card title="Execution Logging" icon="bar-chart-2" horizontal="false" target="_self">
    Records validation, skipped orders, updates, errors, and completion through the macro logger.
  </Card>
</Columns>

## How Missing Town & Region Fix Works

Missing Town & Region Fix follows a defined sequence whenever it receives one or more order IDs from the Linnworks Rule Engine.

<Steps>
  <Step title="Step 1: Validate the order IDs" title-type="p">
    The macro checks whether any order IDs were supplied through the `OrderIds` parameter. If no IDs are available, it logs the issue and stops.
  </Step>

  <Step title="Step 2: Validate RegionName" title-type="p">
    The macro checks whether the configured `RegionName` parameter contains a value. If it is empty, processing stops.
  </Step>

  <Step title="Step 3: Retrieve the Linnworks order" title-type="p">
    For each selected order ID, the macro retrieves the corresponding order and customer information from Linnworks.
  </Step>

  <Step title="Step 4: Check the delivery address" title-type="p">
    The delivery Town and Region fields are reviewed to determine whether address correction is required.
  </Step>

  <Step title="Step 5: Check the billing address" title-type="p">
    The billing Town and Region fields are reviewed using the same validation logic.
  </Step>

  <Step title="Step 6: Apply skip behaviour" title-type="p">
    Under the documented macro logic, if either the delivery address or billing address already contains both Town and Region, the order is skipped.
  </Step>

  <Step title="Step 7: Fill missing Region values" title-type="p">
    Empty delivery or billing Region fields are populated with the configured `RegionName` value.
  </Step>

  <Step title="Step 8: Fill missing Town values" title-type="p">
    Empty Town fields are populated using the relevant delivery or billing Region value.
  </Step>

  <Step title="Step 9: Update the Linnworks order" title-type="p">
    The corrected customer information is saved back to the order.
  </Step>

  <Step title="Step 10: Record completion" title-type="p">
    The macro records validation results, skipped orders, updates, errors, and completion in the execution log.
  </Step>
</Steps>

## **Configure the Macro**

Once the app is installed, you need to create a macro configuration so the system knows which macro to run and which default region value should be applied.

This setup can be adjusted anytime based on your operational requirements.

### **Steps to Configure**

<Tabs>
  <Tab title="Step 1">
    **Go to Apps > Macro Configuration and click + Add new configuration.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779094211819-m4d4f11jrx-pasted-image-1779094207771.png?fm=auto&auto=compress%2Cformat" width="1368" height="568" alt="" priority={true} fetchPriority="high" />
  </Tab>

  <Tab title="Step 2">
    **Select the MissingTownAndRegionFix macro and click Create Configuration.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779432066999-qjr7crgcpif-pasted-image-1779432063882.png?fm=auto&auto=compress%2Cformat" width="1019" height="444" alt="" priority={true} fetchPriority="high" />

    This creates a new configuration where you can define the required region parameter.
  </Tab>

  <Tab title="Step 3">
    **In the Macro Configuration screen, add the configuration name and parameter value.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779432103934-26h72406ni2-pasted-image-1779432101816.png?fm=auto&auto=compress%2Cformat" width="718" height="516" alt="" />

    Configure the required parameter:

    - **RegionName** — enter the default region value that should be used when an order address has an empty Region field.

    Example:

    ```text
    Configuration Name: Missing Town & Region Fix

    RegionName: Greater London
    ```

    <Callout kind="warning" collapsed="false">
      **Note:** The value entered in **RegionName** is applied to missing delivery and billing address Region fields when the order qualifies for update.
    </Callout>
  </Tab>

  <Tab title="Step 4">
    **Make sure to enable the macro to continue with the Rule Engine configuration.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779432164558-ihm0f0139q-pasted-image-1779432162339.png?fm=auto&auto=compress%2Cformat" width="1256" height="29" alt="" />

    <Callout kind="warning" collapsed="false">
      **Note:** If the macro is not enabled, it will not appear in the **Action** value list when setting up the rule.
    </Callout>
  </Tab>

  <Tab title="Step 5">
    **Go to Orders > Rules engine and click + Add new rule.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779094587683-vdcfps4fxa-pasted-image-1779094584371.png?fm=auto&auto=compress%2Cformat" width="1369" height="606" alt="" />
  </Tab>

  <Tab title="Step 6">
    **Enter the rule name and click Create.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779432187066-ewlfa27mezj-pasted-image-1779432184918.png?fm=auto&auto=compress%2Cformat" width="322" height="192" alt="" style="width: 322px; height: auto; cursor: pointer; margin: 0 auto;" />
  </Tab>

  <Tab title="Step 7">
    **Click Add new, select Condition, set the condition as required, and save it.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779099941621-j5whfpzeq2-pasted-image-1779099937975.png?fm=auto&auto=compress%2Cformat" width="468" height="109" alt="" style="width: 468px; height: auto; cursor: pointer; margin: 0 auto;" />

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779432215415-hsc5m54cinc-pasted-image-1779432213243.png?fm=auto&auto=compress%2Cformat" width="637" height="309" alt="" style="width: 637px; height: auto; cursor: pointer; margin: 0 auto;" />

    Use a condition that identifies orders where address information should be checked and corrected.
  </Tab>

  <Tab title="Step 8">
    **Add the macro action and click Save.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779432302835-vttmd2w93ql-pasted-image-1779432299495.png?fm=auto&auto=compress%2Cformat" width="663" height="128" alt="" />

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779432323832-bd898yh6wjf-pasted-image-1779432321984.png?fm=auto&auto=compress%2Cformat" width="648" height="261" alt="" />

    In the **Add action** window, enter the **Action name**, for example:

    `Missing Town And Region Fix`

    - Set **Action type** to:

      `Execute a macro`
    - In **Action value**, select:

      `Missing Town And Region Fix`
    - Click **Save**

    <Callout kind="warning" collapsed="false">
      **Note:** If the macro is not enabled, it will not appear in the **Action** value list when setting up the rule.
    </Callout>
  </Tab>

  <Tab title="Step 9">
    **Review the saved rule setup.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779432399531-mrpp02fjzi-pasted-image-1779432395179.png?fm=auto&auto=compress%2Cformat" width="1303" height="572" alt="" style="width: 1303px; height: auto; cursor: pointer; margin: 0 auto;" />

    - Verify the condition and action are connected correctly
    - Click **Save** in the bottom-right corner to save the rule
  </Tab>
</Tabs>

## Key Benefits

Missing Region or Town values can delay address validation and downstream order processing. Missing Town & Region Fix applies consistent address-completion rules to selected Linnworks orders.

> Reduce manual address checks, improve data completeness, and prepare qualifying orders for smoother courier and fulfilment processing.

<Columns cols="2">
  <Card title="Reduce Manual Address Checks" icon="trending-down" horizontal="false" target="_self">
    Removes the need to manually inspect selected orders for missing delivery or billing Region and Town values.
  </Card>

  <Card title="Improve Address Data Quality" icon="check-circle" horizontal="false" target="_self">
    Helps keep customer delivery and billing address details more complete and consistent.
  </Card>

  <Card title="Support Courier Validation" icon="truck" horizontal="false" target="_self">
    Reduces address validation issues caused by missing Town or Region information.
  </Card>

  <Card title="Apply a Defined Region" icon="map-pin" horizontal="false" target="_self">
    Uses the configured RegionName value whenever a qualifying address has an empty Region.
  </Card>

  <Card title="Fill Missing Town Values" icon="building-2" horizontal="false" target="_self">
    Uses the relevant address Region value when the Town field is empty.
  </Card>

  <Card title="Automate Through Rule Engine" icon="play" horizontal="false" target="_self">
    Processes selected orders automatically when they match the configured Linnworks rule.
  </Card>
</Columns>

## Usage of App

Missing Town & Region Fix is triggered through the **Linnworks Rule Engine** to update qualifying customer address fields automatically.

### Execution

<Card title="Trigger via Rule Engine" icon="play" horizontal="false" target="_self">
  Call the Missing Town And Region Fix macro through the Rule Engine with the required `OrderIds` and configured `RegionName` value.
</Card>

### Outcome

When the macro runs against an order, it:

<Steps>
  <Step title="Validates required inputs" title-type="p">
    Confirms that OrderIds were supplied and that RegionName contains a value.
  </Step>

  <Step title="Reads customer address information" title-type="p">
    Retrieves the delivery and billing Town and Region values from the selected order.
  </Step>

  <Step title="Checks whether the order should be skipped" title-type="p">
    Applies the documented skip logic when either address already contains both Town and Region.
  </Step>

  <Step title="Fills missing Region values" title-type="p">
    Applies RegionName to qualifying empty delivery and billing Region fields.
  </Step>

  <Step title="Fills missing Town values" title-type="p">
    Uses the corresponding Region value when the delivery or billing Town is empty.
  </Step>

  <Step title="Updates Linnworks customer information" title-type="p">
    Saves the corrected customer delivery and billing address details back to the order.
  </Step>

  <Step title="Records execution results" title-type="p">
    Logs validation results, skipped orders, updates, errors, and completion.
  </Step>
</Steps>

## Input Parameters

Missing Town & Region Fix requires the following inputs:

| Parameter      | Required | Description                                                                                   |
| -------------- | -------- | --------------------------------------------------------------------------------------------- |
| **OrderIds**   | Yes      | The Linnworks order IDs to process. Supplied through the Rule Engine action.                  |
| **RegionName** | Yes      | The default Region value applied when a qualifying delivery or billing Region field is empty. |

Example values:

| Setting            | Example                     |
| ------------------ | --------------------------- |
| Configuration Name | `Missing Town & Region Fix` |
| RegionName         | `Greater London`            |

<Callout kind="warning" collapsed="false">
  **Important:** RegionName must contain a value. If it is empty, the macro logs the issue and stops without updating orders.
</Callout>

## Address Update Rules

The macro applies the following address-completion rules:

| Address Condition                           | Macro Behaviour                                                |
| ------------------------------------------- | -------------------------------------------------------------- |
| Delivery Region is empty                    | Applies RegionName when the order qualifies for update.        |
| Delivery Town is empty                      | Uses the delivery Region value.                                |
| Billing Region is empty                     | Applies RegionName when the order qualifies for update.        |
| Billing Town is empty                       | Uses the billing Region value.                                 |
| Delivery Town and Region are both populated | The documented macro logic marks the order to be skipped.      |
| Billing Town and Region are both populated  | The documented macro logic also marks the order to be skipped. |
| Either address is marked complete           | The order is skipped.                                          |
| Existing field already contains a value     | The populated value is not overwritten.                        |

## Example Scenarios

### Example 1: Missing Delivery Region and Town

| Field           | Before Processing | After Processing |
| --------------- | ----------------- | ---------------- |
| Delivery Region | Empty             | `Greater London` |
| Delivery Town   | Empty             | `Greater London` |

The macro first applies RegionName to the delivery Region and then uses that Region value for the missing Town.

### Example 2: Missing Billing Town

| Field          | Before Processing | After Processing |
| -------------- | ----------------- | ---------------- |
| Billing Region | `London`          | `London`         |
| Billing Town   | Empty             | `London`         |

The existing billing Region is preserved and copied into the empty billing Town field when the order qualifies for processing.

### Example 3: Complete Delivery Address

| Field           | Value            |
| --------------- | ---------------- |
| Delivery Region | `Greater London` |
| Delivery Town   | `London`         |

Under the documented skip logic, the order is skipped when the delivery address already contains both Town and Region, even when the billing address may still contain missing values.

## Recommended Test Region Values

For testing, use a recognisable placeholder value that makes updated orders easy to identify.

<Columns cols="2">
  <Card title="Recommended Test Value" icon="check-circle" horizontal="false" target="_self">
    Default Region
  </Card>

  <Card title="Example Production Value" icon="map-pin" horizontal="false" target="_self">
    Greater London
  </Card>
</Columns>

Other example values include:

- `England`
- `London`
- `Greater London`
- `Default Region`
- `United Kingdom`

Use a value that is suitable for your operational and courier requirements.

## Best Practices

> Test the macro with orders containing different combinations of missing delivery and billing address values before enabling it at scale.

<Columns cols="2">
  <Card title="Choose RegionName carefully" icon="settings" horizontal="false" target="_self">
    Configure a fallback value that is suitable for your address, shipping-label, and courier requirements.
  </Card>

  <Card title="Use targeted rule conditions" icon="sliders" horizontal="false" target="_self">
    Configure the Rule Engine to pass only orders that may require Town or Region correction.
  </Card>

  <Card title="Test delivery and billing scenarios" icon="check-circle" horizontal="false" target="_self">
    Test orders with missing delivery fields, missing billing fields, and combinations of complete and incomplete addresses.
  </Card>

  <Card title="Review the skip behaviour" icon="alert-circle" horizontal="false" target="_self">
    Confirm that the documented skip logic matches your intended workflow before enabling the macro widely.
  </Card>

  <Card title="Run before label generation" icon="package" horizontal="false" target="_self">
    Trigger the macro before courier validation or shipping-label creation.
  </Card>

  <Card title="Monitor execution logs" icon="bar-chart-2" horizontal="false" target="_self">
    Review logs for missing inputs, skipped orders, customer-information update failures, and completion.
  </Card>
</Columns>

## FAQ

**How is Missing Town & Region Fix triggered?**

The macro is triggered through the Linnworks Rule Engine. Matching order IDs are supplied automatically through the `OrderIds` parameter.

**What configuration value is required?**

The macro requires the `RegionName` parameter.

**What happens when RegionName is empty?**

The macro logs that RegionName is required and stops without processing the orders.

**Which addresses are checked?**

The macro checks both the customer delivery address and billing address.

**Which fields are checked?**

It checks the Town and Region fields in both address types.

**What happens when a Region field is empty?**

The configured RegionName value is applied when the order qualifies for correction.

**What happens when a Town field is empty?**

The macro uses the relevant delivery or billing Region value.

**Are existing Region values overwritten?**

No. Existing populated Region values are preserved.

**Are existing Town values overwritten?**

No. Existing populated Town values are preserved.

**When is an order skipped?**

Under the documented logic, the order is skipped if either the delivery address or billing address already contains both Town and Region.

**Can the order be skipped when one address is incomplete?**

Yes. Based on the documented behaviour, if the other address is already complete, the order may still be skipped.

**Does the macro add an order note?**

The supplied documentation describes customer-information updates and execution logging. It does not specify that an order note is added.

**Which Linnworks operation saves the changes?**

The macro saves the updated customer information using `SetOrderCustomerInfo`.

**Can multiple orders be processed in one run?**

Yes. The macro loops through the order IDs supplied through OrderIds.

**What happens when no OrderIds are supplied?**

The macro logs the issue and stops.

**What should be checked when an order is not updated?**

Confirm that OrderIds were supplied, RegionName is configured, and the order was not skipped because either delivery or billing already contained both Town and Region.

## Legal Information

- **Privacy Policy:** [https://rishvi.co.uk/privacy-policy/](https://rishvi.co.uk/privacy-policy/)
- **Terms and Conditions:** [https://rishvi.co.uk/terms-conditions/](https://rishvi.co.uk/terms-conditions/)

Please review these pages to understand how data is handled and the terms governing the use of this application.

## Summary

Missing Town & Region Fix automates the completion of selected Linnworks customer delivery and billing address fields.

Once connected to the Rule Engine, the macro validates OrderIds and RegionName, checks the delivery and billing addresses, fills qualifying missing Region values with RegionName, fills missing Town values from the relevant Region, and saves the updated customer information.

<Columns cols="2">
  <Card title="Automatic Region completion" icon="map-pin" horizontal="false" target="_self">
    Missing delivery and billing Region values are filled using the configured RegionName.
  </Card>

  <Card title="Automatic Town completion" icon="building-2" horizontal="false" target="_self">
    Missing Town values are filled using the corresponding address Region.
  </Card>

  <Card title="Controlled address updates" icon="check-circle" horizontal="false" target="_self">
    Existing populated values are preserved and updates follow the documented skip logic.
  </Card>

  <Card title="Rule Engine automation" icon="play" horizontal="false" target="_self">
    Selected orders are processed automatically through the configured Linnworks rule.
  </Card>
</Columns>

For orders that do not update as expected, review the Rule Engine and macro logs, confirm that RegionName has been configured, and check whether the order was skipped because either address already contained both Town and Region.
