/
Test drives

Test drives

APIs allow access to designated test-drive vehicles, calendars and bookings.

Get existing bookings

Bookings endpoint is used to list existing bookings:

curl https://salesfront.url/api/v3/test-drive/bookings -H 'X-API-Key: XXX'

Please apply filters to retrieve only relevant items, for example:

  • isInternal=false excludes any non-customer bookings

  • status[]=checked_out returns only ongoing test drive

  • start[after]=2022-02-22 returns bookings after specified date

Create a booking

Test drive booking process is slightly different with new and used cars:

New cars

  1. Get list of available test drive vehicles. You need to apply several filters to make sure to retrieve only relevant items:

    • singleBookingCar=false

    • disabledForNewBookings=false

    • warehouseItem.brand.name[]=XX

    • warehouseItem.spec.model.name[]=YY

  2. Get free slots for a vehicle.

  3. Post a new booking.

Used cars

  1. Get list of test drive vehicles to check if vehicle is already added as a singleBookingCar.

  2. Post a new booking.

List test drive vehicles

curl https://salesfront.url/api/v3/test-drive/cars -H 'X-API-Key: XXX'

Result:

[ { "id": 1, "iri": "/api/v3/test-drive/cars/1", "regNr": "123ABC", "vinCode": "VIN12345678901234", "singleBookingCar": false, "disabledForNewBookings": false, ... "dealership": { ... }, "warehouseItem": { ... } }, ... ]

Get available time slots

curl 'https://salesfront.url/api/v3/test-drive/cars/3/free-slots?start=2022-02-20&end=2022-02-21&duration=120' \ -H 'X-API-Key: XXX'

Response will be slots in one day, each 120 minutes in size:

Create a booking

curl -X POST https://salesfront.url/api/v3/test-drive/bookings \ -H 'Content-Type: application/json' \ -H 'X-API-Key: XXX' \ -d '{ "start": "2022-02-22T12:00", "end": "2022-02-22T13:00", "warehouseCar": "/api/v3/warehouse/items/VIN12345678901234", "customerData": { "name": "James Fox" } }'

 

Related content