Rule MacroRIS-RM-2171 – Shopify POS Location Stock Deduction

Shopify POS Location Stock Deduction

Automatically adjust stock levels for processed Shopify POS orders by checking today’s processed orders, identifying orders with the SHOPIFY_POS extended property, and reducing stock at the fulfilment location.

Shopify POS orders may require stock to be adjusted in Linnworks after the order is processed. When this update is handled manually, teams need to locate the processed order, confirm the fulfilment location, review the order items, and reduce stock for the relevant SKUs.

The Shopify POS Location Stock Deduction macro helps automate this process by checking processed orders from the current day and identifying orders that contain the SHOPIFY_POS extended property. When a matching order is found, the macro reduces the stock level for each non-service SKU at the order fulfilment location.

The macro also checks the stock item change history before applying an update. If a matching stock movement note already exists for the order, the stock adjustment is skipped to help avoid duplicate reductions.

Keep Shopify POS stock movements aligned by automatically reducing Linnworks stock for processed POS orders.

Configure the Macro

Once the app is installed, you need to create a macro configuration so the system knows which macro to run. This macro does not require order IDs or custom parameters because it searches processed orders directly.

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

Steps to Configure

Go to Apps > Macro Configuration and click + Add new configuration.

Shopify POS stock updates can be important when processed orders need to reduce available stock in the correct fulfilment location. This macro helps reduce manual stock adjustments and keeps stock movement history linked to the processed order.

How It Works

The macro searches processed orders from the current UTC day, checks each order for the SHOPIFY_POS extended property, and updates stock levels for eligible SKUs.

Step 1

The macro retrieves all stock locations from Linnworks.

Step 2

It sets the search start time to the beginning of the current UTC day.

Step 3

It searches processed orders using processed date from the start of the current day up to the current UTC time.

Step 4

For each processed order, the macro logs the order number and fulfilment location.

Step 5

The macro identifies the fulfilment location and matches it to a Linnworks stock location.

Step 6

The macro retrieves the full order details using the processed order ID.

Step 7

It checks whether the order contains an extended property named SHOPIFY_POS.

Step 8

For each eligible order item, the macro skips service items and blank SKUs.

Step 9

If the item has composite sub-items, the macro processes each composite component.

Step 10

If the item is not composite, the macro processes the order item directly.

Step 11

Before updating stock, the macro checks stock item change history for an existing order reference note.

Step 12

If the stock movement note already exists, the macro logs that the order reference log is already available and skips the stock adjustment.

Step 13

If the stock movement note does not already exist, the macro reduces stock by the ordered quantity.

Step 14

The macro logs each stock update and writes Macro Finished when execution ends.

Usage of App

This macro is designed to run automatically from a schedule. It does not require selected order IDs because it searches processed orders directly.

Processed Orders Search

The macro searches processed orders from the current UTC day using the processed date field.

SHOPIFY_POS Extended Property

Only orders containing an extended property named SHOPIFY_POS are processed for stock adjustment.

Fulfilment Location

The macro uses the processed order fulfilment location name to find the matching Linnworks stock location.

Stock Level Update

Stock is reduced by the order item quantity using UpdateStockLevelsBySKU.

Composite Sub-Items

If an item contains composite sub-items, the macro updates stock for each composite component instead of the parent item.

Duplicate Check

The macro checks stock item change history for a matching note before applying the stock update.

Execution Logging

The macro records processed orders, fulfilment locations, skipped SKUs, duplicate checks, stock updates, and errors using the macro logger.

Key Points to Remember

  • The macro does not use OrderIds

  • The macro is designed to run through a schedule

  • The macro searches processed orders from the start of the current UTC day

  • The processed order search uses:

    DateField = processed

  • The macro searches from:

    Today 00:00 UTC

  • The macro searches to:

    Current UTC time

  • The macro checks up to 500 processed orders per run

  • The macro processes only orders that contain the SHOPIFY_POS extended property

  • Service items are skipped

  • Items with blank SKUs are skipped

  • Composite items are handled by processing their composite sub-items

  • Stock is updated at the fulfilment location linked to the processed order

  • Stock is reduced using a negative quantity value

  • The stock movement note format is:

    Order {OrderNumber} ref: {ReferenceNumber}

  • If the same note already exists in stock item history, the macro skips the update

  • Errors are logged using the macro logger

Once the macro is running, it helps keep stock levels aligned for Shopify POS orders that have been processed in Linnworks.

