findDeliveryOptionsForConsignmentWithBookingCode

This allocation method tells you what the cheapest costs and associated delivery options for an existing consignment would be if a particular booking code was used.

Note

This method assumes that the consignment already exists in Delivery Manager.

No consignments are actually allocated using this method.

Important

In order to use this method, you need to be an API user with Delivery Options permissions. Please contact Support for more information.

How to submit a request

Proceed as follows:

  1. If you have not already done so, open a new project using the WSDL AllocationService.xml.

  2. Create a new request under findDeliveryOptionsForConsignmentWithBookingCode.

  3. Enter the authorisation for the request.

  4. Specify the code(s) of the existing consignment(s).

  5. Specify the required bookingCode.

  6. Set calculateTaxAndDuty to false.

  7. Click Arrow.png to submit the request.

You know that the call has been successful once delivery options are returned.

The response returns all the carrier services that can deliver the package to the recipientAddress, using the criteria in the bookingCode.

The returned services are sorted in order of cost, with the cheapest first (refer to Setting up the Carrier Costs).

Note

If there is more than one service available for allocation, and the costs are identical, then, normally, the one that leaves the warehouse first will be selected. However, if you append /LATEST at the end of the booking code, then this forces Delivery Manager to prioritise the service with the latest despatch time, allowing you to plan the packaging of the consignment in the warehouse.

For each carrier service that can make the scheduled delivery, the call returns the collectionSlots and collectionWindow, together with cutOffDateTime, and then the associated deliverySlots and deliveryWindow.

Example Request

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="urn:DeliveryManager/services">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:findDeliveryOptionsForConsignmentWithBookingCode soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <consignmentCode xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">DMC4BY1V3PWY</consignmentCode>
         <bookingCode xsi:type="soapenc:string">@NEXT/2020-07-21/00:01-23:59</bookingCode>
         <calculateTaxAndDuty xsi:type="xsd:boolean">false</calculateTaxAndDuty>
      </ser:findDeliveryOptionsForConsignmentWithBookingCode>
   </soapenv:Body>
</soapenv:Envelope>

In the above example, the API call is looking for services in the NEXT carrier 'service group' that can despatch on 21st July 2020. For an example response, see below.

