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

# Order Split Macro (POD + Stock Adjust + PO Creation)

Automatically process POD orders in Linnworks by validating fulfilment location, adjusting non-POD stock lines, splitting POD items where required, moving POD orders to the configured POD location, and creating purchase orders.

Orders that contain POD items can require additional handling before fulfilment. These orders may need POD items separated from standard stock items, moved to a dedicated POD location, and converted into purchase orders for supplier processing.

The *OPT POD Split, Stock Adjustment & PO Creation* macro helps automate this workflow by checking selected Linnworks orders, identifying POD items, adjusting unavailable non-POD items, splitting mixed orders, moving POD orders to the configured POD location, and creating purchase orders for POD fulfilment.

This macro identifies POD items based on the order item title. Any order item with a title that starts with a double quote character is treated as a POD item.

> Automate POD order handling by splitting POD items, adjusting stock-backed lines, moving POD orders, and creating purchase orders from one macro workflow.

## **Configure the Macro**

Once the app is installed, you need to create a macro configuration so the system knows which macro to run, which source location to validate, and which POD location should receive POD orders.

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/1779270658028-iodd4zdjz9q-pasted-image-1779270652908.png?fm=auto&auto=compress%2Cformat" width="1368" height="568" alt="" priority={true} fetchPriority="high" />
  </Tab>

  <Tab title="Step 2">
    **Select the 2269\_StockAdjust\_POcreation macro and click Create Configuration.**

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

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

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

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

    Configure the required parameters, including:

    - **SourceLocation**

    - **PodLocation**
  </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/1779271587694-wspnws7vatm-pasted-image-1779271583409.png?fm=auto&auto=compress%2Cformat" width="1489" height="30" 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/1779271621895-arq2l6sh8y4-pasted-image-1779271616629.png?fm=auto&auto=compress%2Cformat" width="1536" height="680" 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/1779271651998-ywo4gxljpoa-pasted-image-1779271646909.png?fm=auto&auto=compress%2Cformat" width="319" height="191" alt="" style="width: 319px; 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/1779271711097-c42ib9j0vtl-pasted-image-1779271705587.png?fm=auto&auto=compress%2Cformat" width="1536" height="358" alt="" style="width: 1536px; 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/1779271731833-tgpn2hojfnn-pasted-image-1779271725922.png?fm=auto&auto=compress%2Cformat" width="638" height="360" alt="" style="width: 638px; height: auto; cursor: pointer; margin: 0 auto;" />

    Use conditions that target orders requiring POD processing.
  </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/1779271821345-qgq18yrh2qi-pasted-image-1779271815275.png?fm=auto&auto=compress%2Cformat" width="679" height="134" alt="" style="width: 679px; 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/1779271799119-le1a2yxiwvg-pasted-image-1779271794419.png?fm=auto&auto=compress%2Cformat" width="657" height="268" alt="" style="width: 657px; height: auto; cursor: pointer; margin: 0 auto;" />

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

    `StockAdjust_POcreation`

    - Set **Action type** to:

      `Execute a macro`

    - In **Action value**, select:

      `StockAdjust_POcreation`

    - 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/1779271855536-dtx63l6nnb9-pasted-image-1779271849329.png?fm=auto&auto=compress%2Cformat" width="1527" height="638" alt="" />

    - Verify the condition and action are connected correctly

    - Click **Save** in the bottom-right corner to save the rule
  </Tab>
</Tabs>

POD orders can require multiple operational actions before fulfilment. This macro helps reduce manual work by combining location validation, stock adjustment, POD splitting, order movement, identifier assignment, and purchase order creation into one automated process.

