{
  "openapi": "3.0.1",
  "info": {
    "title": "Stanton House API",
    "description": "Public API for Stanton House Hotel data (rooms, menus, spa, offers).",
    "version": "1.0.0",
    "license": {
    "name": "Creative Commons Attribution 4.0 (Public Data — No UGC)",
    "url": "https://creativecommons.org/licenses/by/4.0/"
  }
  },
  "x-ai-use": "This API provides verified hotel data intended for factual retrieval and guest assistance systems.",
  "x-content-policy": "Public hotel information. For guest assistance, itinerary planning, and factual QA. Not user-generated content.",
  "servers": [
    { "url": "https://stanton-house.com/wp-json/stanton-house/v1" }
  ],
  "tags": [
    { "name": "Discovery", "description": "Index and navigation" },
    { "name": "Rooms", "description": "Room inventory endpoints" },
    { "name": "Dining", "description": "Taft-Díaz menus and links" },
    { "name": "Spa", "description": "Blush Boutique & Spa" },
    { "name": "Hotel", "description": "Hotel info and guest policies" }
  ],
  "paths": {
    "/index": {
      "get": {
        "tags": ["Discovery"],
        "summary": "API index of Stanton House endpoints",
        "operationId": "getApiIndex",
        "responses": {
          "200": {
            "description": "Lists key endpoints with labels and URLs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "endpoints": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": { "type": "string" },
                          "href": { "type": "string", "format": "uri" }
                        },
                        "required": ["name", "href"]
                      }
                    }
                  },
                  "required": ["endpoints"]
                },
                "examples": {
                  "default": {
                    "summary": "Example index",
                    "value": {
                      "endpoints": [
                        { "name": "Rooms (all)", "href": "https://stanton-house.com/wp-json/stanton-house/v1/rooms" },
                        { "name": "Room Types", "href": "https://stanton-house.com/wp-json/stanton-house/v1/room-types" },
                        { "name": "Availability Link", "href": "https://stanton-house.com/wp-json/stanton-house/v1/availability" },
                        { "name": "Taft-Díaz Menus", "href": "https://stanton-house.com/wp-json/stanton-house/v1/menus/taft-diaz" },
                        { "name": "Spa", "href": "https://stanton-house.com/wp-json/stanton-house/v1/spa" },
                        { "name": "Fast Facts", "href": "https://stanton-house.com/wp-json/stanton-house/v1/fast-facts" }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },

    "/rooms": {
      "get": {
        "tags": ["Rooms"],
        "summary": "List all rooms",
        "operationId": "getRooms",
        "parameters": [
          {
            "name": "roomType",
            "in": "query",
            "description": "Filter rooms by category (Signature, Deluxe, Jr. Suites, Suites)",
            "required": false,
            "schema": { "$ref": "#/components/schemas/RoomTypeSlug" }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of rooms",
            "content": {
              "application/json": {
                "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Room" } }
              }
            }
          }
        }
      }
    },

    "/rooms/{slug}": {
      "get": {
        "tags": ["Rooms"],
        "summary": "Get a single room by slug",
        "operationId": "getRoomBySlug",
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Room details",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Room" } } }
          },
          "404": { "description": "Not found" }
        }
      }
    },

    "/room-types": {
      "get": {
        "tags": ["Rooms"],
        "summary": "List all room categories",
        "operationId": "getRoomTypes",
        "responses": {
          "200": {
            "description": "A list of room categories (taxonomy terms)",
            "content": {
              "application/json": {
                "schema": { "type": "array", "items": { "$ref": "#/components/schemas/RoomType" } }
              }
            }
          }
        }
      }
    },

    "/availability": {
      "get": {
        "tags": ["Rooms"],
        "summary": "Generate a SynXis availability link",
        "description": "Returns a deep link into SynXis Booking Engine for the specified dates and optional room category. Does not return live availability data.",
        "operationId": "getAvailabilityLink",
        "parameters": [
          {
            "name": "roomType",
            "in": "query",
            "required": false,
            "description": "Slug of the room category (see /room-types).",
            "schema": { "$ref": "#/components/schemas/RoomTypeSlug" },
            "example": "suites"
          },
          {
            "name": "checkin",
            "in": "query",
            "required": false,
            "description": "Check-in date (YYYY-MM-DD). Defaults to today.",
            "schema": { "type": "string", "format": "date" },
            "example": "2025-10-10"
          },
          {
            "name": "checkout",
            "in": "query",
            "required": false,
            "description": "Check-out date (YYYY-MM-DD). Defaults to one day after checkin.",
            "schema": { "type": "string", "format": "date" },
            "example": "2025-10-12"
          }
        ],
        "responses": {
          "200": {
            "description": "Generated SynXis availability link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "roomType": { "type": "string" },
                    "checkin": { "type": "string", "format": "date" },
                    "checkout": { "type": "string", "format": "date" },
                    "availabilityUrl": { "type": "string", "format": "uri" }
                  }
                },
                "examples": {
                  "SuiteAvailability": {
                    "summary": "Example Suites link",
                    "value": {
                      "roomType": "suites",
                      "checkin": "2025-10-10",
                      "checkout": "2025-10-12",
                      "availabilityUrl": "https://be.synxis.com/?chain=32788&hotel=47183&theme=SBE_Stanton_V1&config=SBE_Stanton_V1&arrive=2025-10-10&depart=2025-10-12&room=STE"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },

    "/menus/taft-diaz": {
      "get": {
        "tags": ["Dining"],
        "summary": "Get Taft-Díaz restaurant menus",
        "operationId": "getTaftDiazMenus",
        "responses": {
          "200": {
            "description": "List of menus for Taft-Díaz restaurant",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "restaurant": { "type": "string" },
                    "menus": { "type": "array", "items": { "$ref": "#/components/schemas/MenuItem" } }
                  },
                  "required": ["restaurant", "menus"]
                }
              }
            }
          }
        }
      }
    },

    "/spa": {
      "get": {
        "tags": ["Spa"],
        "summary": "Get information about Blush Boutique & Spa",
        "operationId": "getSpaInfo",
        "responses": {
          "200": {
            "description": "Details about Blush Boutique & Spa",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Spa" } } }
          }
        }
      }
    },

    "/fast-facts": {
      "get": {
        "tags": ["Hotel"],
        "summary": "Fast facts & policies",
        "operationId": "getFastFacts",
        "responses": {
          "200": {
            "description": "Structured guest information for the hotel",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FastFacts" } } }
          }
        }
      }
    }
  },

  "components": {
    "schemas": {
      "Room": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" },
          "availabilityUrl": { "type": "string", "format": "uri" },
          "description": { "type": "string" },
          "beds": { "type": "string" },
          "maxOccupancy": { "type": "integer" },
          "roomSize": { "type": "string" },
          "priceRange": { "type": "string" },
          "url": { "type": "string" },
          "image": { "type": "string" },
          "gallery": { "type": "array", "items": { "type": "string" } },
          "amenities": { "type": "array", "items": { "$ref": "#/components/schemas/LocationFeatureSpecification" } },
          "bookingUrl": { "type": "string" },
          "offerDescription": { "type": "string" },
          "roomType": { "$ref": "#/components/schemas/RoomType" }
        },
        "required": ["id", "name", "url"]
      },

      "RoomType": {
        "type": "object",
        "properties": {
          "slug": { "type": "string" },
          "name": { "type": "string" },
          "description": { "type": "string" },
          "count": { "type": "integer", "description": "Number of rooms in this category" }
        }
      },

      "RoomTypeSlug": {
        "type": "string",
        "description": "Slug of a room category (valid values from /room-types endpoint)",
        "example": "signature"
      },

      "MenuItem": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "url": { "type": "string" }
        },
        "required": ["name", "url"]
      },

      "Spa": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "alternateName": { "type": "string" },
          "url": { "type": "string" },
          "bookingUrl": { "type": "string" },
          "description": { "type": "string" },
          "sameAs": { "type": "array", "items": { "type": "string" } },
          "features": { "type": "array", "items": { "$ref": "#/components/schemas/Feature" } }
        },
        "required": ["name", "url"]
      },

      "Feature": {
        "type": "object",
        "properties": {
          "title": { "type": "string" },
          "description": { "type": "string" }
        },
        "required": ["title", "description"]
      },

      "LocationFeatureSpecification": {
        "type": "object",
        "properties": {
          "@type": { "type": "string" },
          "name": { "type": "string" },
          "value": { "type": "boolean" }
        },
        "required": ["name", "value"]
      },

      "FastFacts": {
        "type": "object",
        "properties": {
          "updated": { "type": "string", "format": "date" },
          "checkinCheckout": {
            "type": "object",
            "properties": {
              "checkin": { "type": "string" },
              "checkout": { "type": "string" },
              "notes": { "type": "array", "items": { "type": "string" } }
            }
          },
          "parking": {
            "type": "object",
            "properties": {
              "valet": { "type": "string" },
              "entrance": { "type": "string" },
              "evCharging": { "type": "boolean" },
              "heightRestrictions": { "type": "string" }
            }
          },
          "pets": {
            "type": "object",
            "properties": {
              "policy": { "type": "string" },
              "serviceAnimalsWelcome": { "type": "boolean" }
            }
          },
          "cancellationsDeposits": {
            "type": "object",
            "properties": {
              "cancellationWindow": { "type": "string" },
              "depositHold": { "type": "string" },
              "notes": { "type": "array", "items": { "type": "string" } }
            }
          },
          "wifi": {
            "type": "object",
            "properties": {
              "description": { "type": "string" },
              "notes": { "type": "array", "items": { "type": "string" } }
            }
          },
          "dining": {
            "type": "object",
            "properties": {
              "reservationsUrl": { "type": "string", "format": "uri" },
              "hours": { "type": "string" },
              "happyHour": { "type": "string" },
              "menus": {
                "type": "object",
                "properties": {
                  "breakfast": { "type": "string", "format": "uri" },
                  "lunch":     { "type": "string", "format": "uri" },
                  "dinner":    { "type": "string", "format": "uri" },
                  "brunch":    { "type": "string", "format": "uri" },
                  "bar":       { "type": "string", "format": "uri" }
                }
              }
            }
          },
          "spa": {
            "type": "object",
            "properties": {
              "bookingUrl": { "type": "string", "format": "uri" },
              "hours": { "type": "string" },
              "cancellationPolicy": { "type": "string" },
              "typicalLengths": { "type": "string" }
            }
          },
          "accessibility": {
            "type": "object",
            "properties": {
              "notes": { "type": "array", "items": { "type": "string" } }
            }
          },
          "contact": {
            "type": "object",
            "properties": {
              "email": { "type": "string", "format": "email" },
              "phone": { "type": "string" },
              "address": { "type": "string" }
            }
          }
        },
        "required": ["updated", "checkinCheckout", "contact"]
      }
    }
  }
}
