{
    "openapi": "3.0.3",
    "info": {
        "title": "Romanian Car Hire AI search",
        "version": "1.0",
        "contact": {
            "email": "office@romaniancarhire.com"
        },
        "description": "Live car availability and final prices at Romanian Car Hire locations in Romania. Public, read-only, no key: it cannot book; the customer books through the bookingUrl of the chosen offer.\n\nRules: total is the final price for the whole rental (insurance, taxes and location fees included) — never compute it from perDay. Read items[].offers.standard (with deposit) first; items[].offers.extraProtection has no damage deposit (or is null). deposit 0 means no deposit at all. instantConfirmation true / requestNote 1 = confirmed immediately; requestNote 2 = on request. Prices change constantly: call again for every new question.\n\nMessage codes (stable; texts may change):\n- GET_REQUIRED (HTTP 405): Send the request with GET.\n- FIELD_REQUIRED (HTTP 400): This field is required: {value}.\n- FIELD_INVALID (HTTP 400): This field has an invalid value: {value}.\n- LOCATION_UNKNOWN (HTTP 400): This location does not exist: {value}.\n- PICKUP_IN_PAST (HTTP 400): The pick-up date and time must be in the future.\n- DROPOFF_BEFORE_PICKUP (HTTP 400): The return must be after the pick-up.\n- NO_RESULTS (HTTP 200): No car matches your search.\n- BELOW_MIN_DAYS (HTTP 200): The price is for the minimum rental of {value} days.\n- SERVER_ERROR (HTTP 500): Something went wrong on our side. Please try again.\n\nDocumentation: https://romaniancarhire.com/en/api"
    },
    "servers": [
        {
            "url": "https://romaniancarhire.com"
        }
    ],
    "paths": {
        "/api/ai-search.php": {
            "get": {
                "summary": "Search available cars and final prices",
                "operationId": "searchCars",
                "description": "Cars that can be rented between the two moments, with the two offers, deposit, km, cancellation and the booking link.",
                "parameters": [
                    {
                        "name": "pickup_location",
                        "in": "query",
                        "required": true,
                        "description": "Location code (see llms.txt or locationsRq). Locations: 30 = Bacău Airport (BCM); 3 = Bacău Train Station; 47 = București Otopeni Airport (OTP); 1 = Iași; 29 = Iași Airport (IAS); 31 = Suceava Airport (SCV); 8 = Suceava Train Station; 15 = Botoșani; 27 = Onești; 43 = Pașcani; 10 = Piatra-Neamț; 13 = Roman; 14 = Vaslui; 49 = Brașov Airport (GHV); 57 = Chișinău Airport (RMO); 51 = Cluj Airport (CLJ); 53 = Craiova Airport (CRA); 55 = Târgu Mureș Airport (TGM).",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "return_location",
                        "in": "query",
                        "required": true,
                        "description": "Location code. Locations: 30 = Bacău Airport (BCM); 3 = Bacău Train Station; 47 = București Otopeni Airport (OTP); 1 = Iași; 29 = Iași Airport (IAS); 31 = Suceava Airport (SCV); 8 = Suceava Train Station; 15 = Botoșani; 27 = Onești; 43 = Pașcani; 10 = Piatra-Neamț; 13 = Roman; 14 = Vaslui; 49 = Brașov Airport (GHV); 57 = Chișinău Airport (RMO); 51 = Cluj Airport (CLJ); 53 = Craiova Airport (CRA); 55 = Târgu Mureș Airport (TGM).",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "pickup_date",
                        "in": "query",
                        "required": true,
                        "description": "Romanian local time, YYYY-MM-DDTHH:MM. With a zone (Z, +02:00) it is converted to Romanian time.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "return_date",
                        "in": "query",
                        "required": true,
                        "description": "Same format, after the pick-up.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lang",
                        "in": "query",
                        "required": false,
                        "description": "Language of names, messages and of the booking page. Default en.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ro",
                                "en",
                                "fr",
                                "it",
                                "de",
                                "es"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Results (success true)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "description": "AI search response",
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "description": "false = see messages."
                                        },
                                        "request": {
                                            "type": "object",
                                            "description": "Dates as understood, timezone, lang, currency."
                                        },
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "carTypeId": {
                                                        "type": "integer",
                                                        "description": "Car type code."
                                                    },
                                                    "carTypeName": {
                                                        "type": "string",
                                                        "description": "Name (or similar)."
                                                    },
                                                    "carTypeCategoryId": {
                                                        "type": "integer",
                                                        "description": "Category code."
                                                    },
                                                    "carTypeCategoryName": {
                                                        "type": "string",
                                                        "description": "Category."
                                                    },
                                                    "carSpecs": {
                                                        "type": "object",
                                                        "description": "passengers, doors, luggage, transmission, fuel, ac, awd, minRent, pictures."
                                                    },
                                                    "available": {
                                                        "type": "boolean",
                                                        "description": "Always true (unavailable cars are not returned)."
                                                    },
                                                    "instantConfirmation": {
                                                        "type": "boolean",
                                                        "description": "Confirmed immediately when booked."
                                                    },
                                                    "availableStatus": {
                                                        "type": "object",
                                                        "description": "{status: available|onRequest, requestNote: 1 instant confirmation | 2 on request}."
                                                    },
                                                    "chargedDays": {
                                                        "type": "integer",
                                                        "description": "Days charged."
                                                    },
                                                    "offers": {
                                                        "type": "object",
                                                        "properties": {
                                                            "standard": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "total": {
                                                                        "type": "integer",
                                                                        "description": "Final price, all included."
                                                                    },
                                                                    "perDay": {
                                                                        "type": "number",
                                                                        "description": "Average per day."
                                                                    },
                                                                    "currency": {
                                                                        "type": "string",
                                                                        "description": "EUR."
                                                                    },
                                                                    "appliedDiscount": {
                                                                        "type": "number",
                                                                        "description": "Discount amount already applied."
                                                                    },
                                                                    "appliedDiscountPercent": {
                                                                        "type": "number",
                                                                        "description": "Discount percent."
                                                                    },
                                                                    "totalBeforeDiscount": {
                                                                        "type": "integer",
                                                                        "description": "Total before discount."
                                                                    },
                                                                    "deposit": {
                                                                        "type": "number",
                                                                        "description": "Deposit at pick-up. 0 = no deposit at all."
                                                                    },
                                                                    "allowedKmPerDay": {
                                                                        "type": "integer",
                                                                        "description": "Included km per day."
                                                                    },
                                                                    "totalAllowedKm": {
                                                                        "type": "integer",
                                                                        "description": "Total km included."
                                                                    },
                                                                    "extraKmPrice": {
                                                                        "type": "number",
                                                                        "description": "Price per extra km."
                                                                    },
                                                                    "cancellationPolicy": {
                                                                        "type": "object",
                                                                        "description": "{freeCancellationUntil (null = until pick-up), stages, noShowFee}."
                                                                    },
                                                                    "advance": {
                                                                        "type": "object",
                                                                        "description": "{amount} asked after confirmation, or null.",
                                                                        "nullable": true
                                                                    },
                                                                    "bookingUrl": {
                                                                        "type": "string",
                                                                        "description": "Where the customer books this car and offer."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "total",
                                                                    "perDay",
                                                                    "currency",
                                                                    "appliedDiscount",
                                                                    "appliedDiscountPercent",
                                                                    "totalBeforeDiscount",
                                                                    "deposit",
                                                                    "allowedKmPerDay",
                                                                    "totalAllowedKm",
                                                                    "extraKmPrice",
                                                                    "cancellationPolicy",
                                                                    "bookingUrl"
                                                                ],
                                                                "description": "With damage deposit."
                                                            },
                                                            "extraProtection": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "total": {
                                                                        "type": "integer",
                                                                        "description": "Final price, all included."
                                                                    },
                                                                    "perDay": {
                                                                        "type": "number",
                                                                        "description": "Average per day."
                                                                    },
                                                                    "currency": {
                                                                        "type": "string",
                                                                        "description": "EUR."
                                                                    },
                                                                    "appliedDiscount": {
                                                                        "type": "number",
                                                                        "description": "Discount amount already applied."
                                                                    },
                                                                    "appliedDiscountPercent": {
                                                                        "type": "number",
                                                                        "description": "Discount percent."
                                                                    },
                                                                    "totalBeforeDiscount": {
                                                                        "type": "integer",
                                                                        "description": "Total before discount."
                                                                    },
                                                                    "deposit": {
                                                                        "type": "number",
                                                                        "description": "Deposit at pick-up. 0 = no deposit at all."
                                                                    },
                                                                    "allowedKmPerDay": {
                                                                        "type": "integer",
                                                                        "description": "Included km per day."
                                                                    },
                                                                    "totalAllowedKm": {
                                                                        "type": "integer",
                                                                        "description": "Total km included."
                                                                    },
                                                                    "extraKmPrice": {
                                                                        "type": "number",
                                                                        "description": "Price per extra km."
                                                                    },
                                                                    "cancellationPolicy": {
                                                                        "type": "object",
                                                                        "description": "{freeCancellationUntil (null = until pick-up), stages, noShowFee}."
                                                                    },
                                                                    "advance": {
                                                                        "type": "object",
                                                                        "description": "{amount} asked after confirmation, or null.",
                                                                        "nullable": true
                                                                    },
                                                                    "bookingUrl": {
                                                                        "type": "string",
                                                                        "description": "Where the customer books this car and offer."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "total",
                                                                    "perDay",
                                                                    "currency",
                                                                    "appliedDiscount",
                                                                    "appliedDiscountPercent",
                                                                    "totalBeforeDiscount",
                                                                    "deposit",
                                                                    "allowedKmPerDay",
                                                                    "totalAllowedKm",
                                                                    "extraKmPrice",
                                                                    "cancellationPolicy",
                                                                    "bookingUrl"
                                                                ],
                                                                "description": "Without damage deposit (SCDW), or null when the car has no such option. Same fields as standard.",
                                                                "nullable": true
                                                            }
                                                        },
                                                        "required": [
                                                            "standard"
                                                        ],
                                                        "description": "The two offers: read item.offers.standard.total, never item.offers.total."
                                                    }
                                                },
                                                "required": [
                                                    "carTypeId",
                                                    "carTypeName",
                                                    "carTypeCategoryId",
                                                    "carTypeCategoryName",
                                                    "carSpecs",
                                                    "available",
                                                    "instantConfirmation",
                                                    "availableStatus",
                                                    "chargedDays",
                                                    "offers"
                                                ]
                                            },
                                            "description": "Cars that can be rented for the dates."
                                        },
                                        "itemsNo": {
                                            "type": "integer",
                                            "description": "Number of items."
                                        },
                                        "daysNo": {
                                            "type": "integer",
                                            "description": "Rental days."
                                        },
                                        "facets": {
                                            "type": "object",
                                            "description": "Counts per category, transmission, fuel, seats, luggage, availability."
                                        },
                                        "messages": {
                                            "type": "array",
                                            "description": "[{code, level, field?, text}]."
                                        }
                                    },
                                    "required": [
                                        "success",
                                        "request",
                                        "items",
                                        "itemsNo",
                                        "daysNo",
                                        "facets",
                                        "messages"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing or invalid parameters: success false, see messages",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "description": "false = see messages."
                                        },
                                        "messages": {
                                            "type": "array",
                                            "description": "[{code, level, field?, text}]."
                                        }
                                    },
                                    "required": [
                                        "success",
                                        "messages"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}