Packaging Selection by Location
Automatically select the correct packaging group for selected Linnworks orders based on fulfilment location and recalculate order packaging details.
Selecting packaging manually can be time-consuming, especially when orders are fulfilled from multiple locations that require different packaging groups. The Packaging Selection by Location macro helps automate this process by checking each selected order’s fulfilment location and applying the matching packaging category.
This macro reviews each selected order, identifies the order fulfilment location, matches that location to a defined packaging group, recalculates packaging dimensions and weight, and updates the order packaging calculation in Linnworks.
With this automated approach, your team can reduce manual packaging checks, improve shipping preparation, and keep packaging selection consistent across different fulfilment locations.
Keep packaging selection accurate by automatically applying the correct packaging group based on each order’s fulfilment location.
Configure the Macro
Once the app is installed, you need to create a macro configuration so the system knows which macro to run when the rule is triggered.
This setup can be adjusted anytime based on your operational requirements.
Steps to Configure
Go to Apps > Macro Configuration and click + Add new configuration.

Select the PackagingSelectionByLocationRulesEngine macro and click Create Configuration

This creates a new configuration where the selected order IDs are passed to the macro when it runs from the rule.
In the Macro Configuration screen, add the configuration name.

Example configuration name:
Packaging Selection by Location
This macro does not require additional user-entered parameter values. The OrderIds value is provided automatically by the selected orders or rule context.
Make sure to enable the macro to continue with the Rule Engine configuration.\

Note: If the macro is not enabled, it will not appear in the Action value list when setting up the rule.
Go to Orders > Rules engine and click + Add new rule.

Key Benefits
Enter the rule name and click Create.

Click Add new, select Condition, set the condition as required, and save it.


Add the macro action and click Save.


In the Add action window, enter the Action name, for example:
PackagingSelectionByLocation
-
Set Action type to:
Execute a macro -
In Action value, select:
PackagingSelectionByLocation -
Click Save
Note: If the macro is not enabled, it will not appear in the Action value list when setting up the rule.
Review the saved rule setup.

