{
 "openapi": "3.1.0",
 "info": {
  "title": "Sunset Spa – Sint Maarten",
  "version": "1.0.0",
  "description": "Read-only information and live availability for Sunset Spa, Simpson Bay Resort, Sint Maarten. Prices are in USD before a service charge (see /info). Bookings are made on the website booking link and confirmed by card payment there; nothing is booked or paid through this API.",
  "contact": {
   "name": "Sunset Spa",
   "email": "sunsetspasxm1@gmail.com",
   "url": "https://sxmspa.com/"
  }
 },
 "servers": [
  {
   "url": "https://sxmspa.com/api/agent"
  }
 ],
 "paths": {
  "/info": {
   "get": {
    "operationId": "getSpaInfo",
    "summary": "Spa details: address, phone, hours, time zone, policies, facilities",
    "responses": {
     "200": {
      "description": "Spa information",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "500": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          },
          "message": {
           "type": "string"
          }
         },
         "required": [
          "error",
          "message"
         ]
        }
       }
      }
     }
    }
   }
  },
  "/services": {
   "get": {
    "operationId": "listServices",
    "summary": "Every bookable treatment and add-on, with price and booking link",
    "parameters": [
     {
      "name": "category",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "massage",
        "couples",
        "facial",
        "nails",
        "waxing",
        "package",
        "body",
        "facility",
        "other",
        "add-on"
       ]
      }
     },
     {
      "name": "max_price_usd",
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "for_couples",
      "in": "query",
      "schema": {
       "type": "boolean"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Services",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "currency": {
           "type": "string"
          },
          "service_charge_percent": {
           "type": "number"
          },
          "count": {
           "type": "integer"
          },
          "services": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string",
              "format": "uuid"
             },
             "name": {
              "type": "string"
             },
             "category": {
              "type": "string",
              "enum": [
               "massage",
               "couples",
               "facial",
               "nails",
               "waxing",
               "package",
               "body",
               "facility",
               "other",
               "add-on"
              ]
             },
             "duration_minutes": {
              "type": [
               "integer",
               "null"
              ],
              "description": "Treatment time the guest receives"
             },
             "booking_minutes": {
              "type": [
               "integer",
               "null"
              ],
              "description": "Time the booking holds (can be longer, e.g. a romantic bath)"
             },
             "price_usd": {
              "type": "number",
              "description": "Before the service charge"
             },
             "for_couples": {
              "type": "boolean"
             },
             "guests": {
              "type": "integer",
              "enum": [
               1,
               2
              ]
             },
             "description": {
              "type": [
               "string",
               "null"
              ]
             },
             "includes_facilities": {
              "type": "boolean",
              "description": "Comes with time in the sauna, steam room and jacuzzi (currently no treatment or package does)"
             },
             "booking_url": {
              "type": [
               "string",
               "null"
              ],
              "format": "uri",
              "description": "Opens the website booking on this treatment"
             },
             "booking_url_fr": {
              "type": [
               "string",
               "null"
              ],
              "format": "uri"
             },
             "add_on_note": {
              "type": "string"
             }
            },
            "required": [
             "id",
             "name",
             "category",
             "price_usd"
            ]
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          },
          "message": {
           "type": "string"
          }
         },
         "required": [
          "error",
          "message"
         ]
        }
       }
      }
     }
    }
   }
  },
  "/availability": {
   "get": {
    "operationId": "checkAvailability",
    "summary": "Free start times for a service on a day or up to 7 days",
    "description": "Uses the same availability as the website booking. Times less than 30 minutes away are not offered. Up to 60 days ahead.",
    "parameters": [
     {
      "name": "service_id",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "date",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "One day (YYYY-MM-DD). Or use date_from and date_to."
     },
     {
      "name": "date_from",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "date_to",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "At most 7 days after date_from, inclusive"
     },
     {
      "name": "guests",
      "in": "query",
      "schema": {
       "type": "integer",
       "enum": [
        1,
        2
       ]
      },
      "description": "Couples treatments are always 2"
     }
    ],
    "responses": {
     "200": {
      "description": "Free times per day",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "service": {
           "type": "object"
          },
          "guests": {
           "type": "integer"
          },
          "time_zone": {
           "type": "string"
          },
          "utc_offset": {
           "type": "string"
          },
          "booking_url": {
           "type": "string",
           "format": "uri"
          },
          "days": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "date": {
              "type": "string",
              "format": "date"
             },
             "slots": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "time": {
                 "type": "string",
                 "description": "Local start time, HH:MM (America/Lower_Princes)",
                 "example": "15:00"
                },
                "start": {
                 "type": "string",
                 "format": "date-time",
                 "example": "2026-11-20T15:00:00-04:00"
                },
                "room": {
                 "type": "string",
                 "enum": [
                  "couples_suite",
                  "two_separate_rooms"
                 ],
                 "description": "Couples treatments only"
                }
               },
               "required": [
                "time",
                "start"
               ]
              }
             },
             "reason": {
              "type": "string",
              "description": "Why there are no times"
             }
            },
            "required": [
             "date",
             "slots"
            ]
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          },
          "message": {
           "type": "string"
          }
         },
         "required": [
          "error",
          "message"
         ]
        }
       }
      }
     },
     "404": {
      "description": "Unknown service",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          },
          "message": {
           "type": "string"
          }
         },
         "required": [
          "error",
          "message"
         ]
        }
       }
      }
     },
     "429": {
      "description": "Too many requests",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          },
          "message": {
           "type": "string"
          }
         },
         "required": [
          "error",
          "message"
         ]
        }
       }
      }
     }
    }
   }
  }
 }
}
