{"openapi":"3.1.0","info":{"title":"CTC Stays Booking API","version":"0.1.0","description":"Check availability, get a server-priced quote, place a short hold, and obtain a hosted checkout link for a human to complete payment. If the dates are not open, or the guest wants to ask instead of paying, file an inquiry with the CTC desk. That inquiry is not an OwnerRez record, not a hold, and not a price. Prices are always computed server-side. Clients must not send totals."},"servers":[{"url":"https://ctc-stays-booking-xnpfw.sevalla.app/api"}],"paths":{"/properties":{"get":{"operationId":"listProperties","summary":"List bookable properties","parameters":[{"name":"destination","in":"query","schema":{"type":"string"}},{"name":"min_guests","in":"query","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Properties","content":{"application/json":{"schema":{"type":"object","properties":{"properties":{"type":"array","items":{"$ref":"#/components/schemas/PropertySummary"}}}}}}}}}},"/properties/{property_id}":{"get":{"operationId":"getProperty","summary":"Property details","parameters":[{"$ref":"#/components/parameters/PropertyId"}],"responses":{"200":{"description":"Property","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PropertyDetail"}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/properties/{property_id}/availability":{"get":{"operationId":"checkAvailability","summary":"Availability and quote for a date range","parameters":[{"$ref":"#/components/parameters/PropertyId"},{"name":"checkin","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"checkout","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"guests","in":"query","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Availability result with quote when available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityResult"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/inquiries":{"post":{"operationId":"sendInquiry","summary":"Send a CTC desk inquiry","description":"Writes the request on ctcstays.com. Does not create an OwnerRez inquiry, hold dates, or return a price. Use when next_step is inquire, or when the guest asks instead of paying.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["checkin","checkout","guests","guest_name","guest_email"],"properties":{"property_id":{"type":"string","examples":["villa-coral"]},"villa_id":{"type":"integer","description":"WordPress listing id when property_id is not villa-coral."},"checkin":{"type":"string","format":"date"},"checkout":{"type":"string","format":"date"},"guests":{"type":"integer","minimum":1},"guest_name":{"type":"string"},"guest_email":{"type":"string","format":"email"},"message":{"type":"string"}}}}}},"responses":{"200":{"description":"Inquiry accepted by the CTC desk","content":{"application/json":{"schema":{"type":"object","properties":{"confirmation_id":{"type":"string"},"listing_url":{"type":"string","format":"uri"},"message":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/Error"}}}},"/holds":{"post":{"operationId":"createHold","summary":"Place a short tentative hold on a quoted stay","description":"Hold expires automatically. Idempotent on Idempotency-Key.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["quote_id"],"properties":{"quote_id":{"type":"string"},"guest_first_name":{"type":"string"},"guest_email":{"type":"string","format":"email"}}}}}},"responses":{"201":{"description":"Hold created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hold"}}}},"409":{"description":"Dates no longer available or quote expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/holds/{hold_id}/checkout":{"post":{"operationId":"createCheckoutLink","summary":"Create a hosted checkout link for the human guest","description":"Returns a URL the human opens to review terms and pay. No card data is ever accepted through this API.","parameters":[{"name":"hold_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Checkout link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutLink"}}}},"410":{"description":"Hold expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/bookings/{booking_id}":{"get":{"operationId":"getBookingStatus","summary":"Booking status (requires booking_token)","parameters":[{"name":"booking_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"booking_token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Status","content":{"application/json":{"schema":{"type":"object","properties":{"booking_id":{"type":"string"},"status":{"type":"string","enum":["held","awaiting_payment","confirmed","expired","cancelled"]}}}}}}}}}},"components":{"parameters":{"PropertyId":{"name":"property_id","in":"path","required":true,"schema":{"type":"string","examples":["villa-coral"]}}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"schemas":{"ErrorBody":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"PropertySummary":{"type":"object","properties":{"property_id":{"type":"string"},"name":{"type":"string"},"location":{"type":"string"},"bedrooms":{"type":"integer"},"max_guests":{"type":"integer"},"url":{"type":"string","format":"uri"}}},"PropertyDetail":{"allOf":[{"$ref":"#/components/schemas/PropertySummary"},{"type":"object","properties":{"bathrooms":{"type":"number"},"amenities":{"type":"array","items":{"type":"string"}},"house_rules_url":{"type":"string","format":"uri"},"cancellation_policy_url":{"type":"string","format":"uri"}}}]},"LineItem":{"type":"object","properties":{"label":{"type":"string"},"amount":{"type":"number"}}},"AvailabilityResult":{"type":"object","required":["property_id","available","checkin","checkout","guests","as_of"],"properties":{"property_id":{"type":"string"},"available":{"type":"boolean"},"reason":{"type":["string","null"],"description":"Why unavailable (dates_taken, min_stay, max_guests, checkin_day_rule)"},"checkin":{"type":"string","format":"date"},"checkout":{"type":"string","format":"date"},"guests":{"type":"integer"},"nights":{"type":"integer"},"currency":{"type":"string","examples":["USD"]},"quote_id":{"type":["string","null"]},"quote_expires_at":{"type":["string","null"],"format":"date-time"},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"taxes_and_fees":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"total":{"type":["number","null"]},"min_stay_nights":{"type":"integer"},"cancellation_summary":{"type":"string"},"booking_url":{"type":"string","format":"uri","description":"Checkout for these dates. Villa Coral and GPS Villa use a ctcstays.com pay link. Valhalla uses the Lodgify checkout. Do not build a pay link when this is empty."},"next_step":{"type":"string","enum":["pay","inquire"],"description":"pay when the total can be paid. inquire when the guest should contact the CTC desk."},"as_of":{"type":"string","format":"date-time"},"nearest_open_windows":{"type":"array","description":"Suggested alternatives when unavailable","items":{"type":"object","properties":{"checkin":{"type":"string","format":"date"},"checkout":{"type":"string","format":"date"}}}}}},"Hold":{"type":"object","properties":{"hold_id":{"type":"string"},"quote_id":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}}},"CheckoutLink":{"type":"object","properties":{"checkout_url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"},"total":{"type":"number"},"currency":{"type":"string"},"booking_id":{"type":"string"},"booking_token":{"type":"string"}}}}}}