# Creating a car booking The steps below explain how to create a car booking using Spotnana APIs. | Step | Name | Endpoint | Details | | --- | --- | --- | --- | | 1. | [Get car search results](/openapi/carapi/car/carsearch) | `POST /v2/car/search` | Search for available cars based on the pickup and drop-off location, date, time, and other filter criteria.**Request body requires:** `pickup`, `dropOff`, and `userId`. The `userId` of the traveler can be retrieved using the [query user](/openapi/usersapi/users/queryuser) API. Optionally, you can provide `filters` (e.g., car type, price range, preferred vendors) and `sortOptions` to refine the results.**Response will contain:** `searchId` and a list of available cars with their respective `carId`, pickup and drop-off details, rate information, vendor details, and cancellation policies.**Other APIs will use:** `searchId` and `carId`. | | 1. | [Get car rate details](/openapi/carapi/car/carratedetails) (optional) | `POST /v2/car/rate-details` | View additional information about a selected car before proceeding with the booking. This includes the pickup and drop-off location details, vendor information, additional rental requirements (e.g., driver age restrictions), carbon emission details, and checkout approval information.**Request body requires:** `searchId` and `carId` from step 1.**Response will contain:** `pickupLocation`, `dropOffLocation`, `vendor`, `additionalDetails`, `co2Emission`, and `isFlightNumberMandatoryForPickup`.**Note:** This step is optional but recommended when you need to display comprehensive car details to the traveler before checkout. | | 1. | [Check car price availability](/openapi/carapi/car/carpricecheck) | `POST /v2/car/price-check` | Verify the price for the selected car before creating the booking. Car rental prices can change due to demand and availability. This endpoint ensures the latest price is captured before the traveler proceeds with the booking.**Request body requires:** `searchId` and `carId` from step 1.**Response will contain:** `bookingKey`, `hasPriceChanged` (a boolean flag that indicates if the price has changed since the search was performed), `timeoutSeconds` (the time in seconds for which the price is held), and the updated `finalRateInfo`.**Other APIs will use:** `bookingKey`. | | 1. | [Create a new car booking](/openapi/carapi/car/carcreatepnr) | `POST /v2/car/create-pnr` | Create a new car booking PNR.**Request body requires:** `bookingKey` from step 3, `carId` from step 1, `tripData` containing the `tripId`, a list of travelers, and `bookingCharges` with the selected payment method. Use the `tripData.tripId` field to pass an existing `tripId` or use the [create trip](/openapi/tripapi/trips/createtrip) API to create a new trip.**Response will contain:** `pnrId`, `sourcePnrId`, and `pnrStatus`.**Note:** The `sourcePnrId` stores the source PNR ID retrieved from the Global Distribution System (GDS) or the supplier. The `pnrId` generated by this API will be used in the modify and cancel car booking workflows (if needed). |