Allocating to Default Rules
This page explains how to use the Allocate Shipment endpoint to allocate shipments based on your pre-defined allocation rules.
Allocating a Single Shipment
The Allocate Shipment endpoint allocates a single shipment to the most appropriate carrier service. To call Allocate Shipment, send a PUT
request to https://api.sorted.com/pro/shipments/{reference}/allocate
, where {reference}
indicates the shipment that you want to allocate.
Once the request has been received, Ship uses your shipping rules to determine which carrier services would be eligible to take the shipment, and your shipping modes to determine which of those services the shipment will be allocated to. The system then allocates the shipment and returns an Allocate Result object.
Note
- For more information on the wider process Ship uses to allocate see the Selecting a Carrier Service section of the Allocating Shipments page.
- For more information on configuring and using shipping rules, see the Managing Shipping Rules page of the UI user guide.
- For more information on configuring and using shipping modes, see the Managing Shipping Modes page of the UI user guide.
All Ship endpoints that allocate consignments individually return an Allocate Result object. The Allocate Result contains details of:
- The shipment's current
state
following the allocation request. For successful requests this would generally be Allocated. - The carrier and service that the shipment was allocated to.
- The
price
of the allocation. - Any relevant tracking references.
- The services that were unable to provide a quote.
- The
shipping_date
andexpected_delivery_date
for the shipment.
Allocate Shipment Example
The example shows a successful request to allocate a shipment with a {reference}
of sp_01017652898121961272041674506240 via the Allocate Shipment endpoint. Ship has selected a service and returned tracking_references
for the shipment.
PUT https://api.sorted.com/pro/shipments/sp_01017652898121961272041674506240/allocate
Next Steps
- Learn how to retrieve shipment data: Getting Shipments
- Learn how to manifest shipments: Manifesting Shipments
- Learn how to create shipment groups: Allocating Shipments