logo P4D

The P4D API: GetQuote

 
This is one of the most important functions and is used to generate a live quote which you can then book using the PlaceBooking function.

Input Fields

Field Name Required? Description Example
ShipAction YES This tells our system which function you require GetQuote
Username YES You must specify your username joebloggs
APIKey YES This is available from your Shipping Manager account page HJ1E6DOTRDXAOLB
CollectionName YES * The name of the person sending the parcel Joe Bloggs
CollectionCompany   Company name of the parcel sender Bloggs PLC
CollectionAddress1 YES * Address parcel should be collected from Bloggs Street
CollectionAddress2   Address parcel should be collected from Bloggs Estate
CollectionAddress3   Address parcel should be collected from  
CollectionTown YES * Town parcel should be collected from Bloggs Ville
CollectionCounty YES * County parcel should be collected from North Yorkshire
CollectionPostcode YES * Postcode parcel should be collected from DL10 5HG
CollectionTelephone YES * Telephone number of collection contact person 01234 567890
DeliveryName YES Name of the person parcel should be sent to John Smith
DeliveryCompany   Company that the parcel should be sent to  
DeliveryAddress1 YES Address that the parcel should be sent to Fictional Street
DeliveryAddress2   Address that the parcel should be sent to  
DeliveryAddress3   Address that the parcel should be sent to  
DeliveryTown YES Town that the parcel should be sent to Fictional Town
DeliveryCounty YES County that the parcel should be sent to Fictional County
DeliveryPostcode YES Postcode that the parcel should be sent to AB1 6CC
DeliveryCountry YES Country code that the parcel should be sent to UK
DeliveryTelephone YES Telephone number of the delivery contact person 01445 667788
Weight YES Weight of the parcels in KG 5
Width YES Width of the parcel in CM 10
Height YES Height of the parcel in CM 20
Length YES Length of the parcel in CM 30
ParcelContents YES Brief summary of parcel contents Clothes
EstimatedValue YES Estimated value of the parcel contents £25

* If you do not specify any collection address details then your account's default collection address will be used.

Output Fields
 

Field Name Description Example
ShipAction Confirmation of the function used GetQuote
Status Either Success or Error Success
RequestDate The date your request was received (yyyy-mm-dd hh:mm:ss) 2008-01-10 12:15:31
Username The username used to make the request joebloggs
QuoteID A unique reference for the quote you have generated QUOTEYSSPETYD6UZHS
QuoteExpires You have 24 hours from the date you generate the quote to place a booking, otherwise you will need to generate a new quote. 2008-01-11 12:15:31
NoServices The number of delivery options available 4
DeliveryCountry The name of the country the parcel is being sent to United Kingdom
CheapestQuote An array containing the price for the cheapest quote -
SubTotal The subtotal before VAT for the cheapest item 5.99
VatTotal The VAT amount for the cheapest item 1.05
TotalPrice The total price including VAT for the cheapest item 7.04
ServiceOptions An array containing all the available options: -
OptionID A unique ID for this service (required when using PlaceBooking) 623
Carrier The carrier that this service uses (see list) DHL Home
ServiceName The name of the service Home 48 (UK to UK)
ServiceID The ID of the service (used for ServiceInfo) DHL48_UKUK
SubjectToVat Whether this service is subject to VAT or not Y or N
SubTotal The subtotal before VAT 5.99
VatTotal The VAT amount 1.05
TotalPrice The total price including VAY 7.04

Example Input

Array
(
    [ShipAction] => GetQuote
    [Username] => joebloggs
    [APIKey] => HJ1E6DOTRDXAOLB

    [CollectionName] => Joe Bloggs
    [CollectionCompany] => Bloggs PLC
    [CollectionAddress1] => Bloggs Street
    [CollectionAddress2] => Bloggs Estate
    [CollectionAddress3] => 
    [CollectionTown] => Bloggs Ville
    [CollectionCounty] => North Yorkshire
    [CollectionPostcode] => DL10 5HG
    [CollectionTelephone] => 01234 567890

    [DeliveryName] => John Smith
    [DeliveryCompany] => 
    [DeliveryAddress1] => Fictional Street
    [DeliveryAddress2] => 
    [DeliveryAddress3] => 
    [DeliveryTown] => Fictional Town
    [DeliveryCounty] => Fictional County
    [DeliveryCountry] => UK
    [DeliveryPostcode] => AB1 6CC
    [DeliveryTelephone] => 01445 667788

    [Weight] => 5
    [Width] => 10
    [Height] => 20
    [Length] => 30
    [ParcelContents] => Clothes
    [EstimatedValue] => £25

)

