{
  "openapi": "3.1.0",
  "info": {
    "title": "AntalyaTransfers Public API",
    "version": "0.1.0",
    "summary": "Fixed-price private airport transfers in Antalya, Turkey.",
    "description": "Public read endpoints for pricing, locations, FX rates and service health. Booking and payment endpoints are not part of this description. AI assistants can also use the anonymous MCP server at https://api.antalyatransfers.co/api/mcp (Streamable HTTP; tools get_price_quote, create_transfer_request, get_request_status). MCP requests stay pending until the operator confirms them and no payment is taken.",
    "termsOfService": "https://antalyatransfers.co/en/terms",
    "contact": { "name": "AntalyaTransfers", "url": "https://antalyatransfers.co", "email": "info@antalyatransfers.co" }
  },
  "externalDocs": {
    "description": "MCP server for AI assistants: endpoint, tools, privacy and setup for ChatGPT and Claude",
    "url": "https://antalyatransfers.co/en/mcp"
  },
  "x-mcp-server": {
    "url": "https://api.antalyatransfers.co/api/mcp",
    "transport": "streamable-http",
    "authentication": "none",
    "tools": ["get_price_quote", "create_transfer_request", "get_request_status"]
  },
  "servers": [{ "url": "https://api.antalyatransfers.co", "description": "Production" }],
  "paths": {
    "/api/status": {
      "get": {
        "operationId": "getStatus",
        "summary": "Service health",
        "description": "Returns service name, version and server time. Use as a liveness check.",
        "responses": {
          "200": {
            "description": "Service is up",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["service", "version", "ts"],
                  "properties": {
                    "service": { "type": "string", "example": "antalyatransfers-api" },
                    "version": { "type": "string", "example": "0.1.0" },
                    "ts": { "type": "string", "format": "date-time" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/pricing/estimate": {
      "post": {
        "operationId": "estimatePrice",
        "summary": "Estimate a transfer price",
        "description": "Returns the fixed price in euro cents for a transfer between two addresses. Prices are indicative until the operator confirms the request.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/PriceEstimateRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Estimated price",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/PriceEstimateResponse" }
              }
            }
          },
          "400": { "description": "Request body failed validation" }
        }
      }
    },
    "/api/locations/popular": {
      "get": {
        "operationId": "listPopularLocations",
        "summary": "Popular transfer destinations",
        "responses": {
          "200": {
            "description": "List of popular locations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["locations"],
                  "properties": { "locations": { "type": "array", "items": { "type": "object" } } }
                }
              }
            }
          }
        }
      }
    },
    "/api/locations/search": {
      "get": {
        "operationId": "searchLocations",
        "summary": "Search locations by address",
        "description": "Case-insensitive substring search. Queries shorter than 2 characters return an empty list.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": { "type": "string", "minLength": 0, "maxLength": 200 },
            "description": "Search text, e.g. belek"
          }
        ],
        "responses": {
          "200": {
            "description": "Matching locations (up to 10)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["locations"],
                  "properties": { "locations": { "type": "array", "items": { "type": "object" } } }
                }
              }
            }
          }
        }
      }
    },
    "/api/fx/rates": {
      "get": {
        "operationId": "getFxRates",
        "summary": "Exchange rates (EUR base)",
        "description": "ECB-based rates with a 3% margin applied. Cached for about 25 hours.",
        "responses": {
          "200": {
            "description": "Current rates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["rates", "updatedAt", "marginPct"],
                  "properties": {
                    "rates": { "type": "object", "additionalProperties": { "type": "number" }, "example": { "EUR": 1, "USD": 1.12, "GBP": 0.89 } },
                    "updatedAt": { "type": "string", "format": "date-time" },
                    "marginPct": { "type": "number", "example": 3 }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PriceEstimateRequest": {
        "type": "object",
        "required": ["pickupAddress", "dropoffAddress", "vehicleType", "scheduledAt", "passengers"],
        "properties": {
          "pickupAddress": { "type": "string", "example": "Antalya Airport (AYT)" },
          "dropoffAddress": { "type": "string", "example": "Belek, Antalya" },
          "vehicleType": { "type": "string", "enum": ["sedan", "minivan", "vip_sedan", "minibus", "bus"] },
          "scheduledAt": { "type": "string", "format": "date-time" },
          "passengers": { "type": "integer", "minimum": 1 }
        }
      },
      "PriceEstimateResponse": {
        "type": "object",
        "required": ["priceCents", "priceFormatted"],
        "properties": {
          "priceCents": { "type": "integer", "example": 4500 },
          "priceFormatted": { "type": "string", "example": "€45.00" }
        }
      }
    }
  }
}
