Selecting Options
This page explains how to to generate consignments and orders by selecting a delivery option.
Selecting Options As a Consignment
The Select Option endpoint enables you to record a customer's choice of delivery or pickup option in SortedPRO. PRO generates and allocates a consignment from the details of the selected option.
To call Select Option, send a POST
request to https://api.electioapp.com/deliveryoptions/select/{deliveryOptionReference}
. There is no body content required for the request.
Once it has received the request, PRO creates a consignment using the consignment that details were passed as part of the original request to get delivery options. Next, the system allocates the consignment in line with the delivery promise specified in the selected option. Generally, this means allocating to the carrier service returned in the original option, but PRO can allocate to an alternative service in certain circumstances. The delivery option guarantees the delivery promise, but not the carrier service.
PRO then returns links to the consignment resource that was allocated, a summary of the carrier service that the consignment was allocated to, a link to the relevant package labels, and a ConsignmentLegs
array indicating how many legs the shipment will need. Where a shipment would need multiple legs to complete, the ConsignmentLegs
array shows tracking details for each individual leg.
Note
- For full reference information on the Select Option endpoint, see the Select Option page of the API reference.
- For an example call flow in which consignments are created using Select Order, see the Consumer Options call flow page.
Select Option Example
The example shows a request to select a delivery option that has a {deliveryOptionReference}
of EDO-000-6DX-6XP. PRO creates a consignment with a {consignmentReference}
of EC-000-05B-MMQ, which it then allocates to the carrier service associated with delivery option EDO-000-6DX-6XP. PRO then returns the relevant {consignmentReference}
and label link, enabling you to get labels for and manifest the consignment.
POST https://api.electioapp.com/deliveryoptions/select/EDO-000-6DX-6XP
Selecting Options As an Order
The Select Option As Order endpoint enables you to record a customer's choice of delivery or pickup option as an order rather than a consignment. You can then pack the resulting order into multiple consignments as per the PRO order process. Select Option As Order enables you to select multiple delivery and/or pickup options at once.
Using Select Option As Order combines the benefits of PRO's delivery options and orders features, enabling you to offer your customers delivery options even if their orders need to be shipped in multiple consignments.
Note
For more information on using orders in PRO, see the Managing Orders section.
To call Select Option As Order, send a POST
request to https://api.electioapp.com/deliveryoptions/selectorder
. The body of the request should contain a DeliveryOptions
array listing the delivery options you want to select as orders. Each DeliveryOption
must contain a delivery option Reference
, which is used to identify the order you want to select. If require, you can also add an OrderReferenceProvidedByCustomer
and metadata to be added to the resulting order.
Once it has received the Select Delivery Option as an Order request, PRO uses the details of the selected option to create an order and returns an object containing the associated {orderReferences}
.
Note
- For full reference information on the Select Delivery Option as an Order endpoint, see the Select Delivery Option as an Order page of the API reference.
Select Option As Order Example
The example shows a request to select a delivery option that has a {Reference}
of EDO-000-6DX-6XP as an order. PRO takes that delivery option's details and creates an order with an {orderReference}
of EO-000-002-0TT.
{
"DeliveryOptions": [
{
"Reference": "EDO-000-6DX-6XP",
"OrderReferenceProvidedByCustomer": "MYORDEREF001",
"MetaData": [
{
"KeyValue": "OrderReference",
"StringValue": "10045634343"
}
]
}
]
}
Next Steps
- Learn how to manifest consignments at the Manifesting Consignments page.
- Learn how to pack orders into consignments at the Creating Consignments From Orders page.
- Learn how to retrieve customs docs and invoices at the Getting Customs Docs and Invoices page.