Order Routing API - headless
Description
Order routing is one of the important modules of the ecommerce supply chain. Order Routing is a means to deliver the order to the customer as fast as possible in a cost-effective way. Effective order routing is possible with a set of business rules. These rules can be tweaked as per the retailer’s requirement. Fenix has built its own order-routing engine, helping customers route their orders across multiple fulfillment centers.
Fenix supports some important allocation rules for optimized order routing. These rules can be prioritized and chosen which rule should be applied before another. A user-friendly rules screen will help the business user to change the rules, prioritize, and add/remove them easily. Any changes made to the rules will be effected immediately.
DC Priority Rule
This rule is for those retailers who ship multiple DCs and stores and want to prioritize the DCs before the stores. The reason why the retailers prefer shipping from stores may be due to multiple factors like the following.
DCs have more inventory.
DCs have more service coverage to fulfill orders.
Inter-transfer of inventory can happen between the DCs, which makes the DCs highly available.
Sort Rule
The sort rule will prioritize the locations based on the distance of the fulfillment center to the buyer or the available quantity at the fulfillment center. This rule is a generic rule that can be added as a nested rule under, let’s say, the DC Priority rule or can be added as a main rule itself. In the former case, only the DCs will be prioritized based on the criteria, and in the latter case, the rest of the stores will be prioritized.
Split Shipments
A fast-selling SKU may get the inventory depleted in all warehouses, and such a situation may arise; the SKU’s requested quantity may not be available in one location. In such cases, enabling this rule will ensure the same SKU gets split into multiple locations for fulfillment. However, the caveat is that this may increase the number of shipments. So, the retailers can add a max split criteria restricting the number of fulfillments a SKU can be split into.
Minimize Shipments Rule
This rule, when enabled, will try to minimize the number of shipments for an order. The rule looks at the inventory position of all the SKUs in the cart and tries to pick a location that can fulfill the order as a whole.
Lowest Shipcost Rule
Fenix automatically picks the location shipping from, which makes the shipping cost the lowest. By this default rule, the retailers can trust the Fenix-suggested shipping location to route their orders.
Request & Response formats
All the request and response formats are accepted in application/JSON
Delivery Estimates Request
API | /fenixomsorderrouting/v1/order-route/get-routing-info |
Method | POST |
Request Headers  |
|
Request body sample | {
"buyerAddress": {
"address1": "210 rose ct",
"address2": "",
"city": "campbell",
"country": "US",
"poBox": false,
"residential": true,
"state": "CA",
"zipcode": "95008"
},
"productInfos": [
{
"sku": "101102",
"quantity":1,
"variantId":"82739",
"productId":"9827439"
}
],
"requestId": "test-allocation-request"
} |
Response body sample | {
"inventory": [
{
"sku_id": "101102",
"product_id": "7160945803416",
"variant_id": "41430520594584",
"levels": [
{
"loc_id": "FLEXE-1646-NV",
"quantity": 224,
"threshold": 0,
"backordered": false
}
]
}
],
"routing_info": [
{
"loc_id": "FLEXE-1646-NV",
"allocation_details": [
{
"sku_id": "101102",
"product_id": "7160945803416",
"variant_id": "41430520594584",
"line_item_id": null,
"requested_quantity": 1,
"allocated_quantity": 1
}
]
}
],
"errors": null,
"applied_rules": [
{
"rule_name": "Sort Priority",
"priority": 1
},
{
"rule_name": "Merge Shipments",
"priority": 2
}
],
"time_taken_in_milli_secs": 76
} Â |
Request Body Attribute DefinitionsÂ
Attribute | Mandatory | Description |
buyerAddress | yes | The address of the buyer |
buyerAddress.address1 Â | no | The address line 1 of the buyer |
buyerAddress.address2 Â | no | The address line 2 of the buyer |
buyerAddress.city | no | The city of the buyer |
buyerAddress.country | yes | The country of the buyer |
buyerAddress.state | no | The state of the buyer |
buyerAddress.zipcode | yes | The zipcode of the buyer |
productInfos | yes | The SKU information of the cart |
productInfos.sku | yes | The SKU id of the item in the cart |
productInfos.quantity | yes | The quantity of the item in the cart |
productInfos.productId | no | The product id of the item in the cart |
productInfos.variant | no | The variant id of the item in the cart The Variant Id is similar to the SKU (some platforms uses this field to uniquely identify a SKU) |
requestId | yes | A unique identifier to represent the current routing request |
Response Attribute Definitions
Attribute | Mandatory | Description |
inventory | yes | The inventory levels of each SKU in request |
inventory.sku_id | yes | The SKU id of the item in the cart |
inventory.product_id | no | The product id of the item in the cart |
inventory.variant_id | no | The variant id of the item in the cart |
inventory.levels | yes | The location level availability of the SKU |
inventory.levels.loc_id | yes | The location id of the available inventory. The location needs to be preconfigured in Fenix |
inventory.levels.quantity | yes | The available quantity of the SKU in the location |
inventory.levels.threshold | yes | Contains the inventory threshold, if any, of the SKU at the location |
inventory.levels.backordered | yes | Represents if the SKU is not available at the above location |
routing_info | yes | The fenix suggested routing information of the cart |
routing_info.loc_id | yes | The location id of the SKUs allocated |
routing_info.allocation_details | yes | The SKU and the quantity details allocated at the above location |
applied_rules | yes | The allocation rules that are applied for this routing request |
applied_rules.rule_name | yes | The rule name applied for this routing request |
applied_rules.priority | yes | The priority of the rule that is applied |
errors | no | Error details while performing the routing |
errors.sku_id | yes | The SKU id of the item in the cart |
errors.product_id | no | The product id of the item in the cart |
errors.variant_id | no | The variant id of the item in the cart |
errors.requested_quantity | yes | The number of items the routing failed for |
errors.error_info | yes | The error message denoting the reason for the unable to do the routing for the SKU |
Â
Â