-
Verify the condition and action are connected correctly
-
Click Save in the bottom-right corner to save the rule
Incorrect packaging selection can affect shipping calculations, label generation, and fulfilment accuracy. This macro helps reduce those issues by automatically applying a packaging group based on the fulfilment location of each selected order.
Reduce Manual Packaging Checks
Eliminates the need to manually review each selected order and choose the packaging group based on fulfilment location.
Improve Shipping Preparation
Helps ensure orders have packaging details recalculated before shipping labels or dispatch workflows continue.
Apply Location-Based Rules
Matches each order fulfilment location to a defined packaging category.
Maintain Packaging Accuracy
Recalculates packaging dimensions and weight using Linnworks packaging calculation tools.
Save Operational Time
Allows teams to update packaging for multiple selected orders in one macro run instead of updating each order manually.
Update Only Matching Locations
The macro recalculates packaging only when the order location matches a configured location rule.
How It Works
The macro checks each selected order, identifies its fulfilment location, selects the matching packaging group, recalculates the packaging, and saves the updated packaging calculation.
Step 1
The macro starts execution and writes Macro started to the log.
Step 2
It retrieves the available packaging groups from Linnworks.
Step 3
It retrieves the available stock locations from Linnworks.
Step 4
The macro loops through each order ID provided in the OrderIds parameter.
Step 5
For each selected order, the macro retrieves the order details and identifies the fulfilment location.
Step 6
It compares the fulfilment location against the defined location rules and selects the matching packaging category.
Step 7
If a matching packaging group is found, the macro retrieves the first available packaging type from that packaging group.
Step 8
The macro recalculates the order packaging dimensions and weight using Linnworks packaging calculation.
Step 9
It sends the recalculated packaging request back to Linnworks using the selected packaging group and packaging type.
Step 10
The macro logs the selected package category, packaging dimensions, packaging weight, and completion status.
Usage of App
This macro is designed to update selected orders automatically once it is configured and triggered from the Rule Engine. It is useful when orders are fulfilled from multiple locations and each location requires a specific packaging group.
OrderIds
Defines the Linnworks order IDs that should be processed. Only these selected orders are checked and updated.
Fulfilment Location Check
The macro checks the fulfilment location assigned to each selected order.
Packaging Group Match
The macro matches the fulfilment location to a defined packaging category, such as UK, Germany, USA, Sailfish, Canada, or Australia.
Packaging Type Selection
The macro uses the first packaging type from the matched packaging group.
Packaging Recalculation
The macro recalculates total depth, height, width, and weight for the order packaging.
Order Packaging Update
The macro applies the recalculated packaging data back to the order using the selected packaging group and type.
Execution Logging
The macro records the order number, location name, selected package category, packaging dimensions, weight, errors, and completion status.
Key Points to Remember
-
The macro processes only the order IDs provided in OrderIds
-
The macro uses each order’s FulfilmentLocationId to identify the location
-
The location must match one of the defined location rules in the macro
-
The packaging group must exist in Linnworks with the expected package category name
-
The macro uses the first packaging type in the matched packaging group
-
The macro recalculates packaging dimensions and weight before applying the packaging update
-
Orders with no matching location rule are not updated
-
Orders with no matching packaging group are not recalculated
-
The macro logs the selected package category and packaging calculation values
Once the macro is running, it helps keep packaging selection aligned with the fulfilment location used for each selected order.
What You Can Expect
-
Selected orders are checked automatically
The macro reviews each order passed into the OrderIds parameter -
Fulfilment locations are identified
The macro checks the location assigned to each order -
Packaging groups are selected
A matching packaging category is selected based on the order fulfilment location -
Packaging is recalculated
Order packaging depth, height, width, and weight are recalculated -
Orders are updated when rules match
Orders with a matching location and packaging group receive recalculated packaging details -
Execution is logged
The macro records order processing, location matching, packaging category selection, packaging dimensions, and errors
Overall Impact
This macro improves packaging consistency, reduces manual packaging selection, and helps keep shipping preparation aligned with fulfilment location rules.
What To Do After the Macro Runs
After the macro has completed, review the selected orders if needed to confirm that the expected packaging group and recalculated packaging details were applied.
Steps to Follow
Step 1
Open Linnworks and locate the orders included in the OrderIds parameter.
Step 2
Review the fulfilment location assigned to each order.
Step 3
Confirm that the fulfilment location matches one of the defined location rules.
Step 4
Review the packaging group and packaging type applied to the order.
Step 5
Confirm that packaging dimensions and weight were recalculated as expected.
Step 6
Continue with normal shipping label generation, packing, or dispatch processing.
Why This Matters
Keeping packaging selection accurate helps:
-
Reduce manual packaging updates
-
Improve shipping calculation accuracy
-
Support correct label generation
-
Keep packaging rules consistent across fulfilment locations
-
Reduce fulfilment errors caused by incorrect packaging groups
Best Practices
To get the most value from this macro, make sure the required packaging groups and location names are configured consistently in Linnworks before running it.
Recommended Guidelines
-
Confirm location names are correct
Make sure fulfilment location names match the location rules used by the macro -
Set up packaging groups first
Confirm that the required packaging categories exist in Linnworks before running the macro -
Review packaging types
The macro uses the first packaging type from the matched packaging group, so make sure the first type is the correct default -
Run before label generation
Use the macro before generating shipping labels so packaging details are updated first -
Test with sample orders
Run the macro on a small controlled set of orders before using it at scale -
Check logs after execution
Review macro logs to confirm selected package categories, dimensions, weight, and any errors
Correct fulfilment location and packaging group setup helps ensure the macro applies the expected packaging details.
Example Scenario
To better understand how this works, here’s a simple example:
Configured packaging groups:
-
UK
-
Germany
-
USA
-
Canada
-
Australia
Selected orders:
-
Order A is assigned to a UK fulfilment location → The macro selects the UK packaging group and recalculates packaging
-
Order B is assigned to a Germany fulfilment location → The macro selects the Germany packaging group and recalculates packaging
-
Order C is assigned to a USA fulfilment location → The macro selects the USA packaging group and recalculates packaging
-
Order D is assigned to a location that has no matching rule → No packaging update is applied
-
Order E has a matching location, but the matching packaging group does not exist → No packaging recalculation is applied
What This Means
-
Packaging selection depends on the order fulfilment location
-
The matching packaging group must exist in Linnworks
-
The first packaging type in the matched packaging group is used
-
Orders without a matching location or packaging group are not updated
Final Summary
The Packaging Selection by Location macro helps selected Linnworks orders receive the correct packaging setup based on their fulfilment location.
By matching locations to packaging groups, recalculating packaging dimensions and weight, and applying the updated packaging calculation to the order, this macro supports more accurate shipping preparation and reduces manual packaging maintenance.