PrixCar Transport Web Services API

Working with the Quotes API

The Quote API allows clients to request quotations for vehicle movements.

The Quote API is intended to work in conjunction with the Booking API. A booking cannot be created without a corresponding Quote.

The Quote API can be accessed by any third-party system such as industry partners, web applications or third-party applications.

The JSON Quote Object

The following is an example representation of a single quote record returned by the PrixCar Transport API, represented in JSON (and reformatted to make it easier to read):

{"Id":"2a35d9b1-aa83-4f17-aad4-a2430cff6393",
 "Metadata": 
  {"QuoteId":"QMX3488242",
   "DateTime":"\/Date(1378860760557)\/",
   "Status":2},
  "Quotes":
   [{"TransportType":0,
     "QuotedCostExGst":380,
     "QuotedCostIncGst":418.00000000000006,
     "QuotedCostAllInc":495.8316,
     "QuotedCarbonSurcharge":0,
     "QuotedGST":45.0756,
     "FuelSurcharge":70.756,
     "Adjustment":0,
     "TransitDays":3,
     "QuoteError":"",
     "BulkPricing":false,
     "Valid":true,
     "FuelLevy":0.1862},
    {"TransportType":1,
     "QuotedCostExGst":433,
     "QuotedCostIncGst":476.3,
     "QuotedCostAllInc":564.98705999999993,
     "QuotedCarbonSurcharge":0,
     "QuotedGST":51.36246,
     "FuelSurcharge":80.6246,
     "Adjustment":0,      
     "TransitDays":3,
     "QuoteError":"",
     "BulkPricing":false,
     "Valid":true,
     "FuelLevy":0.1862},
    {"TransportType":2,
     "QuotedCostExGst":430,
     "QuotedCostIncGst":473.00000000000006,
     "QuotedCostAllInc":561.07260000000008,
     "QuotedCarbonSurcharge":0,
     "QuotedGST":51.006600000000006,
     "FuelSurcharge":80.066,
     "Adjustment":0,
     "TransitDays":3,
     "QuoteError":"",
     "BulkPricing":false,
     "Valid":true,
     "FuelLevy":0.1862},
    {"TransportType":3,
     "QuotedCostExGst":482,
     "QuotedCostIncGst":530.2,
     "QuotedCostAllInc":628.92324,
     "QuotedCarbonSurcharge":0,
     "QuotedGST":57.174839999999996,
     "FuelSurcharge":89.7484,
     "Adjustment":0,
     "TransitDays":4,
     "QuoteError":"",
     "BulkPricing":false,
     "Valid":true,
     "FuelLevy":0.1862}
   ],
  "ContactDetails":
    {"Name":"Pablo Millhouston",
     "Email":"email@somedomain.com",
     "Phone":"1300660616"},
  "Pickup":
   {"Resolved":true,
    "Address":"50 Noga Avenue, Keilor East VIC 3033, Australia",
    "StreetAddress1":"50 Noga Avenue",
    "StreetAddress2":null,
    "Suburb":"Keilor East",
    "State":"Victoria",
    "Country":"Australia",
    "Postcode":"3033"},
  "Dropoff":
   {"Resolved":true,
    "Address":"Sydney NSW, Australia",
    "StreetAddress1":" ",
    "StreetAddress2":null,
    "Suburb":"Sydney",
    "State":"New South Wales",
    "Country":"Australia",
    "Postcode":""},
  "PickupDepot":
   {"Name":"Melbourne Depot",
    "State":"VIC",
    "RegionCode":"M",
    "PublicComment":""},
  "DropoffDepot":
   {"Name":"Sydney Depot",
    "State":"NSW",
    "RegionCode":"S",
    "PublicComment":""},
  "PickupClosestLocation":
   {"Name":"Melbourne Metro",
    "State":"VIC",
    "RegionCode":"M",
    "PublicComment":""},
  "DropoffClosestLocation":
   {"Name":"Sydney Metro",
    "State":"NSW",
    "RegionCode":"S",
    "PublicComment":""},
  "VehicleRows":
   [{"VehicleId":0,
     "Make":"Abarth",
     "Model":"695",
     "Value":"\u003c $80,000",
     "Classification":"Sedan",
     "Quantity":1,
     "Special":null,
     "VehicleNote":null,
     "UseDimensions":false,
     "Dimensions":null,
     "IsGoer":true,
     "Lowered":false,
     "Drivinglights":false,
     "Roofrack":false,
     "Bullbars":false,
     "CoveredTransport":false}
   ],
  "Notes":[],
  "Log":[]
}

