{
  "openapi": "3.1.0",
  "info": {
    "title": "Royal Lux Sagunto Direct Booking & Availability API",
    "version": "2.0.0",
    "description": "Official API for AI assistants and travel agents to check real-time availability (synced two-way with Booking.com), calculate stay prices with an automatic 5% direct booking discount, and create reservations at Royal Lux Sagunto (Carrer Camí Reial 109, 46500 Sagunto, Valencia, Spain)."
  },
  "servers": [
    {
      "url": "https://royallux.rent",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/calendar.php": {
      "get": {
        "operationId": "getAvailabilityOrQuote",
        "summary": "Get live availability for all suites or calculate a specific stay quote",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["availability", "quote"],
              "default": "availability"
            },
            "description": "Use 'availability' to get all suites and booked dates, or 'quote' to check a specific date range and price."
          },
          {
            "name": "room_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["room-1-kings", "room-2-queens", "room-3-monarchs", "room-4-signature"]
            },
            "description": "Required when action=quote."
          },
          {
            "name": "check_in",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Check-in date (YYYY-MM-DD)."
          },
          {
            "name": "check_out",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Check-out date (YYYY-MM-DD)."
          }
        ],
        "responses": {
          "200": {
            "description": "Availability and -5% discounted pricing data"
          }
        }
      },
      "post": {
        "operationId": "callMcpTool",
        "summary": "Execute a WebMCP tool (check_room_availability, calculate_stay_quote, create_reservation)",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["mcp"]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "enum": ["check_room_availability", "calculate_stay_quote", "create_reservation"]
                  },
                  "arguments": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP tool execution result"
          }
        }
      }
    },
    "/mail.php": {
      "post": {
        "operationId": "createDirectReservation",
        "summary": "Create a confirmed direct reservation with 5% discount and receive payment links",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["room_id", "check_in_date", "check_out_date", "guest_name", "guest_email", "guest_phone"],
                "properties": {
                  "room_id": {
                    "type": "string",
                    "enum": ["room-1-kings", "room-2-queens", "room-3-monarchs", "room-4-signature"]
                  },
                  "check_in_date": {
                    "type": "string",
                    "format": "date",
                    "description": "YYYY-MM-DD"
                  },
                  "check_out_date": {
                    "type": "string",
                    "format": "date",
                    "description": "YYYY-MM-DD"
                  },
                  "guest_name": {
                    "type": "string"
                  },
                  "document_id": {
                    "type": "string"
                  },
                  "guest_email": {
                    "type": "string",
                    "format": "email"
                  },
                  "guest_phone": {
                    "type": "string"
                  },
                  "payment_method": {
                    "type": "string",
                    "enum": ["card_revolut", "bizum", "wise", "bank_transfer"],
                    "default": "card_revolut"
                  },
                  "message_details": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reservation created and synchronized with Booking.com calendar"
          }
        }
      }
    }
  }
}
