Login | Register

Function: Get Pricing

The Coach Hire system uses an auto-price function. With this most jobs can be priced and booked without any requirement for manual confirmation. The pricing is based on the journey itself - specifically the distance as calculated by the Pick Up and Return dates, the Google Map coordinates and the chosen vehicle. At this stage it is not possible to get pricing for a range of vehicles with a single request. As such you need to make this enquiry for each of the vehicles that you require pricing for.

<?xml version='1.0' encoding='utf-8'?>
   <JobFile>
     <appID>23423411</appID>
     <appSecret>9a83d44f4cc7067d20f8f2f060be3ab6848e6d23</appSecret>
     <username>Sandbox User</username>
     <getAjaxData>
        <getFor>Pricing</getFor>
        <setCar>2</setCar>
        <collection/>
          <latitude>51.0550733</latitude>
          <longitude>-1.7381232000000182</longitude>
        </collection>
        <destination>
          <latitude>52.4836536</latitude>
          <longitude>-1.8926380999999992</longitude>
        </destination>
     </getAjaxData>
   </JobFile>

To break this down: Let's look at each tag and what is required;

Tag Format Notes
<username> string Name of User making request (optional)
<getAjaxData> N/A This says the API is requesting some data be returned
<getFor> string This value indicates the data requested is for Pricing
<setCar> integer

This is the record ID of the vehicle for which pricing is being requested. You will have the record IDs of the vehicles from a Get Vehicle Options request

<collection> float

This is split into longitude and latitude coordinates. You must supply this information - There is currently no API call to get map locations

<destination> float Same rules and format as collection coordinates
<datetimePickup> date/time

The date format must be as dd-mm-yyyy and the time as hh:mm using standard 24 hour time - This is needed as the date may have an impact on the price

<datetimeReturn> date/time

This is required where it is a return journey. Do NOT include this tag if the journey is only one way

Data Returned - Pricing:

Here the return is a single item with a price for the specified journey with the nominated vehicle. This is for information - not used when inserting the job - but rather to enable you to make a decision on that option based on the price.

Callback : {
    "code":200,
    "count":1,
    "data": {
        "price":177
    }
}