{
  "openapi": "3.1.0",
  "info": {
    "title": "Herrero Pianos home visit availability",
    "version": "1.0.0",
    "description": "Find currently available home-service visits in Manila time and give the customer a booking link. A lookup does not reserve an appointment. A customer has booked only after the booking page shows a confirmation reference."
  },
  "servers": [{ "url": "https://herreropianos.com" }],
  "paths": {
    "/book/availability": {
      "get": {
        "operationId": "getHomeVisitAvailability",
        "summary": "Check home visit openings for one Manila date",
        "description": "Call with a date only. Show the returned UTC times in Asia/Manila. When the customer chooses a time, resolve that slot's bookingPath against the server URL and share it. The booking page rechecks the time and the customer reviews and confirms. The top-level bookingPath shows all times for the day. A successful empty list means there are no openings that day. A failed lookup cannot establish availability.",
        "parameters": [{
          "name": "day", "in": "query", "required": true,
          "description": "Manila calendar date, from today through 60 days ahead.",
          "schema": { "type": "string", "format": "date" }
        }],
        "responses": {
          "200": {
            "description": "Current openings. Each start is a possible appointment, with no fixed duration.",
            "content": { "application/json": { "schema": {
              "type": "object",
              "required": ["day", "timeZone", "durationMinutes", "availableSlots", "bookingPath"],
              "properties": {
                "day": { "type": "string", "format": "date" },
                "timeZone": { "type": "string", "const": "Asia/Manila" },
                "durationMinutes": { "type": "integer", "const": 0, "description": "No fixed duration is reserved." },
                "availableSlots": {
                  "type": "array", "items": {
                    "type": "object", "required": ["start", "end", "bookingPath"],
                    "properties": {
                      "start": { "type": "string", "format": "date-time" },
                      "end": { "type": ["string", "null"], "format": "date-time", "description": "Null for start-only appointments." },
                      "bookingPath": { "type": "string", "format": "uri-reference", "description": "Customer link to review this opening." }
                    }
                  }
                },
                "bookingPath": { "type": "string", "format": "uri-reference" }
              }
            } } }
          },
          "400": {
            "description": "Missing, repeated, invalid or out-of-window day. minDay and maxDay are the accepted dates, inclusive.",
            "content": { "application/json": { "schema": {
              "type": "object", "required": ["code", "message", "minDay", "maxDay"],
              "properties": {
                "code": { "type": "string", "const": "invalid_day" },
                "message": { "type": "string" },
                "minDay": { "type": "string", "format": "date" },
                "maxDay": { "type": "string", "format": "date" }
              }
            } } }
          },
          "503": {
            "description": "The calendar could not be read. Retry before suggesting an opening.",
            "content": { "application/json": { "schema": {
              "type": "object", "required": ["code", "message"],
              "properties": {
                "code": { "type": "string", "const": "availability_unavailable" },
                "message": { "type": "string" }
              }
            } } }
          }
        }
      }
    }
  }
}