Explanation of the Quote Object

Id Attribute

"Id":"2a35d9b1-aa83-4f17-aad4-a2430cff6393"

The Id attribute refers to a globally unique identifier (GUID) for the quote and can be used a key to search for a specific quote.

Metadata Segment

 "Metadata": 
  {"QuoteId":"QMX3488242",
   "DateTime":"\/Date(1378860760557)\/",
   "Status":2}

The QuoteId attribute provides a human-readable version of the Id value specified above.

The DateTime attribute provides the javascript representation of the the specific time that the quote was created. It’s value is the number of milliseconds since since the Unix Epoch (January 1 1970 00:00:00 GMT).

The Status attribute contains either the value 1 or 2. Always check that the value Status is set to 2 as this means the requested transport has been accurately quoted.

A value of 1 indicates that a quote could not be accurately obtained. This may be due to incomplete information or that the nature of the requested transport may require external help.

We recommend introducing a manual step, in an otherwise automated process, for contacting the PrixCar Transport Customer Relations Department directly for when a Status value of 1 is received.

Quotes Segment

The Quotes segment comprises an array of up to four TransportType elements.

  "Quotes":
   [{"TransportType":0,
     "QuotedCostExGst":380,
     "QuotedCostIncGst":418.00000000000006,
     "QuotedCostAllInc":495.8316,
     "QuotedCarbonSurcharge":0,
     "QuotedGST":45.0756,
     "FuelSurcharge":70.756,
     "Adjustment":0,
     "TransitDays":3,
     "QuoteError":"",
     "BulkPricing":false,
     "Valid":true,
     "FuelLevy":0.1862},
...

Each array element contains a TransportType which can ranges in value from 0 to 3. Values for TransportType are as follows:

TransportTypeDefinition
0Nearest Pickup Depot to Nearest Delivery Depot (Depot to Depot)
1Nearest Pickup Depot to specified delivery address (Depot to Door)
2Specified pickup address to Nearest Delivery Depot (Door to Depot)
3Specified pickup address to specified delivery address (Door to Door)

If the system has been unable to automatically price a transport type, it will be omitted from the results. For example, on occasion, we may not be able to deliver to a specified address in which case TransportType:1 and TransportType:3 may not be available in the result set.

Carbon Tax is currently set to 0 following legislation passes by Australian Federal Paliament on 17 July 2014, to repeal the carbon tax from 1 July 2014.

ContactDetails Segment

  "ContactDetails":
    {"Name":"Jason",
     "Email":"email@somedomain.com",
     "Phone":"1300660616"},

The ContactDetails segment contains name and contact details of the person requesting the quote. This is generally provided when as input to the /quote_request service call.

Pickup and Dropoff Address Segments

Pickup and Dropoff addresses are validated by the web services prior to calculating a price.

In both the Pickup and Dropoff segments, the Resolved attributes indicates whether the web services API has been able to accurately validate the address provided. If set to false, a price will not be provided.

  "Pickup":
   {"Resolved":true,
    "Address":"50 Noga Avenue, Keilor East VIC 3033, Australia",
    "StreetAddress1":"50 Noga Avenue",
    "StreetAddress2":null,
    "Suburb":"Keilor East",
    "State":"Victoria",
    "Country":"Australia",
    "Postcode":"3033"},
  "Dropoff":
   {"Resolved":true,
    "Address":"Sydney NSW, Australia",
    "StreetAddress1":" ",
    "StreetAddress2":null,
    "Suburb":"Sydney",
    "State":"New South Wales",
    "Country":"Australia",
    "Postcode":""},

The Pickup and Dropoff segments contain the address details as specified by the client.

Address corresponds to the address exactly as provided by the client.

Other fields (StreetAddress1, StreetAddress2, Suburb, etc) refer to the parsed information provided by the Web Services API.

PickupDepot and DropoffDepot Segments

The PickupDepot and DropoffDepot segments refer to the principal PrixCar Transport depots used in quote calculations. These are particularly important in understanding the pricing around TransportTypes 0 through to 2.

  "PickupDepot":
   {"Name":"Melbourne Depot",
    "State":"VIC",
    "RegionCode":"M",
    "PublicComment":""},
  "DropoffDepot":
   {"Name":"Sydney Depot",
    "State":"NSW",
    "RegionCode":"S",
    "PublicComment":""},

PickupClosestLocation and DropoffClosestLocation Segments

The PickupClosestLocation and DropoffClosestLocation segments are internally used by the system in order to apply a pricing scheme to the quote. They are provided as reference only.

  "PickupClosestLocation":
   {"Name":"Melbourne Metro",
    "State":"VIC",
    "RegionCode":"M",
    "PublicComment":""},
  "DropoffClosestLocation":
   {"Name":"Sydney Metro",
    "State":"NSW",
    "RegionCode":"S",
    "PublicComment":""},

VehicleRows Segment

  "VehicleRows":
   [{"VehicleId":0,
     "Make":"Abarth",
     "Model":"695",
     "Value":"\u003c $80,000",
     "Classification":"Passenger",
     "Quantity":1,
     "Special":null,
     "VehicleNote":null,
     "UseDimensions":false,
     "Dimensions":null,
     "IsGoer":true,
     "Lowered":false,
     "Drivinglights":false,
     "Roofrack":false,
     "Bullbars":false,
     "CoveredTransport":false}
   ],

Each quote produced by the system comprises one or more vehicles as defined by the VehicleRows segment. The VehicleRows segments is further characterised as follows:

  • Each vehicle contains an identifying VehicleId.
  • Make and Model refer to the vehicle’s make and model respectively.
  • Value contains a text expression that matches the vehicle’s value (as obtained from the Get Vehicle Value Ranges service call.
  • Classification is provided by the system to advise on the vehicle classification that has been used in the calculation of a quote for that vehicle.
  • Quantity refers to the number of vehicles of Make and Model used in the calculation.
  • IsGoer is a boolean reference to indicate whether the vehicle is drivable. A value of “true” indicates that the vehicle is drivable.
  • Lowered is a boolean reference to indicate whether the vehicle has had it’s suspension modified. A value of “true” indicates that the vehicle’s suspension has been modified.
  • Drivinglights is a boolean reference to indicate whether the vehicle contains overhead driving lights fitted. A value of “true” indicates that the vehicle contains overhead lights.
  • Roofrack is a boolean reference to indicate whether the vehicle contains overhead roof-racks fitted. A value of “true” indicates that the vehicle contains roof-racks.
  • Bullbars is a boolean reference to indicate whether the vehicle contains bull-bars or roo-bars fitted. A value of “true” indicates that the vehicle contains these.
  • CoveredTransport is a boolean reference to indicate whether enclosed transport has been requested. A value of “true” indicates a request for the enclosed transport option.

Working with Quotes

Create Quote

Creates a new quote record from the data passed as HTTP POST variables.

Usage

http://appname/WEBAPI/create_quote?APIKey=ff6f3bdb-e1d8-4dfb-bd78-9aa838bed114&UserName=prixcar

Required HTTP POST Parameters

Header-level
NameTypeDefinition
order.QuoteRequestDetails.NamestringThe name of the person requesting the quote
order.QuoteRequestDetails.EmailstringThe email address of the person requesting the quote. (Note: This must be a properly formatted email address.)
order.QuoteRequestDetails.PhonestringThe contact number of the person requesting the quote.
order.PickupAddressstringThe vehicle’s pickup address. This is generally a concatenation of Suburb/State/Postcode. E.g. “Melbourne VIC 3000” Addresses are revalidated against internal locations database. (How to validate a location.)
order.DropoffAddressstringThe vehicle’s delivery address. This is generally a concatenation of Suburb/State/Postcode. E.g. “Waterloo NSW 2016”. Addresses are revalidated against internal locations database. (How to validate a location.)
Vehicle-level
A single quote request must contain one or more vehicles defined as an array (commencing with “0”). Each vehicle must contain all vehicle-level attributes as follows.
NameTypeDefinition
order.VehicleRows[0].VehicleIdintegerSpecifies the vehicle ID (as per Get Vehicles)
order.VehicleRows[0].ValuestringSpecifies the vehicles value (as per Vehicle Value Ranges)
order.VehicleRows[0].QuantityintegerSpecifies the number of vehicles.
order.VehicleRows[0].IsGoertrue/falseSpecifies whether the vehicle is drivable.
order.VehicleRows[0].Loweredtrue/falseSpecifies whether the vehicle has had it’s suspension modified.
order.VehicleRows[0].Drivinglightstrue/falseSpecifies whether the vehicle has overhead driving lights fitted.
order.VehicleRows[0].Roofracktrue/falseSpecifies whether the vehicle has roof racks fitted.
order.VehicleRows[0].Bullbarstrue/falseSpecifies whether the vehicle has roobars or bullbars fitted.
order.VehicleRows[0].CoveredTransporttrue/falseSpecifies whether pricing for enclosed transport is request.

If multiple vehicles are specified, then be sure to increment the array index for each vehicle.

Retrieve Quote

The PrixCar Transport API allows clients to retrieve the details of a previously created quote.

The service will return an instance of a Quote Object.

Usage

http://appname/WEBAPI/retrieve_quote?APIKey=ff6f3bdb-e1d8-4dfb-bd78-9aa838bed114&UserName=prixcar

Required HTTP POST Parameters

NameTypeDefinition
idStringThe QuoteId (E.g. QMX3488242) or globally unique Id (E.g. 2a35d9b1-aa83-4f17-aad4-a2430cff6393) of a previously created Quote.

Fetch Recent Quotes

The PrixCar Transport API allows clients to retrieve a list of that have been previously been created.

Usage

http://appname/WEBAPI/recent_quotes?APIKey=ff6f3bdb-e1d8-4dfb-bd78-9aa838bed114&UserName=prixcar

Required HTTP POST Parameters

NameTypeDefinition
datefromYYYY-MM-DD hh:mm:ssThe starting date range for quote search. Example “2013-08-01 11:00:00” corresponds to 11:00am on August 1st, 2013.
datetoYYYY-MM-DD hh:mm:ssThe starting date range for quote search. Example “2013-09-01 11:00:00” corresponds to 11:00am on September 1st, 2013.
countintegerThe maximum number of quotes to retrieve

Quotes are retrieved starting with those created after datefrom. A maximum of count quotes will be return or quotes up to dateto – whichever occurs sooner.

Get Vehicle Data

The creation of a Quote requires a unique vehicle ID to be specified. Vehicle IDs represent the unique combination of available vehicle makes and their models.

A complete list of vehicles is obtained via the /get_vehicles service call.

Usage

http://appname/WEBAPI/get_vehicles?APIKey=ff6f3bdb-e1d8-4dfb-bd78-9aa838bed114&UserName=prixcar

A request to the /get_vehicles call will return a list of vehicle make and model combinations understood by the quoting system. The returned list of vehicles will likely need to be reformatted for use within custom applications.

[{"VehicleId":0,"Make":"Abarth","Model":"500"},
 {"VehicleId":1,"Make":"Abarth","Model":"695"},
 {"VehicleId":2,"Make":"Alfa Romeo","Model":"147"},
 {"VehicleId":3,"Make":"Alfa Romeo","Model":"156"},
 {"VehicleId":4,"Make":"Alfa Romeo","Model":"159"},
 {"VehicleId":5,"Make":"Alfa Romeo","Model":"164"},
 {"VehicleId":6,"Make":"Alfa Romeo","Model":"166"},
 {"VehicleId":7,"Make":"Alfa Romeo","Model":"1300"},
...

There are no additional parameters required.

This web service is not intended to be used synchronously with the creation of each quote. Use of this web service may may be subject to throttling.

Get Vehicle Value Ranges

Vehicle Value Ranges are used by the quote system to automatically categorise the transport request for insurance purposes. Instead of providing specific values for vehicles, our customers have requested that we allow them to provide value ranges instead.

A request to the /get_vehicle_value_ranges call will return a list of ranges used within the quoting system. It is possible to parse the returned values and display them directly within your own web application.

["\u003c $80,000",
 "$80,000 - $150,000",
 "$150,001 - $300,000",
 "$300,000 +"]

When creating a quote, please use one of the pre-defined value ranges.

This web service is not intended to be used synchronously with the creation of each quote. Use of this web service may may be subject to throttling.

Location Lookup

Order.PickupAddress and Order.DeliveryAddress must use a combination of Locality, State and Postcode as a concatenated, space-separated string.

The Pickup and Delivery addresses must match a combination found within our internal database.

We provide support for validating postcodes against our own internal database through the service endpoint /WEBAPI/location-lookup.

Usage

http://appname/WEBAPI/location-lookup/?pcode=5000&APIKey=ff6f3bdb-e1d8-4dfb-bd78-9aa838bed114&UserName=prixcar

A request to the /WEBAPI/location-lookup service endpoint will return the complete location details available for quoting. It is possible to parse the returned values and display them directly within your own web application.

If there are multiple locations returned, you’ll need to present these to the user and allow them to select the one that applies.

[{"Pcode":"5000","Locality":"Adelaide","State":"SA","Comments":"","Category":"cat"},
 {"Pcode":"5000","Locality":"City West Campus","State":"SA","Comments":"","Category":"cat"},
 {"Pcode":"5000","Locality":"Halifax Street","State":"SA","Comments":"","Category":"cat"},
...

When requesting a quote, concatenate the Locality, State and Pcode values from the response and assign it to either PickupAddress or DropoffAddress.