Get quotes
Send package and address data to retrieve live delivery quotes before consignment creation. Compare prices, services, and eligibility.
Overview
This guide explains how got get delivery quotes based on consignment details. The Consignments platform has two API endpoints that take the details of an as-yet uncreated consignment and return quotes for it:
- Get Quotes returns a simple list of delivery quotes for the potential consignment.
- Get Service Group Quotes returns a list of current service groups, along with quotes from the eligible services in each group.
Both the Get Quotes and Get Service Group Quotes endpoints take a consignment object in the body of the request. However, they do not create consignments in and of themselves.
In order to allocate to one of the quotes returned by these endpoints, you would need to first create the consignment. For more information on creating consignments, see the Creating Consignments page.
Get quotes request
To call Get Quotes, send a POST
request to https://api.electioapp.com/quotes/
. The body of the request should contain a consignment object.
As a minimum, the Get Quotes endpoint requires you to send package weights and dimensions, origin address, and destination address data. You can either specify package weights and dimension via the Weight
and Dimensions
properties, or by supplying a PackageSizeReference
.
There are lots of optional properties you can send when getting quotes for a consignment, including:
- Your own consignment reference.
- Details of the specific items inside the consignment’s packages.
- The consignment’s source.
- Shipping and delivery dates.
- Customs documentation.
- The consignment’s direction of travel.
- Metadata - Enables you to record additional data about a package in custom fields. For more information on using metadata in Consignments, see the metadata page.
- Tags. Allocation tags enable you to filter the list of carrier services that a particular package could be allocated to. For more information on allocation tags, see the allocation filter tags guide.
Adding optional properties can help to improve the relevance and accuracy of the quote results that you get back from the Consignments platform.
Get quotes response
Once it has received the request, a quote result is returned. The quote result object includes two lists: one containing Quotes
and one containing UnqualifiedServices
(that is, eligible services for which it was not possible to obtain a delivery quote).
Each Quote
object contains the following information:
- A unique reference for the quote. This property is important, as it is used when allocating consignments to the quote via the Allocate With Quote endpoint.
- Creation and expiry dates.
- The name and reference of the relevant carrier and carrier service.
- Origin and destination addresses.
- Collection date, and a delivery date range.
- Pricing information.
- Details on each leg of the journey (where applicable).
- The service direction.
At this point, you would be able to display the relevant quote information to your customer service operative.
For full reference information on the Get Quotes endpoint, see the API Reference.
Example: Get quotes request
The example below shows a Get Quotes call for a fairly simple consignment. Consignments has responded with one quote and two unavailable services.
POST https://api.electioapp.com/quotes/
{
"Packages": [
{
"Weight": {
"Value": 0.5,
"Unit": "Kg"
},
"Dimensions": {
"Unit": "Cm",
"Width": 10.0,
"Length": 10.0,
"Height": 10.0
},
"Description": "Socks",
"Value": {
"Amount": 5.99,
"Currency": {
"IsoCode": "GBP"
}
}
}
],
"Addresses": [
{
"AddressType": "Origin",
"ShippingLocationReference": "Sorted1",
"IsCached": false
},
{
"AddressType": "Destination",
"Contact": {
"Title": "Mr",
"FirstName": "Peter",
"LastName": "McPetersson",
"Telephone": "07702123456",
"Mobile": "07702123456",
"LandLine": "0161544123",
"Email": "peter.mcpetersson@test.com"
},
"AddressLine1": "13 Porter Street",
"Region": "Greater Manchester",
"Postcode": "M1 5WG",
"Country": {
"Name": "Great Britain",
"IsoCode": {
"TwoLetterCode": "GB"
}
},
"IsCached": false
}
]
}
{
"QuoteRequestReference": "e2d05715-bb82-4659-a970-ab8400f35eef",
"Quotes": [
{
"MpdCarrierServiceSource": 2,
"MpdCarrierService": "Tracked 48 ",
"CarrierReference": "RoyalMail",
"OriginAddress": {
"Contact": null,
"CompanyName": null,
"ShippingLocationReference": "Sorted1",
"CustomerName": null,
"AddressLine1": "Third Floor",
"AddressLine2": "Merchant Exchange",
"AddressLine3": "Whitworth Street West",
"Town": "Manchester",
"Region": "",
"Postcode": "M1 5WG",
"Country": {
"Name": "United Kingdom",
"IsoCode": {
"TwoLetterCode": "GB"
}
},
"RegionCode": "",
"SpecialInstructions": "",
"LatLong": null,
"IsCached": false
},
"DestinationAddress": {
"Contact": null,
"CompanyName": null,
"ShippingLocationReference": null,
"CustomerName": null,
"AddressLine1": "13 Porter Street",
"AddressLine2": null,
"AddressLine3": null,
"Town": null,
"Region": "Greater Manchester",
"Postcode": "M1 5WG",
"Country": {
"Name": "United Kingdom",
"IsoCode": {
"TwoLetterCode": "GB"
}
},
"RegionCode": "",
"SpecialInstructions": null,
"LatLong": null,
"IsCached": false
},
"CollectionDate": "2020-03-21T00:00:00+00:00",
"EarliestDeliveryDate": "2020-03-24T00:00:00+00:00",
"LatestDeliveryDate": "2020-03-24T23:59:00+00:00",
"BasePrice": {
"Net": 27.69,
"Gross": 33.23,
"TaxRate": {
"Reference": "GB-0.2000",
"CountryIsoCode": "GB",
"Type": "Standard",
"Rate": 0.2000
},
"VatAmount": 5.54,
"Currency": {
"Name": "Pound Sterling",
"IsoCode": "GBP"
}
},
"Price": {
"Net": 27.69,
"Gross": 33.23,
"TaxRate": {
"Reference": "GB-0.2000",
"CountryIsoCode": "GB",
"Type": "Standard",
"Rate": 0.2000
},
"VatAmount": 5.54,
"Currency": {
"Name": "Pound Sterling",
"IsoCode": "GBP"
}
},
"Surcharges": [],
"Legs": [
{
"JourneyStage": 1,
"CarrierService": {
"Reference": "RMDTPS48HNAUT",
"Name": "Tracked 48 ",
"CarrierReference": "ROYAL_MAIL",
"CarrierName": null,
"ExternalReference": null,
"IsDropOff": false,
"IsPickUp": false,
"IsTimed": false,
"IsTracked": true,
"IsSigned": false,
"ServiceDirection": "Inbound, Outbound"
},
"CarrierAccountReference": "RM1",
"DeliveryHub": null,
"CostItems": null,
"VolumetricParcelWeight": null,
"CollectionType": "NotApplicable",
"Metadata": []
}
],
"CarrierAccountOwner": null,
"IsElectioService": false,
"ServiceDirection": "Inbound, Outbound",
"QuoteReference": "49a01165-e512-4287-9a6a-ab8400f3600b",
"CreationDate": "2020-03-20T14:46:06.113622+00:00",
"ExpiryDate": "2020-03-21T00:00:00+00:00",
"Requestor": "Andy Walton",
"ConsignmentReference": "",
"ConsignmentReferenceProvidedByCustomer": "",
"MpdCarrierServiceReference": "MPD_RMDTPS48HNAUT"
}
],
"Message": null,
"UnqualifiedServices": [
{
"Available": false,
"Rates": true,
"MpdCarrierService": "UPS EXPRESS (Delivery Confirmation Signature Required)",
"CarrierReference": "UPS",
"MpdCarrierServiceReference": "EDC5_UPSHEXDCS",
"ExclusionReason": "Service availability data not configured"
},
{
"Available": false,
"Rates": true,
"MpdCarrierService": "UPS EXPRESS (Saturday Delivery, Delivery Confirmation Signature Required)",
"CarrierReference": "UPS",
"MpdCarrierServiceReference": "EDC5_UPSHEXSDDCS",
"ExclusionReason": "Service availability data not configured"
}
]
}
Next Steps
- Learn how to get quotes for an existing package Get quotes for an existing package page.
- Learn how to create consignments at the Creating a new consignment page.
- Learn how to allocate consignments to your chosen quote at the Allocate to a specific quote page.