Car rental API training

Explore the rental API.

Browse documented endpoints, inspect request examples, choose a response scenario, and make a mock call right in this page.

Endpoint directory

Rental API v1

All routes use fictional vehicle data. Select an endpoint to jump to its documentation and interactive mock.

GET /api/v1/vehicles

List vehicles

Returns the six sample vehicles with category, transmission, capacity, and daily USD price.

JavaScript example

const response = await rentalMockApi.request('/api/v1/vehicles');
const result = await response.json();
console.log(response.status, result.data);
Example success response JSON
{
  "data": [{
    "id": "corolla",
    "name": "Toyota Corolla",
    "category": { "code": "compact", "label": "Compact" },
    "specifications": {
      "transmission": "Automatic",
      "passengers": 5,
      "luggage": { "large": 2, "small": 1 },
      "fuelType": "Hybrid"
    },
    "pricing": {
      "currency": "USD",
      "dailyRate": 54,
      "includedMileageKmPerDay": 250,
      "securityDeposit": 300,
      "airportServiceFee": 18
    },
    "availability": {
      "status": "available",
      "pickupLocationIds": ["budapest-airport", "cluj-airport"]
    },
    "rating": { "average": 4.8, "reviewCount": 126 },
    "features": ["Apple CarPlay", "Cruise control", "Rear camera"]
  }],
  "meta": {
    "pagination": { "page": 1, "pageSize": 10, "totalItems": 6, "totalPages": 1 },
    "sorting": { "field": "name", "direction": "asc" },
    "currency": "USD"
  }
}
Response appears here after a mock call.
GET /api/v1/vehicles/{id}

Get one vehicle

Returns a single car by ID. The example ID corolla maps to the Toyota Corolla card on the UI page.

JavaScript example

const response = await rentalMockApi.request('/api/v1/vehicles/corolla');
const vehicle = await response.json();
Example success response JSON
{
  "data": {
    "vehicle": { "id": "corolla", "name": "Toyota Corolla" },
    "pickupLocations": [{
      "id": "budapest-airport",
      "name": "Budapest Airport",
      "city": "Budapest",
      "countryCode": "HU",
      "timezone": "Europe/Budapest"
    }],
    "insuranceOptions": [
      { "code": "basic", "dailyPrice": 0, "currency": "USD", "excess": 1200 },
      { "code": "plus", "dailyPrice": 14, "currency": "USD", "excess": 350 }
    ],
    "policies": {
      "minimumDriverAge": 21,
      "minimumLicenseYears": 2,
      "crossBorderTravel": "approval-required"
    }
  },
  "meta": { "resource": "vehicle", "version": "v1", "requestId": "req-demo-..." }
}
Response appears here after a mock call.
POST /api/v1/reservations

Create a sample reservation

Returns a fictional confirmation. No real reservation or personal data is sent or stored.

Request body

{
  "vehicleId": "corolla",
  "pickupLocation": "budapest-airport",
  "dropoffLocation": "cluj-airport",
  "pickupDate": "2026-11-10",
  "dropoffDate": "2026-11-12"
}

JavaScript example

const response = await rentalMockApi.request('/api/v1/reservations', {
  method: 'POST',
  body: reservationRequest
});
Example created response JSON
{
  "data": {
    "reservation": {
      "id": "reservation-demo-2048",
      "confirmationCode": "QA-TRAINING-2048",
      "status": "confirmed",
      "vehicle": { "id": "corolla", "name": "Toyota Corolla" },
      "rentalPeriod": {
        "pickupDate": "2026-11-10",
        "dropoffDate": "2026-11-12",
        "durationDays": 2
      },
      "locations": {
        "pickup": { "id": "budapest-airport", "countryCode": "HU" },
        "dropoff": { "id": "cluj-airport", "countryCode": "RO" }
      },
      "pricing": {
        "currency": "USD",
        "baseAmount": 108,
        "fees": [{ "code": "airport-service", "amount": 18 }],
        "estimatedTax": 10.08,
        "estimatedTotal": 136.08,
        "securityDeposit": 300
      },
      "payment": { "status": "not-charged", "method": null },
      "nextSteps": ["Review the sample confirmation"]
    }
  },
  "meta": { "resource": "reservation", "version": "v1", "requestId": "req-demo-..." }
}
Response appears here after a mock call.