<Columns cols="2">
  <Card title="Automate POD Handling" icon="alarm-check" horizontal="false" target="_self">
    Identifies POD order lines and processes them automatically based on the configured source and POD locations.
  </Card>

  <Card title="Split Mixed Orders" icon="boxes" horizontal="false" target="_self">
    Separates POD items from mixed orders so POD lines can be moved and processed independently.
  </Card>

  <Card title="Adjust Non-POD Stock Lines" icon="bell" horizontal="false" target="_self">
    Reduces or removes non-POD order lines when available stock is lower than the ordered quantity.
  </Card>

  <Card title="Move POD Orders" icon="bar-chart-big-icon" horizontal="false" target="_self">
    Moves POD-only orders or split POD orders to the configured POD location.
  </Card>

  <Card title="Create Purchase Orders" icon="lucide-fast-forward" horizontal="false" target="_self">
    Creates a purchase order for resolved POD items using default supplier details and item cost extended properties.
  </Card>

  <Card title="Prevent Reprocessing" icon="lucide-message-circle-x" horizontal="false" target="_self">
    Applies the **pod\_macro\_ran** identifier so orders already processed by the macro can be skipped.
  </Card>
</Columns>

### How It Works

The macro checks each selected order, validates the fulfilment location, identifies POD and non-POD items, adjusts stock-backed lines, moves POD orders, and creates purchase orders.

<Steps>
  <Step title="Step 1" icon="airplay-icon" title-type="p">
    The macro starts execution and writes **OPT POD Macro Started** to the log.
  </Step>

  <Step title="Step 2" icon="airplay-icon" title-type="p">
    It checks whether any **OrderIds** were provided. If none are provided, the macro logs a warning and exits.
  </Step>

  <Step title="Step 3" icon="airplay-icon" title-type="p">
    The macro loads all stock locations and caches each location name and ID.
  </Step>

  <Step title="Step 4" icon="airplay-icon" title-type="p">
    It validates the configured **SourceLocation** and **PodLocation** against the cached Linnworks stock locations.
  </Step>

  <Step title="Step 5" icon="airplay-icon" title-type="p">
    The macro retrieves each unique selected order and skips any order that already has the **pod\_macro\_ran** identifier.
  </Step>

  <Step title="Step 6" icon="airplay-icon" title-type="p">
    For each order, the macro confirms that the order fulfilment location matches the configured **SourceLocation**.
  </Step>

  <Step title="Step 7" icon="airplay-icon" title-type="p">
    The macro identifies POD items. An item is treated as POD when its title starts with a double quote character.
  </Step>

  <Step title="Step 8" icon="airplay-icon" title-type="p">
    The macro separates the order into POD lines and non-POD lines.
  </Step>

  <Step title="Step 9" icon="airplay-icon" title-type="p">
    For POD items, the macro validates that the POD parent item has a default supplier.
  </Step>

  <Step title="Step 10" icon="airplay-icon" title-type="p">
    If a POD item is composite, the macro also validates that each linked child item has a default supplier.
  </Step>

  <Step title="Step 11" icon="airplay-icon" title-type="p">
    For non-POD items, the macro checks available stock at the source location and adjusts order lines when stock is unavailable or only partially available.
  </Step>

  <Step title="Step 12" icon="airplay-icon" title-type="p">
    If an order contains only POD items, the macro moves the whole order to the configured POD location without splitting.
  </Step>

  <Step title="Step 13" icon="airplay-icon" title-type="p">
    If an order contains both POD and non-POD items, the macro splits the POD items into a separate POD order.
  </Step>

  <Step title="Step 14" icon="airplay-icon" title-type="p">
    The macro moves the POD-only order or split POD order to the configured POD location.
  </Step>

  <Step title="Step 15" icon="airplay-icon" title-type="p">
    The macro resolves POD purchase items. Composite POD items are converted into their linked component items.
  </Step>

  <Step title="Step 16" icon="airplay-icon" title-type="p">
    The macro creates a purchase order for the POD order using the default supplier from the first resolved purchase item.
  </Step>

  <Step title="Step 17" icon="airplay-icon" title-type="p">
    The macro adds purchase order items using quantities from the POD order and unit costs from the inventory extended property named **cost**.
  </Step>

  <Step title="Step 18" icon="airplay-icon" title-type="p">
    The macro adds internal order notes and assigns the **pod\_macro\_ran** identifier to the processed POD order.
  </Step>

  <Step title="Step 19" icon="airplay-icon" title-type="p">
    The macro logs any errors and writes **OPT POD Macro Finished** when execution ends.
  </Step>
