Table of Contents
Order Allocation
Updated by Colin
Orders are automatically allocated to available inventory immediately upon being submitted. When you have inventory in multiple warehouses, ShipStream provides a very flexible system for automatically allocating each order to the optimal warehouse according to your preferences. These options for controlling the allocation exist both in the configuration which can be set at the Global and Merchant scope, and also on an individual order basis using the Order Priority and Allocation Options fields described below.
The order allocation process occurs automatically as long as the order is Ready to Ship, and will take into account the real-time multi-warehouse inventory availability, Packing Solutions and Rate Shopping as appropriate.
The order allocation process is also affected by the following factors:
- The Order Priority value of all orders in the system
- The relative submission timestamps of all orders in the system (first come, first serve)
- The Allowed Warehouses configuration of each merchant
- The
allowed_stock_ids
value of the order's Allocation Options if specified - The Order Allocation Algorithm configuration of each merchant
- The Dynamic Allocation option configuration of each merchant
All of these are described in greater detail below.
Order Priority
Orders are allocated to available inventory in real-time based on the Order Priority and the submission date and time (first-come, first-serve). Manipulating the Order Priority of individual orders allows you to override the chronological sorting to cause it to be higher priority (lower numbers) or lower priority (higher numbers). You may assign any number in the range of 0 (first to allocate) to 100 (last to allocate). The default priority is 50.
Stated differently, all orders which have the same Order Priority will be allocated based on the submission date and time, but orders with different Order Priority will come before (lower numbers) or after (higher numbers) accordingly. Here are some examples:
- Orders submitted at a later date but given a higher priority (e.g. 25) would be allocated before older orders with the default priority (50).
- Orders with a lower priority (e.g. 75) will be allocated only after all other orders with higher priority (any number lower than 75).
The Order Priority can be set by both Admin Users and Client Users and can be set on the Order page or using a mass action on the Orders grid.
Allowed Warehouses
In the System > Configuration > General > Warehouses > General configuration section there are three fields which can be configured at the Merchant scope (see Configuration Scopes) to control how merchants can view and use your warehouses.
The Allowed Warehouses configuration will determine which warehouses a merchant can see and use. This will affect all aspects of the system as you may expect. The disallowed warehouses will be hidden from the UI, API requests referencing the disallowed warehouse will be rejected.
The Allowed for Fulfillment option may be configured independently by choosing a subset of the Allowed Warehouses to determine which warehouses an order may be assigned and allocated to. This can be useful when you want to bring up a new warehouse or take down an old warehouse in stages. For example, by not allowing "Reno, NV" for fulfillment one could create an ASN at the new warehouse and start receiving inventory, but block orders from being allocated there until it is ready to start fulfilling orders.
Order Allocation Algorithm
You can choose a Primary and Secondary Allocation Algorithm in the System > Configuration > General > Warehouses > Order Allocation configuration section.
In the case where the Primary option fails, the Secondary will be attempted. If the Secondary fails too, the Default Warehouse option will be used.
The order allocation algorithms currently offered by ShipStream are as follows. The codes provided may be used when overriding the allocation options at the order level.
Shortest Distance
This utilizes a large database of cities, towns and postcodes to determine the "rough" geographic location of your warehouses and the destination address and prioritizes the warehouses according to which is closest. This does not use rooftop or street-level accuracy as that precision is simply not needed to arrive at an optimal result.
Code: geographic-distance
Cheapest Total Cost
This uses your rating data to estimate shipping costs based on the order's contents and rate shopping results and chooses the cheapest warehouse to ship from accordingly.
Code: cheapest
Fastest Transit Time
This uses the Days In Transit tables from the rating data to estimate delivery dates based on the order's shipping method and chooses the fastest warehouse to ship from.
Code: fastest
Least Packages
This chooses the warehouse allocation that would result in the least amount of packages being sent. If there is a tie for first then it will fall back to the next algorithm.
Code: leastpackages
Default Warehouse
This will simply allocate as much to the Default Warehouse as possible and then the remaining items to the other warehouses in the order that the warehouses were created.
Code: default
allowed_stock_ids
property as described below. This can be useful if all you want is a strict prioritization based on your arbitrary sort order.Specific Locked
With this algorithm, all order items will be locked to a specific warehouse regardless of availability or any other criteria. This algorithm may only be specified for individual orders (see the Individual Order Override section below) and requires that only one warehouse is specified.
Code: specific-locked
Single Warehouse Option
This configuration has three options:
- Optional - Orders may be split among multiple warehouses if it is deemed appropriate based on the Allocation Algorithm goals.
- Preferred - Orders will be allocated to a single warehouse unless there is none that are eligible and have all items in stock. Otherwise, splitting will be allowed as a last-resort.
- Required - Orders must be allocated with all items to a single eligible warehouse, or else become backordered until all inventory is available in a single eligible warehouse.
Static vs Dynamic Allocation
When using "Shortest Distance", "Cheapest Total Cost" or "Fastest Transit Time" allocation algorithms, ShipStream performs real-time Dynamic Allocation for merchants that have inventory in multiple warehouses. This takes into account which warehouses have inventory in stock to get the order completed as soon as possible using available inventory. However, if you'd rather your orders be allocated to the optimal warehouse ignoring real-time inventory, you can disable Dynamic Allocation. The order would then remain backordered until it is in-stock at the optimal warehouse. This is also referred to as Static Allocation since the allocation does not change as inventory changes — it will remain static regardless of available inventory.
By System > Configuration
This configuration is located at System > Configuration > Catalog > Inventory > Product Inventory Options.
By Product
You can also override the configured default at the Product level so that specific products can be treated differently from the default:
By Order
And of course at the Order level as well, using the UI, scripts, or the API:
dynamic_allocation
via the Other Allocation Options order property overrides both the Product-level data for all products on the order and the configuration.Examples
To better understand how the options interact with one another, consider the following scenario and examples:
- Primary Allocation Algorithm: Shortest Distance
- Warehouse A distance: 50mi (closest)
- Warehouse B distance: 500mi (farthest)
- SKU X: Available in A and B
- SKU Y: Available in B only
- SKU Z: Available in B only
- Order placed for 1 unit of X, Y and Z
Configuration | Product Dynamic Allocation (either by default or per-product) | Allocation Result | Order Status |
Single Warehouse Option: Optional | X: Yes Y: Yes Z: Yes | (X➝A) (Y,Z➝B) | New Ready to Ship: Yes |
Single Warehouse Option: Preferred or Required | X: Yes Y: Yes Z: Yes | (X,Y,Z➝B) | New Ready to Ship: Yes |
Single Warehouse Option: Irrelevant | X: No Y: No Z: No | (X,Y,Z➝A) | Partially Backordered Ready To Ship: depends on Backorder Policy |
Single Warehouse Option: Optional | X: Yes Y: No Z: Yes | (X,Y➝A) (Z➝B) | Partially Backordered Ready To Ship: depends on Backorder Policy |
Single Warehouse Option: Preferred or Required | X: Yes Y: No Z: Yes | (X,Y,Z➝B) | New Ready to Ship: Yes |
Individual Order Override
The configuration determines the default behavior used for all orders, but in some cases, you may wish to override the default behavior for individual orders. An order field called allocation_options
is available for this purpose. It is plain text using valid JSON format and may be set via the UI, the API, or via a Before Create Order (BCO) Script.
The format of the JSON object may contain three keys:
algorithms
- An array of the allocation algorithms that may be used for this order.allowed_stock_ids
- An array of warehouse ids that may be used for this order.single_warehouse
- A string indicating when the order may or may not be split among multiple warehouses. (optional, preferred, required
)dynamic_allocation
- A boolean indicating if dynamic allocation is overridden for this order (true
- use dynamic allocation,false
- use static allocation).
For example, to lock an order to a specific warehouse one could choose the specific-locked
algorithm and specify the id of the warehouse you want to use:
{
"algorithms": ["specific-locked"],
"allowed_stock_ids": [2]
}
The codes for the allocation algorithms are as follows:
- Shortest Distance -
geographic-distance
- Cheapest Total Cost -
cheapest
- Fastest Transit Time -
fastest
- Least Packages -
leastpackages
- Default Warehouse -
default
- Specific Locked -
specific-locked
The warehouse IDs can be obtained through the System > Enumerations page, the API using the warehouse.list
API method or from the System > Warehouses page.