Example Output
 
Array
(
    [ShipAction] => GetQuote
    [Status] => Success
    [RequestDate] => 2008-01-10 12:15:31

    [Username] => joebloggs
    [QuoteID] => HJ1E6DOTRDXAOLB
    [QuoteExpires] => 2008-01-11 12:15:31
    [NoServices] => 9
    [DeliveryCountry] => United Kingdom
    [CheapestQuote] => Array
        (
            [SubTotal] => 5.99
            [VatTotal] => 1.05
            [TotalPrice] => 7.04
        )

    [ServiceOptions] => Array
        (
            [0] => Array
                (
                    [OptionID] => 623
                    [Carrier] => DHL Home
                    [ServiceName] => Home 48 (UK to UK)
                    [ServiceID] => DHL48_UKUK
                    [SubjectToVat] => Y
                    [SubTotal] => 5.99
                    [VatTotal] => 1.05
                    [TotalPrice] => 7.04
                )

            [1] => Array
                (
                    [OptionID] => 624
                    [Carrier] => DHL Home
                    [ServiceName] => Home 24 (UK to UK)
                    [ServiceID] => DHL24_UKUK
                    [SubjectToVat] => Y
                    [SubTotal] => 8.99
                    [VatTotal] => 1.57
                    [TotalPrice] => 10.56
                )

            [2] => Array
                (
                    [OptionID] => 629
                    [Carrier] => DPD
                    [ServiceName] => DPD Next Day (UK to UK)
                    [ServiceID] => DPD_NDUKUK
                    [SubjectToVat] => Y
                    [SubTotal] => 14.49
                    [VatTotal] => 2.54
                    [TotalPrice] => 17.03
                )

            [3] => Array
                (
                    [OptionID] => 625
                    [Carrier] => PF
                    [ServiceName] => 48 Hour delivery (UK to UK)
                    [ServiceID] => PF48_UKUK
                    [SubjectToVat] => Y
                    [SubTotal] => 15.67
                    [VatTotal] => 2.74
                    [TotalPrice] => 18.41
                )

            [4] => Array
                (
                    [OptionID] => 626
                    [Carrier] => PF
                    [ServiceName] => 24 Hour delivery (UK to UK)
                    [ServiceID] => PF24_UKUK
                    [SubjectToVat] => Y
                    [SubTotal] => 16.73
                    [VatTotal] => 2.93
                    [TotalPrice] => 19.66
                )

            [5] => Array
                (
                    [OptionID] => 627
                    [Carrier] => TNT
                    [ServiceName] => P4D Trident 24
                    [ServiceID] => P4D_TR24
                    [SubjectToVat] => Y
                    [SubTotal] => 20.45
                    [VatTotal] => 3.58
                    [TotalPrice] => 24.03
                )

            [6] => Array
                (
                    [OptionID] => 628
                    [Carrier] => TNT
                    [ServiceName] => P4D Trident by noon
                    [ServiceID] => P4D_TRNOON
                    [SubjectToVat] => Y
                    [SubTotal] => 26.15
                    [VatTotal] => 4.58
                    [TotalPrice] => 30.73
                )

            [7] => Array
                (
                    [OptionID] => 630
                    [Carrier] => DPD
                    [ServiceName] => DPD 12.00 (UK to UK)
                    [ServiceID] => DPD_12UKUK
                    [SubjectToVat] => Y
                    [SubTotal] => 28.00
                    [VatTotal] => 4.90
                    [TotalPrice] => 32.90
                )

            [8] => Array
                (
                    [OptionID] => 631
                    [Carrier] => DPD
                    [ServiceName] => DPD 10.00 UK to UK)
                    [ServiceID] => DPD_10UKUK
                    [SubjectToVat] => Y
                    [SubTotal] => 34.00
                    [VatTotal] => 5.95
                    [TotalPrice] => 39.95
                )

        )

)

Carrier Codes

DHL DHL - for their European 'by road' services
DHL Home DHL - for their UK services
DHL TD DHL - for their 'by air' services
DPD DPD (previously know as Parceline)
PF Parcel Force
TNT TNT - for their UK services
TNT Export TNT - for their international services