</Steps>

### **Usage of App**

This macro is designed to run against selected orders through the Rule Engine. It is useful when POD items need to be separated, moved to a POD location, and converted into purchase orders while standard stock items remain on the original order where possible.

<Card title="OrderIds" horizontal="false" target="_self">
  Defines the Linnworks order IDs that should be processed. Duplicate order IDs are removed before processing.
</Card>

<Card title="SourceLocation" horizontal="false" target="_self">
  Defines the fulfilment location that selected orders must currently belong to. Orders at a different fulfilment location are skipped.
</Card>

<Card title="PodLocation" horizontal="false" target="_self">
  Defines the Linnworks stock location where POD-only orders or split POD orders should be moved.
</Card>

<Card title="POD Item Detection" horizontal="false" target="_self">
  An order line is treated as a POD item when the item title starts with a double quote character.
</Card>

<Card title="pod_macro_ran Identifier" horizontal="false" target="_self">
  The macro uses this identifier to mark processed POD orders and skip orders that have already been processed.
</Card>

<Card title="Stock Adjustment for Non-POD Items" horizontal="false" target="_self">
  Non-POD lines are reduced or removed when available stock at the source location is lower than the ordered quantity.
</Card>

<Card title="Purchase Order Creation" horizontal="false" target="_self">
  The macro creates a purchase order at the POD location for the resolved POD purchase items.
</Card>

<Card title="Inventory Extended Property cost" horizontal="false" target="_self">
  The macro reads the inventory item extended property named **cost** and uses it as the purchase order item unit cost.
</Card>

<Card title="Execution Logging" horizontal="false" target="_self">
  The macro records location validation, skipped orders, stock calculations, POD splitting, PO creation, errors, and completion status using the macro logger.
</Card>

### **Key Points to Remember**

- The macro processes only the order IDs provided in **OrderIds**

- Duplicate order IDs are removed before processing

- The macro requires valid **SourceLocation** and **PodLocation** values

- Location names are matched using cached Linnworks stock locations

- Orders are skipped if their fulfilment location does not match **SourceLocation**

- Orders are skipped if they already have the **pod\_macro\_ran** identifier

- POD items are identified when the item title starts with a double quote character

- POD parent items must have a default supplier

- Composite POD child items must also have default suppliers

- Non-POD stock lines can be reduced or removed based on available stock

- POD-only orders are moved directly to the POD location without splitting

- Mixed orders are split so POD items move into a separate POD order

- One purchase order is created for the POD order

- Purchase order references use **PO-originalOrderNumber** or **PO-originalOrderNumber-podOrderNumber**

- Purchase order item cost is read from the inventory extended property named **cost**

- The macro assigns **pod\_macro\_ran** after successful POD processing

Once the macro is running, it helps automate the POD fulfilment workflow and reduce manual order splitting, movement, and purchase order creation.

### **What You Can Expect**

- **POD-only orders are moved to the POD location**\
  Orders containing only POD items are moved without being split.

- **Mixed orders are split**\
  POD items are separated into a new order while non-POD items remain on the original order.

- **Non-POD items are adjusted by stock availability**\
  If available stock is not enough, the macro reduces the quantity or removes the item from the order.

- **Internal notes are added**\
  The macro records stock adjustments, POD split information, POD direct handling, and POD movement details as internal order notes.

- **Purchase orders are created**\
  The macro creates a purchase order for the resolved POD items at the configured POD location.

- **Processed POD orders are marked**\
  The macro assigns the **pod\_macro\_ran** identifier to help prevent repeated processing.

- **Execution is logged**\
  The macro records when it starts, processes orders, skips orders, creates purchase orders, handles errors, and finishes.

### **Overall Impact**

This macro improves POD order handling by reducing manual splitting, stock adjustment, order movement, and purchase order creation. It helps teams process POD and non-POD items more consistently while keeping audit details visible through internal order notes.

### What To Do After the Macro Runs

After the macro has completed, review the processed orders and created purchase orders to confirm the POD workflow completed as expected.

### **Steps to Follow**

