{"openapi":"3.1.0","info":{"title":"Toki Eder — direct booking API","version":"1.0.0","description":"Availability, quotes and booking for Toki Eder, a holiday home in Irouléguy, French Basque Country. Public API, no authentication and no captcha. The guest completes payment on the Stripe page returned by /api/book."},"servers":[{"url":"https://www.tokieder.com"}],"paths":{"/api/availability":{"get":{"operationId":"getAvailability","summary":"Unavailable nights over a period","parameters":[{"name":"from","in":"query","schema":{"type":"string","format":"date"},"description":"Start date (default: today)"},{"name":"to","in":"query","schema":{"type":"string","format":"date"},"description":"End date, exclusive (default: from + 180 days)"}],"responses":{"200":{"description":"Unavailable nights and stay rules"},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/quote":{"get":{"operationId":"getQuote","summary":"Detailed price and availability for a stay","parameters":[{"name":"checkin","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"checkout","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"adults","in":"query","required":true,"schema":{"type":"integer","minimum":1}},{"name":"children","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"linenBeds","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Number of beds to make up with linen (paid option)"},{"name":"rate","in":"query","schema":{"type":"string","enum":["flexible","nonRefundable"],"default":"flexible"},"description":"flexible: refundable per cancellation policy; nonRefundable: cheaper, no refund"}],"responses":{"200":{"description":"Quote (amounts in euro cents) with an available flag"},"422":{"description":"Stay rule not met","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/book":{"post":{"operationId":"createBooking","summary":"Holds the dates for 30 minutes and returns a Stripe payment link","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["checkin","checkout","adults","name","email","phone"],"properties":{"checkin":{"type":"string","format":"date"},"checkout":{"type":"string","format":"date"},"adults":{"type":"integer","minimum":1},"children":{"type":"integer","minimum":0},"linenBeds":{"type":"integer","minimum":0,"description":"Number of beds to make up with linen (paid option)"},"rate":{"type":"string","enum":["flexible","nonRefundable"],"default":"flexible","description":"flexible: refundable per cancellation policy; nonRefundable: cheaper, no refund"},"name":{"type":"string","description":"Guest full name"},"email":{"type":"string","format":"email"},"phone":{"type":"string","description":"Phone number in international format"},"message":{"type":"string","description":"Optional message for the owners"},"lang":{"type":"string","enum":["fr","eu","es","en"],"default":"fr","description":"Language of the payment page and emails"}}}}}},"responses":{"200":{"description":"Dates held; the guest must pay at checkout_url before expires_at","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["awaiting_payment"]},"reservation_id":{"type":"string"},"checkout_url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"},"total_cents":{"type":"integer"},"currency":{"type":"string"}}}}}},"409":{"description":"Dates unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Stay rule not met","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many pending bookings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Calendar temporarily unverifiable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}