Example Response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <ns1:findDeliveryOptionsForConsignmentWithBookingCodeResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:DeliveryManager/services">
         <findDeliveryOptionsForConsignmentWithBookingCodeReturn soapenc:arrayType="ns2:DeliveryOption[2]" xsi:type="soapenc:Array" xmlns:ns2="urn:DeliveryManager/types" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
            <findDeliveryOptionsForConsignmentWithBookingCodeReturn xsi:type="ns2:DeliveryOption">
               <bookingCode xsi:type="soapenc:string">DPD07NEXTDAY/2020-07-21/*-*/*/*-*</bookingCode>
               <carrierCode xsi:type="soapenc:string">DPD07</carrierCode>
               <carrierCustom1 xsi:type="soapenc:string" xsi:nil="true"/>
               <carrierCustom2 xsi:type="soapenc:string" xsi:nil="true"/>
               <carrierCustom3 xsi:type="soapenc:string" xsi:nil="true"/>
               <carrierServiceCode xsi:type="soapenc:string">DPD07NEXTDAY</carrierServiceCode>
               <carrierServiceTypeCode xsi:type="soapenc:string">UNTIMED</carrierServiceTypeCode>
               <collectionSlots soapenc:arrayType="ns2:DateRange[1]" xsi:type="soapenc:Array">
                  <collectionSlots xsi:type="ns2:DateRange">
                     <from xsi:type="xsd:dateTime">2020-07-21T17:30:00.000Z</from>
                     <to xsi:type="xsd:dateTime">2020-07-21T18:30:59.999Z</to>
                  </collectionSlots>
               </collectionSlots>
               <collectionWindow xsi:type="ns2:DateRange">
                  <from xsi:type="xsd:dateTime">2020-07-21T17:30:00.000Z</from>
                  <to xsi:type="xsd:dateTime">2020-07-21T18:30:59.999Z</to>
               </collectionWindow>
               <cutOffDateTime xsi:type="xsd:dateTime">2020-07-19T17:30:00.000Z</cutOffDateTime>
               <deliveryLocation xsi:type="soapenc:string" xsi:nil="true"/>
               <deliverySlots soapenc:arrayType="ns2:DateRange[1]" xsi:type="soapenc:Array">
                  <deliverySlots xsi:type="ns2:DateRange">
                     <from xsi:type="xsd:dateTime">2020-07-22T07:00:00.000Z</from>
                     <to xsi:type="xsd:dateTime">2020-07-22T17:00:59.999Z</to>
                  </deliverySlots>
               </deliverySlots>
               <deliveryWindow xsi:type="ns2:DateRange">
                  <from xsi:type="xsd:dateTime">2020-07-22T07:00:00.000Z</from>
                  <to xsi:type="xsd:dateTime">2020-07-22T17:00:59.999Z</to>
               </deliveryWindow>
               <groupCodes soapenc:arrayType="soapenc:string[1]" xsi:type="soapenc:Array">
                  <groupCodes xsi:type="soapenc:string">NEXT</groupCodes>
               </groupCodes>
               <name xsi:type="soapenc:string">DPD Next day</name>
               <nominatableCollectionSlot xsi:type="xsd:boolean">false</nominatableCollectionSlot>
               <nominatableDeliverySlot xsi:type="xsd:boolean">false</nominatableDeliverySlot>
               <recipientTimeZone xsi:type="soapenc:string">Europe/London</recipientTimeZone>
               <score xsi:type="xsd:double">1.0</score>
               <senderTimeZone xsi:type="soapenc:string">Europe/London</senderTimeZone>
               <shippingCharge xsi:type="xsd:double">0.0</shippingCharge>
               <shippingCost xsi:type="xsd:double">0.9</shippingCost>
               <taxAndDuty xsi:type="xsd:double">0.0</taxAndDuty>
               <taxAndDutyStatusText xsi:type="soapenc:string" xsi:nil="true"/>
               <vatRate xsi:type="xsd:double">0.0</vatRate>
            </findDeliveryOptionsForConsignmentWithBookingCodeReturn>
            <findDeliveryOptionsForConsignmentWithBookingCodeReturn xsi:type="ns2:DeliveryOption">
               <bookingCode xsi:type="soapenc:string">HERMNDG/2020-07-21/*-*/*/*-*</bookingCode>
               <carrierCode xsi:type="soapenc:string">HERMESPOS</carrierCode>
               <carrierCustom1 xsi:type="soapenc:string" xsi:nil="true"/>
               <carrierCustom2 xsi:type="soapenc:string" xsi:nil="true"/>
               <carrierCustom3 xsi:type="soapenc:string" xsi:nil="true"/>
               <carrierServiceCode xsi:type="soapenc:string">HERMNDG</carrierServiceCode>
               <carrierServiceTypeCode xsi:type="soapenc:string">UNTIMED</carrierServiceTypeCode>
               <collectionSlots soapenc:arrayType="ns2:DateRange[1]" xsi:type="soapenc:Array">
                  <collectionSlots xsi:type="ns2:DateRange">
                     <from xsi:type="xsd:dateTime">2020-07-21T17:30:00.000Z</from>
                     <to xsi:type="xsd:dateTime">2020-07-21T18:30:59.999Z</to>
                  </collectionSlots>
               </collectionSlots>
               <collectionWindow xsi:type="ns2:DateRange">
                  <from xsi:type="xsd:dateTime">2020-07-21T17:30:00.000Z</from>
                  <to xsi:type="xsd:dateTime">2020-07-21T18:30:59.999Z</to>
               </collectionWindow>
               <cutOffDateTime xsi:type="xsd:dateTime">2020-07-21T17:00:00.000Z</cutOffDateTime>
               <deliveryLocation xsi:type="soapenc:string" xsi:nil="true"/>
               <deliverySlots soapenc:arrayType="ns2:DateRange[1]" xsi:type="soapenc:Array">
                  <deliverySlots xsi:type="ns2:DateRange">
                     <from xsi:type="xsd:dateTime">2020-07-22T07:00:00.000Z</from>
                     <to xsi:type="xsd:dateTime">2020-07-22T19:00:59.999Z</to>
                  </deliverySlots>
               </deliverySlots>
               <deliveryWindow xsi:type="ns2:DateRange">
                  <from xsi:type="xsd:dateTime">2020-07-22T07:00:00.000Z</from>
                  <to xsi:type="xsd:dateTime">2020-07-22T19:00:59.999Z</to>
               </deliveryWindow>
               <groupCodes soapenc:arrayType="soapenc:string[2]" xsi:type="soapenc:Array">
                  <groupCodes xsi:type="soapenc:string">PLNEXTDAY</groupCodes>
                  <groupCodes xsi:type="soapenc:string">NEXT</groupCodes>
               </groupCodes>
               <name xsi:type="soapenc:string">Courier Service Next Day</name>
               <nominatableCollectionSlot xsi:type="xsd:boolean">false</nominatableCollectionSlot>
               <nominatableDeliverySlot xsi:type="xsd:boolean">false</nominatableDeliverySlot>
               <recipientTimeZone xsi:type="soapenc:string">Europe/London</recipientTimeZone>
               <score xsi:type="xsd:double">1.0</score>
               <senderTimeZone xsi:type="soapenc:string">Europe/London</senderTimeZone>
               <shippingCharge xsi:type="xsd:double">7.0</shippingCharge>
               <shippingCost xsi:type="xsd:double">2.2</shippingCost>
               <taxAndDuty xsi:type="xsd:double">0.0</taxAndDuty>
               <taxAndDutyStatusText xsi:type="soapenc:string" xsi:nil="true"/>
               <vatRate xsi:type="xsd:double">0.0</vatRate>
            </findDeliveryOptionsForConsignmentWithBookingCodeReturn>
         </findDeliveryOptionsForConsignmentWithBookingCodeReturn>
      </ns1:findDeliveryOptionsForConsignmentWithBookingCodeResponse>
   </soapenv:Body>
</soapenv:Envelope>

Next Steps

Once you have used the returned delivery options to determine the carrier service to which you want to allocate the consignment, go to allocateConsignmentsWithBookingCode.

When entering the booking code to allocate the consignment, you can now simply copy the booking code for the preferred delivery option from the response to findDeliveryOptionsForConsignmentWithBookingCode, e.g.

<bookingCode xsi:type="soapenc:string">DPD07NEXTDAY/2020-07-21/*-*/*/*-*</bookingCode>