{
 "openapi": "3.1.0",
 "info": {
  "title": "Cartome car availability (Georgia)",
  "version": "1.0",
  "description": "Live, read-only availability and prices of Cartome rental cars in Batumi, Kutaisi and Tbilisi (Georgia) for given dates. Use it to recommend a specific car and give the user a booking link with the dates pre-filled. No authentication."
 },
 "servers": [
  {
   "url": "https://cartome.ge"
  }
 ],
 "paths": {
  "/api/v1/info": {
   "get": {
    "operationId": "getRentalInfo",
    "summary": "Rental conditions, FAQ, fees, contacts",
    "parameters": [
     {
      "name": "topic",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "quick_facts",
        "company",
        "policies",
        "faq",
        "faq_ru",
        "included",
        "addons",
        "fleet",
        "routes",
        "cities",
        "blog",
        "contact",
        "short_answers",
        "how_to_answer",
        "all"
       ]
      }
     },
     {
      "name": "format",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "json",
        "text"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Markdown text of the topic"
     }
    }
   }
  },
  "/api/v1/search": {
   "get": {
    "operationId": "searchGeorgiaGuide",
    "summary": "Search driving & travel guides for Georgia",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "format",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "json",
        "text"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Matching guide excerpts"
     }
    }
   }
  },
  "/api/v1/cars": {
   "get": {
    "operationId": "listCars",
    "summary": "All cars with prices and booked dates (90 days)",
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "json",
        "text"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Fleet snapshot, refreshed every 30 minutes"
     }
    }
   }
  },
  "/api/v1/book": {
   "post": {
    "operationId": "createBooking",
    "summary": "Book a car (only after the user explicitly confirmed car, dates, price and terms)",
    "description": "Create a real, confirmed car booking at Cartome (Georgia). ONLY call after the user has explicitly confirmed the car, dates, pickup/return point, the total price and agreed to the rental terms and personal data processing (https://cartome.ge/en/privacy). car_id must come from get_available_cars for the same dates. Creates a real reservation that blocks the car; repeated identical calls do not create duplicates. For hotel delivery the manager agrees the exact address with the client by WhatsApp. No prepayment: the user pays at pickup. Returns booking number, voucher link and a link to upload passport and driving licence.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "car_id": {
          "type": "integer",
          "description": "id from get_available_cars"
         },
         "from": {
          "type": "string",
          "description": "Pickup date YYYY-MM-DD"
         },
         "to": {
          "type": "string",
          "description": "Return date YYYY-MM-DD"
         },
         "t1": {
          "type": "integer",
          "description": "Pickup hour 0-23 (default 12)"
         },
         "t2": {
          "type": "integer",
          "description": "Return hour 0-23 (default = t1)"
         },
         "pickup": {
          "type": "string",
          "description": "Pickup point code (see get_available_cars)"
         },
         "return": {
          "type": "string",
          "description": "Return point code, if different"
         },
         "name": {
          "type": "string",
          "description": "Full name of the main driver (Latin, as in passport)"
         },
         "birthday": {
          "type": "string",
          "description": "Driver's date of birth YYYY-MM-DD (21+)"
         },
         "phone": {
          "type": "string",
          "description": "Phone with country code, WhatsApp preferred"
         },
         "email": {
          "type": "string",
          "description": "E-mail for the voucher"
         },
         "flight": {
          "type": "string",
          "description": "Flight number (optional)"
         },
         "lang": {
          "type": "string",
          "description": "Language for voucher/e-mail: ru, en, tr, ar, he, ko, zh, ka"
         },
         "user_confirmed": {
          "type": "boolean",
          "description": "true only if the user explicitly confirmed this booking and terms"
         }
        },
        "required": [
         "car_id",
         "from",
         "to",
         "name",
         "birthday",
         "phone",
         "email",
         "user_confirmed"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Booking created: number, voucher_url, documents_upload_url"
     },
     "400": {
      "description": "Not created (reason, alternatives)"
     }
    }
   }
  },
  "/api/v1/availability": {
   "get": {
    "operationId": "getAvailableCars",
    "summary": "Available cars with total price for the dates",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "Pickup date YYYY-MM-DD"
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "Return date YYYY-MM-DD"
     },
     {
      "name": "pickup",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "batumi-airport",
        "batumi-delivery",
        "batumi-office",
        "kutaisi-airport",
        "kutaisi-city",
        "tbilisi-airport",
        "tbilisi-city",
        "batumi",
        "kutaisi",
        "tbilisi"
       ]
      },
      "description": "Pickup point or city (default batumi-airport)"
     },
     {
      "name": "return",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "batumi-airport",
        "batumi-delivery",
        "batumi-office",
        "kutaisi-airport",
        "kutaisi-city",
        "tbilisi-airport",
        "tbilisi-city",
        "batumi",
        "kutaisi",
        "tbilisi"
       ]
      },
      "description": "Return point (default = pickup); another city = one-way"
     },
     {
      "name": "t1",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "maximum": 23
      },
      "description": "Pickup hour (default 12)"
     },
     {
      "name": "t2",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "maximum": 23
      },
      "description": "Return hour (default = t1)"
     },
     {
      "name": "seats",
      "in": "query",
      "schema": {
       "type": "integer"
      },
      "description": "Minimum seats (e.g. 7)"
     },
     {
      "name": "awd",
      "in": "query",
      "schema": {
       "type": "boolean"
      },
      "description": "Only all-wheel drive"
     },
     {
      "name": "max_day",
      "in": "query",
      "schema": {
       "type": "number"
      },
      "description": "Max price per day, USD"
     },
     {
      "name": "lang",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "ru",
        "en",
        "tr",
        "ar",
        "he",
        "ko",
        "zh",
        "ka"
       ]
      },
      "description": "Language of the returned page/booking links (default en)"
     },
     {
      "name": "format",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "json",
        "text"
       ]
      },
      "description": "json (default) or text"
     }
    ],
    "responses": {
     "200": {
      "description": "Available cars sorted by estimated total"
     }
    }
   }
  }
 }
}