Routing, Rank By Average Distance
Calculates the average distance from sets of inventory locations to
an order recipient, and ranks them. Use this method to compare the average shipping distances
for different sets of locations that can fulfill an order. While this method is executing, you
can’t invoke another Apex callout.
- Resource
-
1/commerce/order-management/routing/actions/rank-byaverage-distance - Available version
- 51.0
- HTTP methods
- POST
- Request body for POST
-
Rank Average Distance Input
- Root XML tag
- <rankAverageDistanceInput>
- Properties
-
Name Type Description Required or Optional Available Version deliveryCountryCode String The country code of the order recipient. Required 51.0 deliveryPostalCode String The postal code of the order recipient. Required 51.0 distanceUnit String Specify mi or km to return average distances in miles or kilometers, respectively. 51.0 sortResult String Specify ASC or DESC to rank the results by average shipping distance in ascending or descending order, respectively. 51.0 targetLocations Target Location Input[] Each element is a set of inventory locations that can combine to fulfill the order. At least one element is required 51.0
- Response body for POST
-
- When the HTTP status code indicates success, the response body is a Rank Average Distance Output. The response body can still indicate processing errors.
- When the HTTP status code is in the 400 (client error) or 500 (server error) range, the response body is an Error with Output. The output property is a Rank Average Distance Output, and the value of the enhancedErrorType property can be ignored.