{"openapi":"3.1.0","info":{"title":"Ani.CNX public API","version":"1.0.0","description":"Dress rental in Chiang Mai, Thailand. Read the catalogue, check availability, and (only with the user's explicit confirmation) submit a booking request. Prices are THB per day; deposits are refundable."},"servers":[{"url":"https://anicnx.com"}],"paths":{"/api/dresses":{"get":{"summary":"List all dresses for rent","operationId":"browse-catalog","responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Dress"}}}}}}}},"/api/dresses/{slug}":{"get":{"summary":"Get one dress by slug","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dress"}}}},"404":{"description":"Not found"}}}},"/api/categories":{"get":{"summary":"List dress categories","responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}}}}}}},"/api/dresses/available":{"get":{"summary":"Ids of dresses free for a whole date range (includes the 1-day cleaning buffer)","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/api/availability/{dressId}":{"get":{"summary":"Booked and blocked date ranges for one dress","parameters":[{"name":"dressId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DressAvailability"}}}}}}},"/api/policy":{"get":{"summary":"Rental rules, FAQ, size chart and lowest deposit","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicPolicy"}}}}}}},"/api/shop":{"get":{"summary":"Shop contact and pickup details","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopInfo"}}}}}}},"/api/insights":{"get":{"summary":"Aggregate catalogue statistics for marketing analysis (no personal data)","responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/bookings":{"post":{"summary":"Create a booking request — REQUIRES explicit human confirmation; contains personal data","operationId":"create-booking-request","x-requires-confirmation":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingInput"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingReceipt"}}}},"400":{"description":"Validation error with per-field messages"},"409":{"description":"Dates no longer available"}}}}},"components":{"schemas":{"Category":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","slug","name"]},"Dress":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"categoryId":{"type":"string"},"color":{"type":"string"},"sizes":{"type":"array","items":{"type":"string"}},"pricePerDay":{"type":"number","description":"THB per day"},"deposit":{"type":"number","description":"Refundable deposit, THB"},"images":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}},"required":["id","slug","name","sizes","pricePerDay","deposit"]},"DressAvailability":{"type":"object","properties":{"bookings":{"type":"array","items":{"type":"object","properties":{"size":{"type":"string"},"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"}}}},"blocks":{"type":"array","items":{"type":"object"}}}},"PublicPolicy":{"type":"object","properties":{"rules":{"type":"array","items":{"type":"object"}},"faq":{"type":"array","items":{"type":"object","properties":{"q":{"type":"string"},"a":{"type":"string"}}}},"sizeChart":{"type":"array","items":{"type":"object"}},"minDeposit":{"type":["number","null"]}}},"ShopInfo":{"type":"object","properties":{"lineId":{"type":"string"},"pickupName":{"type":"string"},"pickupAddress":{"type":"string"},"shipping":{"type":"string"}}},"BookingInput":{"type":"object","properties":{"dressId":{"type":"string"},"size":{"type":"string"},"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"customerName":{"type":"string"},"phone":{"type":"string"},"lineId":{"type":"string"},"note":{"type":"string"},"pickup":{"type":"string","enum":["meet","ship"],"description":"meet = pickup in Chiang Mai, ship = parcel delivery"}},"required":["dressId","size","startDate","endDate","customerName","phone","pickup"]},"BookingReceipt":{"type":"object","properties":{"code":{"type":"string","description":"Booking code to keep for lookup"},"status":{"type":"string"},"totalPrice":{"type":"number"},"deposit":{"type":"number"}}}}}}