What You Can Expect

  • Processed Shopify POS orders are checked automatically
    The macro searches today’s processed orders and checks for the SHOPIFY_POS extended property.

  • Stock is reduced at the fulfilment location
    Eligible items are reduced from the location used to fulfil the processed order.

  • Composite item components are updated
    If an order item has composite sub-items, each component is processed for stock reduction.

  • Duplicate stock reductions are avoided
    The macro checks stock item history before applying an update for the same order reference.

  • Service and blank SKU items are skipped
    Only valid stock items with SKUs are processed.

  • Execution is logged
    The macro logs processed order information, location details, duplicate checks, stock updates, and errors.

Overall Impact

This macro improves stock accuracy for Shopify POS processed orders by reducing manual updates and linking stock movements back to the processed order reference.

What To Do After the Macro Runs

After the scheduled macro has completed, review processed Shopify POS orders and stock item history if needed to confirm that stock updates were applied correctly.

Steps to Follow

Step 1

Open Linnworks and locate a Shopify POS order processed during the current day.

Step 2

Confirm that the order contains the SHOPIFY_POS extended property.

Step 3

Review the order fulfilment location.

Step 4

Open the relevant stock item history for the order item SKU at the fulfilment location.

Step 5

Confirm that a stock movement exists with a note similar to Order **** ref:.

Step 6

Continue with normal stock review, reporting, or reconciliation.

Why This Matters

Automatically reducing stock for Shopify POS orders helps:

  • Reduce manual stock corrections

  • Improve inventory accuracy

  • Keep POS stock movements visible

  • Avoid duplicate stock reductions

  • Support fulfilment location-level stock tracking

  • Improve reconciliation between processed orders and stock history

Best Practices

To get the most value from this macro, schedule it based on how often Shopify POS orders are processed.

  • Run the macro regularly
    Schedule the macro to run often enough to keep POS stock updates current.

  • Confirm Shopify POS tagging
    Make sure Shopify POS orders contain the SHOPIFY_POS extended property.

  • Review fulfilment locations
    Confirm that processed order fulfilment location names match active Linnworks stock locations.

  • Check sample stock history
    After setup, review sample SKUs to confirm stock history notes are created correctly.

  • Monitor the 500-order limit
    The macro checks up to 500 processed orders per run. If daily volume is higher, review whether the schedule or macro logic needs adjustment.

  • Review composite item behaviour
    Confirm that composite components are being reduced as expected for your inventory setup.

  • Check macro timing
    The macro searches from the beginning of the current UTC day, so schedule timing should match the business process for Shopify POS orders.

Troubleshooting

Stock was not reduced

Confirm that the order was processed today and contains the SHOPIFY_POS extended property.

Order was not included

Confirm that the order processed date falls between the start of the current UTC day and the time the macro ran.

Wrong location was used

Confirm that the processed order fulfilment location name matches the correct Linnworks stock location.

Duplicate stock update did not happen

This is expected if stock item history already contains the order reference note.

Service item was skipped

Service items are intentionally skipped and are not processed for stock reduction.

Blank SKU was skipped

The macro skips items where the SKU is blank.

Composite item stock looks different

If the item has composite sub-items, the macro updates stock for the component items instead of the parent item.

Location error appears in logs

Confirm that the fulfilment location name on the processed order matches a Linnworks stock location. If no matching location is found, the stock update cannot be completed correctly.

Macro did not run

Confirm that the macro configuration is enabled and that the schedule has been saved correctly.

Example Scenario

If a processed order has:

  • Extended Property: SHOPIFY_POS

  • Order Number: 100245

  • Reference Number: SPOS-7890

  • Fulfilment Location: Main Warehouse

  • SKU: CHAIR-BLACK

  • Quantity: 2

Stock History Check

The macro checks stock history for a note matching Order 100245 ref: SPOS-7890.

Stock Deduction

If no matching stock history note exists, the macro updates stock for CHAIR-BLACK at Main Warehouse by -2.

Saved Stock Update Note

The stock update is saved with the note Order 100245 ref: SPOS-7890.

Summary

The Shopify POS Location Stock Deduction macro searches today’s processed orders, identifies orders with the SHOPIFY_POS extended property, and reduces stock for eligible SKUs at the fulfilment location.

It supports composite sub-items, skips service and blank SKU items, checks stock history to avoid duplicate adjustments, and logs each update for traceability.

This helps teams keep Shopify POS stock movements accurate, reduce manual stock corrections, and improve inventory reconciliation in Linnworks.