{
	"openapi": "3.1.0",
	"info": {
		"title": "Kipra Rent A Car public API",
		"version": "1.0.0",
		"summary": "Live car rental availability and prices in Famagusta, North Cyprus.",
		"description": "Read only, no authentication. Prices include insurance and VAT. No deposit and no credit card are needed to book, and payment happens at the office, never online. Agents cannot create bookings: send the person to the booking page with the window prefilled, https://www.kiprarent.com/en/book/cars?pickup_at=YYYY-MM-DDTHH:mm&return_at=YYYY-MM-DDTHH:mm&lang=en (Turkish: https://www.kiprarent.com/book/cars with lang=tr). Pickup and return must fall inside the hours from /api/public/booking-hours. Money units differ by endpoint: availability returns minor units (16800 means 168.00 EUR), while prices and next-available return whole euros.",
		"contact": {
			"name": "Kipra Rent A Car",
			"email": "info@kiprarent.com",
			"url": "https://www.kiprarent.com/en/for-agents/"
		}
	},
	"externalDocs": {
		"description": "Guide for AI agents",
		"url": "https://www.kiprarent.com/en/for-agents/"
	},
	"servers": [{ "url": "https://www.kiprarent.com" }],
	"paths": {
		"/api/public/availability": {
			"get": {
				"operationId": "checkAvailability",
				"summary": "Cars available for a pickup and return window, with per-car totals",
				"parameters": [
					{
						"name": "pickup_at",
						"in": "query",
						"required": true,
						"description": "UTC ISO 8601, or YYYY-MM-DDTHH:mm read as Cyprus local time.",
						"schema": { "type": "string" },
						"example": "2026-12-01T10:00"
					},
					{
						"name": "return_at",
						"in": "query",
						"required": true,
						"description": "Same formats as pickup_at. Must be after pickup_at, at most 90 days later.",
						"schema": { "type": "string" },
						"example": "2026-12-08T10:00"
					},
					{
						"name": "fallback",
						"in": "query",
						"description": "next: when the window has no stock, answer with the soonest window that does and report it in window.",
						"schema": { "type": "string", "enum": ["none", "next"], "default": "none" }
					},
					{
						"name": "include",
						"in": "query",
						"description": "fleet: also return every listed vehicle, each tagged is_available.",
						"schema": { "type": "string", "enum": ["none", "fleet"], "default": "none" }
					}
				],
				"responses": {
					"200": {
						"description": "Available vehicles. Amounts are in minor units.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"required": ["vehicles"],
									"properties": {
										"vehicles": {
											"type": "array",
											"items": { "$ref": "#/components/schemas/AvailableVehicle" }
										}
									}
								}
							}
						}
					},
					"400": { "$ref": "#/components/responses/ValidationFailed" }
				}
			}
		},
		"/api/public/prices": {
			"get": {
				"operationId": "listPrices",
				"summary": "Current price list without dates: daily rates per category and rental length, add-ons and location fees",
				"parameters": [
					{ "$ref": "#/components/parameters/category" },
					{ "$ref": "#/components/parameters/currency" },
					{ "$ref": "#/components/parameters/language" }
				],
				"responses": {
					"200": {
						"description": "Price list in whole euros, with converted amounts when currency is given.",
						"content": { "application/json": { "schema": { "$ref": "#/components/schemas/CodedAnswer" } } }
					},
					"400": { "$ref": "#/components/responses/ValidationFailed" }
				}
			}
		},
		"/api/public/next-available": {
			"get": {
				"operationId": "nextAvailable",
				"summary": "Soonest window a car is free for a given number of days",
				"parameters": [
					{
						"name": "duration_days",
						"in": "query",
						"required": true,
						"description": "Whole days from 1 to 90.",
						"schema": { "type": "integer", "minimum": 1, "maximum": 90 }
					},
					{
						"name": "earliest_pickup_at",
						"in": "query",
						"description": "Cyprus local time, YYYY-MM-DDTHH:mm. Defaults to now. The response echoes searched_from: report it as an assumption.",
						"schema": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$" }
					},
					{ "$ref": "#/components/parameters/category" },
					{ "$ref": "#/components/parameters/currency" },
					{ "$ref": "#/components/parameters/language" }
				],
				"responses": {
					"200": {
						"description": "The window and the cars free in it, in whole euros. A rule refusal is also 200, with ok false and an error code to relay.",
						"content": { "application/json": { "schema": { "$ref": "#/components/schemas/CodedAnswer" } } }
					},
					"400": { "$ref": "#/components/responses/ValidationFailed" }
				}
			}
		},
		"/api/public/company-info": {
			"get": {
				"operationId": "companyInfo",
				"summary": "Staff-written knowledge base: contact, locations, rental terms, insurance, drivers, payment, FAQ",
				"parameters": [
					{
						"name": "topic",
						"in": "query",
						"description": "Narrows the answer to one topic, for example company, contact_hours, locations_delivery or rental_terms. Omit it for everything.",
						"schema": { "type": "string" }
					},
					{ "$ref": "#/components/parameters/language" }
				],
				"responses": {
					"200": {
						"description": "Knowledge entries.",
						"content": { "application/json": { "schema": { "$ref": "#/components/schemas/CodedAnswer" } } }
					},
					"400": { "$ref": "#/components/responses/ValidationFailed" }
				}
			}
		},
		"/api/public/booking-hours": {
			"get": {
				"operationId": "bookingHours",
				"summary": "Weekly pickup and return hours in Cyprus time. They change with the season.",
				"responses": {
					"200": {
						"description": "Weekday 0 is Sunday. Open and close are inclusive.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"required": ["timezone", "slot_minutes", "days"],
									"properties": {
										"timezone": { "type": "string" },
										"slot_minutes": { "type": "integer" },
										"days": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"weekday": { "type": "integer", "minimum": 0, "maximum": 6 },
													"closed": { "type": "boolean" },
													"open": { "type": "string" },
													"close": { "type": "string" }
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/api/public/fx-rates": {
			"get": {
				"operationId": "fxRates",
				"summary": "EUR-base exchange rates the booking engine uses, with no markup",
				"responses": {
					"200": {
						"description": "Rates per one euro.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"required": ["base", "rates"],
									"properties": {
										"base": { "type": "string" },
										"rates": { "type": "object", "additionalProperties": { "type": "number" } },
										"rate_date": { "type": "string", "format": "date-time" },
										"fetched_at": { "type": "string", "format": "date-time" }
									}
								}
							}
						}
					},
					"503": { "description": "Rates are temporarily unavailable." }
				}
			}
		}
	},
	"components": {
		"parameters": {
			"category": {
				"name": "category",
				"in": "query",
				"schema": { "type": "string", "enum": ["economy", "suv", "van", "luxury"] }
			},
			"currency": {
				"name": "currency",
				"in": "query",
				"schema": { "type": "string", "enum": ["TRY", "EUR", "GBP", "USD"] }
			},
			"language": {
				"name": "language",
				"in": "query",
				"schema": { "type": "string", "enum": ["tr", "en"], "default": "en" }
			}
		},
		"responses": {
			"ValidationFailed": {
				"description": "Malformed query, or a window outside the rules. details carries codes such as pickup_outside_hours and return_outside_hours.",
				"content": {
					"application/json": {
						"schema": {
							"type": "object",
							"required": ["error"],
							"properties": {
								"error": { "type": "string" },
								"details": { "type": "array", "items": { "type": "object" } },
								"requestId": { "type": "string" }
							}
						}
					}
				}
			}
		},
		"schemas": {
			"CodedAnswer": {
				"type": "object",
				"required": ["ok"],
				"properties": {
					"ok": { "type": "boolean" },
					"error": { "type": "string" }
				},
				"additionalProperties": true
			},
			"AvailableVehicle": {
				"type": "object",
				"properties": {
					"make": { "type": "string" },
					"model": { "type": "string" },
					"year": { "type": "integer" },
					"category": { "type": "string" },
					"days": { "type": "integer" },
					"daily_rate_eur_minor": { "type": "integer" },
					"total_eur": { "type": "integer", "description": "Minor units." },
					"total_try": { "type": "integer", "description": "Minor units." },
					"color": { "type": "string" },
					"transmission": { "type": "string" },
					"seats": { "type": "integer" },
					"has_ac": { "type": "boolean" },
					"fuel_type": { "type": "string" }
				},
				"additionalProperties": true
			}
		}
	}
}