<Steps>
  <Step title="Step 1" title-type="p">
    Open Linnworks and locate the orders processed by the rule.
  </Step>

  <Step title="Step 2" title-type="p">
    Check whether the order was POD-only or mixed.
  </Step>

  <Step title="Step 3" title-type="p">
    For POD-only orders, confirm the order was moved to the configured **PodLocation**.
  </Step>

  <Step title="Step 4" title-type="p">
    For mixed orders, confirm that POD items were split into a separate POD order.
  </Step>

  <Step title="Step 5" title-type="p">
    Review internal order notes for stock adjustments, POD split details, or POD direct processing details.
  </Step>

  <Step title="Step 6" title-type="p">
    Confirm that the processed POD order has the **pod\_macro\_ran** identifier.
  </Step>

  <Step title="Step 7" title-type="p">
    Open Purchase Orders and confirm that the related POD purchase order was created.
  </Step>

  <Step title="Step 8" title-type="p">
    Continue with POD supplier processing, fulfilment review, or normal order dispatch workflow.
  </Step>
</Steps>

### **Why This Matters**

Automating POD order handling helps:

- Reduce manual order splitting

- Prevent repeated POD processing

- Improve accuracy when moving POD orders

- Create POD purchase orders consistently

- Keep stock-backed order lines aligned with available stock

- Record key changes through internal order notes

- Support faster fulfilment and supplier handoff workflows

### Best Practices

To get the most value from this macro, configure the locations, supplier data, and item extended properties carefully.

### **Recommended Guidelines**

- **Use exact location names**\
  Make sure **SourceLocation** and **PodLocation** match Linnworks stock location names.

- **Check POD item naming rules**\
  Confirm that POD item titles start with a double quote character, since this is how the macro identifies POD items.

- **Maintain default suppliers**\
  Ensure every POD parent item and composite child item has a default supplier.

- **Maintain item cost extended properties**\
  Add and maintain the inventory extended property named **cost** for POD purchase items.

- **Review mixed-order behaviour**\
  Confirm that your workflow expects POD items to be split into a separate order when a mixed order is processed.

- **Monitor internal notes**\
  Use the internal notes to review stock reductions, removed items, POD movement, and split details.

- **Avoid repeated rule triggers**\
  The macro uses **pod\_macro\_ran** to skip already processed orders, but rule conditions should still be configured carefully.

### **Troubleshooting**

<Card title="Order was skipped because of location mismatch" horizontal="false" target="_self">
  Confirm that the order fulfilment location matches the configured **SourceLocation**.
</Card>

<Card title="Invalid Source or POD location" horizontal="false" target="_self">
  Check that **SourceLocation** and **PodLocation** match existing Linnworks stock location names.
</Card>

<Card title="Order was already processed" horizontal="false" target="_self">
  The order may already have the **pod\_macro\_ran** identifier assigned.
</Card>

<Card title="POD item was not detected" horizontal="false" target="_self">
  Confirm that the item title starts with a double quote character.
</Card>

<Card title="Order skipped because supplier is missing" horizontal="false" target="_self">
  Confirm that the POD parent item and any composite child items have default suppliers.
</Card>

<Card title="Non-POD item was reduced or removed" horizontal="false" target="_self">
  Review stock levels and **InOrderBook** values at the source location. The macro adjusts non-POD lines based on calculated availability.
</Card>

<Card title="Purchase order cost is zero" horizontal="false" target="_self">
  Confirm that the inventory item has an extended property named **cost** and that its value can be parsed as a decimal.
</Card>

<Card title="Purchase order was not created" horizontal="false" target="_self">
  Review macro logs for supplier validation, resolved POD items, and purchase order creation errors.
</Card>

### **Summary**

The *OPT POD Split, Stock Adjustment & PO Creation* macro processes selected Linnworks orders by validating location, identifying POD items, adjusting non-POD stock-backed lines, splitting mixed orders, moving POD orders to a configured POD location, and creating purchase orders for POD items.

This helps automate a complex POD fulfilment workflow, reduce manual work, improve consistency, and keep POD processing visible through notes, identifiers, and purchase orders.
