{
  "openapi": "3.1.0",
  "info": {
    "title": "Halong Best Cruises Public API",
    "version": "1.1.0",
    "description": "Public read-only cruise catalog, instant trip quote calculator, ship comparison matrix, and consented booking inquiry API for Ha Long Bay, Lan Ha Bay and Bai Tu Long Bay cruises in Vietnam (Halong Best Cruise JSC, VNAT Licence 01-678/2019/TCDL).",
    "contact": {
      "name": "Halong Best Cruises Concierge",
      "url": "https://halongbestcruises.com/contact/",
      "email": "info@halongbestcruises.com"
    }
  },
  "servers": [
    {
      "url": "https://halongbestcruises.com",
      "description": "Production edge server"
    }
  ],
  "paths": {
    "/api/cruises": {
      "get": {
        "operationId": "searchCruises",
        "summary": "Search and filter Ha Long Bay, Lan Ha Bay and Bai Tu Long Bay cruises",
        "description": "Returns matching cruise vessels with bay routes, starting per-person-per-night rates, ratings, cabin types, and amenities.",
        "parameters": [
          { "name": "q", "in": "query", "description": "Free-text search across ship name, bay route, amenities, cabins, and overview", "schema": { "type": "string" } },
          { "name": "bay", "in": "query", "description": "Filter by bay name (Ha Long Bay, Lan Ha Bay, Bai Tu Long Bay)", "schema": { "type": "string" } },
          { "name": "tier", "in": "query", "description": "Budget tier", "schema": { "type": "string", "enum": ["budget", "mid", "luxury", "ultra"] } },
          { "name": "feature", "in": "query", "description": "Required cabin or ship feature", "schema": { "type": "string", "enum": ["jacuzzi", "balcony", "pool", "family"] } },
          { "name": "max_price", "in": "query", "description": "Maximum starting price in USD per person per night", "schema": { "type": "number" } },
          { "name": "min_price", "in": "query", "description": "Minimum starting price in USD per person per night", "schema": { "type": "number" } },
          { "name": "min_rating", "in": "query", "description": "Minimum normalized 5-star rating (0 to 5)", "schema": { "type": "number" } },
          { "name": "overnight_only", "in": "query", "description": "Set true to exclude day cruises", "schema": { "type": "boolean", "default": true } },
          { "name": "limit", "in": "query", "description": "Maximum results (1 to 30)", "schema": { "type": "integer", "default": 10, "minimum": 1, "maximum": 30 } }
        ],
        "responses": {
          "200": {
            "description": "Filtered cruise list",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    },
    "/api/quote": {
      "get": {
        "operationId": "calculateTripQuote",
        "summary": "Calculate an itemized cruise price quote and pre-filled booking URL",
        "description": "Computes an itemized price estimate for a selected ship, cabin, departure date, guest count, promo code (e.g. HALONG5), and optional Hanoi limousine transfer.",
        "parameters": [
          { "name": "slug", "in": "query", "required": true, "description": "Cruise URL slug (e.g. grand-pioneers-halong-bay-cruise-1)", "schema": { "type": "string" } },
          { "name": "cabin", "in": "query", "description": "Cabin index (0-based) or partial cabin name", "schema": { "type": "string" } },
          { "name": "date", "in": "query", "description": "Departure date in YYYY-MM-DD format", "schema": { "type": "string", "format": "date" } },
          { "name": "guests", "in": "query", "description": "Number of travelers (1-20)", "schema": { "type": "integer", "default": 2, "minimum": 1, "maximum": 20 } },
          { "name": "promo", "in": "query", "description": "Optional promo code (e.g. HALONG5 or ROMANCE2X)", "schema": { "type": "string" } },
          { "name": "transfer", "in": "query", "description": "Optional transfer add-on: none or limousine ($25 round-trip pp)", "schema": { "type": "string", "enum": ["none", "limousine"], "default": "none" } }
        ],
        "responses": {
          "200": {
            "description": "Itemized trip estimate and booking handoff URLs",
            "content": { "application/json": { "schema": { "type": "object" } } }
          },
          "404": { "description": "Cruise slug not found" }
        }
      }
    },
    "/api/compare": {
      "get": {
        "operationId": "compareCruises",
        "summary": "Compare 2 to 3 Halong Bay cruise ships side by side",
        "parameters": [
          { "name": "slugs", "in": "query", "required": true, "description": "Comma-separated cruise slugs (e.g. grand-pioneers-halong-bay-cruise-1,catherine-cruises-ha-long-bay)", "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Comparison matrix",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    },
    "/api/agent-inquiry": {
      "post": {
        "operationId": "submitCruiseInquiry",
        "summary": "Submit a consented cabin hold / advisor callback inquiry",
        "description": "Creates a no-payment cabin hold inquiry on behalf of a traveler who has explicitly requested contact and provided their name and email.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["name", "email", "consent"],
                "properties": {
                  "name": { "type": "string", "description": "Traveler full name" },
                  "email": { "type": "string", "format": "email", "description": "Traveler email address" },
                  "phone": { "type": "string", "description": "Optional phone or WhatsApp number" },
                  "cruise_slug": { "type": "string", "description": "Preferred ship slug" },
                  "cruise": { "type": "string", "description": "Preferred ship name (optional if cruise_slug is set)" },
                  "cabin": { "type": "string", "description": "Preferred cabin type" },
                  "date": { "type": "string", "format": "date", "description": "Departure date YYYY-MM-DD" },
                  "guests": { "type": "integer", "default": 2, "minimum": 1, "maximum": 20 },
                  "promo": { "type": "string" },
                  "message": { "type": "string" },
                  "agent_name": { "type": "string", "description": "Calling AI assistant or platform name for attribution" },
                  "consent": { "type": "boolean", "description": "Must be true confirming user asked to submit" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Inquiry saved with reference code HB-XXXXXX" },
          "400": { "description": "Missing required fields or consent" }
        }
      }
    }
  }
}
