Schedule MacroRIS-SM-2185 – Merge Orders Macro

Merge Orders Macro

Identifies similar open orders, validates them, and merges eligible ones into a single consolidated order automatically to optimize warehouse operations.

Overview

The RIS-SM-2185 – Merge Orders Macro finds similar open orders based on customer and address, validates them according to business rules, and merges eligible orders into a single consolidated order.

Automates merging of duplicate or similar orders to reduce shipments and improve warehouse efficiency.

Purpose

This macro:

  • Identifies similar open orders

  • Validates orders against conditions (paid, not Amazon, not parked/locked, etc.)

  • Merges eligible orders into a single order

  • Assigns identifiers and updates label printed status

👉 In short:
Automatically combines duplicate or similar orders into one order.

When It Runs

Typically used:

  • Automatically or manually during order processing

  • After order import

  • Before picking and packing

  • During warehouse optimization

  • In automation workflows

  • To reduce multiple shipments

Parameters

path
IdentifiersNamestring
Required

Identifier used to exclude orders from merging.

Note: Orders with this identifier will not be considered for merging.

Simple Explanation

The macro identifies orders with the same customer and address, validates them, and merges all eligible orders into a single consolidated order while managing labels and identifiers.

Step-by-Step Process

Fetch Open Orders

Use Api.Orders.GetOpenOrders to retrieve all open orders.

Filter Eligible Orders

Exclude unpaid orders, Amazon orders, parked/locked orders, orders with invoice printed, and orders with the given identifier.

Group Orders

Group by customer name, address, source & subsource, postal service, and currency.

Validate Group Conditions

Skip groups if invoice printed exists, identifier exists, or multiple orders have label printed.

Handle Label Printed Case

If only one order has label printed, clear label using API.

Merge Orders

Use Api.Orders.MergeOrders to consolidate eligible orders into one.

Assign Identifier

Assign “Merged Orders” identifier to the new order; create identifier if not exists.

Update Final Status

Mark merged order as label printed.

Error Handling

Log failures per group and continue execution safely.

Final Result

The macro merges multiple similar orders into a single consolidated order, reducing shipments, improving warehouse efficiency, and maintaining proper labels and identifiers.

Usefulness

  • Reduced Shipping Cost – Single shipment instead of multiple

  • Warehouse Efficiency – Fewer picking tasks

  • Automation – No manual merging required

  • Cleaner Order Management – Avoid duplicates

  • Faster Fulfillment – Streamlined processing

Example Scenario

Key Insight

This macro optimizes order processing by intelligently merging similar orders, reducing operational costs, minimizing duplicate work, and improving fulfillment efficiency while ensuring strict validation to prevent incorrect merges.