{"openapi":"3.1.0","info":{"title":"WeThinkEvents Standard API","version":"1.0.0","description":"The tenant-scoped API available to Business subscriptions. Create a named API\ntoken in WeThinkEvents, select Authorize, and enter the token without a Bearer prefix.\nAll timestamps use ISO 8601 and booking timestamps must include a timezone offset.\n"},"servers":[{"url":"https:\/\/api.wethinkevents.com","variables":[]}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Bookings"},{"name":"Customers"},{"name":"Catalogue"},{"name":"Availability"},{"name":"Reports"}],"paths":{"\/v1\/bookings":{"get":{"tags":["Bookings"],"summary":"List the latest bookings","parameters":[{"$ref":"#\/components\/parameters\/PerPage"},{"$ref":"#\/components\/parameters\/Cursor"}],"responses":{"200":{"$ref":"#\/components\/responses\/BookingCollection"},"401":{"$ref":"#\/components\/responses\/Unauthenticated"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}},"post":{"tags":["Bookings"],"summary":"Create a booking","description":"Enforces capacity, availability, booking-window, conflict, and payment rules.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BookingCreate"}}}},"responses":{"201":{"$ref":"#\/components\/responses\/BookingItem"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/v1\/bookings\/{booking}":{"parameters":[{"$ref":"#\/components\/parameters\/BookingId"}],"get":{"tags":["Bookings"],"summary":"Read a booking","responses":{"200":{"$ref":"#\/components\/responses\/BookingItem"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"patch":{"tags":["Bookings"],"summary":"Reschedule a booking","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["starts_at"],"properties":{"starts_at":{"type":"string","format":"date-time","example":"2026-11-02T10:00:00Z"},"reason":{"type":["string","null"],"maxLength":1000}}}}}},"responses":{"200":{"$ref":"#\/components\/responses\/BookingItem"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/v1\/bookings\/{booking}\/cancel":{"parameters":[{"$ref":"#\/components\/parameters\/BookingId"}],"post":{"tags":["Bookings"],"summary":"Cancel a booking","requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"reason":{"type":["string","null"]}}}}}},"responses":{"200":{"$ref":"#\/components\/responses\/BookingItem"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/v1\/bookings\/{booking}\/payments":{"parameters":[{"$ref":"#\/components\/parameters\/BookingId"}],"get":{"tags":["Bookings"],"summary":"Read payment, deposit, and refund status","responses":{"200":{"description":"Payment records","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/DataEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Payment"}}}}]}}}},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/v1\/customers":{"get":{"tags":["Customers"],"summary":"List customers","parameters":[{"$ref":"#\/components\/parameters\/PerPage"},{"$ref":"#\/components\/parameters\/Cursor"}],"responses":{"200":{"$ref":"#\/components\/responses\/CustomerCollection"}}},"post":{"tags":["Customers"],"summary":"Create a customer","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CustomerWrite"}}}},"responses":{"201":{"$ref":"#\/components\/responses\/CustomerItem"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/v1\/customers\/{customer}":{"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"integer"}}],"get":{"tags":["Customers"],"summary":"Read a customer","responses":{"200":{"$ref":"#\/components\/responses\/CustomerItem"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"put":{"tags":["Customers"],"summary":"Replace customer details","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CustomerWrite"}}}},"responses":{"200":{"$ref":"#\/components\/responses\/CustomerItem"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/v1\/services":{"get":{"tags":["Catalogue"],"summary":"List active services","responses":{"200":{"$ref":"#\/components\/responses\/ServiceCollection"}}}},"\/v1\/staff":{"get":{"tags":["Catalogue"],"summary":"List active bookable staff","responses":{"200":{"$ref":"#\/components\/responses\/StaffCollection"}}}},"\/v1\/locations":{"get":{"tags":["Catalogue"],"summary":"List active locations","responses":{"200":{"$ref":"#\/components\/responses\/LocationCollection"}}}},"\/v1\/availability":{"get":{"tags":["Availability"],"summary":"Query available appointment slots","parameters":[{"name":"service_id","in":"query","required":true,"schema":{"type":"integer"}},{"name":"location_id","in":"query","required":true,"schema":{"type":"integer"}},{"name":"staff_member_id","in":"query","required":false,"schema":{"type":"integer"}},{"name":"starts_at","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"ends_at","in":"query","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Available slots","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/AvailabilitySlot"}}}}}}},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/v1\/reports\/summary":{"get":{"tags":["Reports"],"summary":"Read a basic reporting summary","parameters":[{"name":"period","in":"query","schema":{"type":"string","enum":["this_month","last_month","this_year"],"default":"this_month"}}],"responses":{"200":{"description":"Tenant-scoped report summary","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/ReportSummary"}}}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Sanctum token"}},"parameters":{"BookingId":{"name":"booking","in":"path","required":true,"schema":{"type":"integer"}},"PerPage":{"name":"per_page","in":"query","description":"Number of records to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},"Cursor":{"name":"cursor","in":"query","description":"Opaque cursor returned by the previous response.","schema":{"type":"string"}}},"schemas":{"DataEnvelope":{"type":"object","required":["data"]},"PaginationMeta":{"type":"object","required":["per_page","next_cursor","previous_cursor"],"properties":{"per_page":{"type":"integer"},"next_cursor":{"type":["string","null"]},"previous_cursor":{"type":["string","null"]}}},"PaginationLinks":{"type":"object","required":["next","previous"],"properties":{"next":{"type":["string","null"],"format":"uri"},"previous":{"type":["string","null"],"format":"uri"}}},"Booking":{"type":"object","required":["id","uuid","customer_id","service_id","location_id","starts_at","ends_at","status","payment_status"],"properties":{"id":{"type":"integer"},"uuid":{"type":"string","format":"uuid"},"customer_id":{"type":"integer"},"service_id":{"type":"integer"},"staff_id":{"type":["integer","null"]},"location_id":{"type":"integer"},"starts_at":{"type":"string","format":"date-time"},"ends_at":{"type":"string","format":"date-time"},"status":{"type":"string"},"payment_status":{"type":"string"}}},"BookingCreate":{"type":"object","required":["service_id","location_id","starts_at","customer"],"properties":{"service_id":{"type":"integer"},"location_id":{"type":"integer"},"staff_member_id":{"type":["integer","null"]},"starts_at":{"type":"string","format":"date-time","example":"2026-11-02T10:00:00Z"},"notes":{"type":["string","null"]},"customer":{"$ref":"#\/components\/schemas\/BookingCustomer"}}},"BookingCustomer":{"type":"object","required":["name","marketing_consent"],"properties":{"name":{"type":"string","example":"Alex Morgan"},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"]},"marketing_consent":{"type":"boolean","default":false}}},"Customer":{"type":"object","required":["id","first_name","marketing_consent"],"properties":{"id":{"type":"integer"},"first_name":{"type":"string"},"last_name":{"type":["string","null"]},"email":{"type":["string","null"],"format":"email"},"phone_mobile":{"type":["string","null"]},"phone_office":{"type":["string","null"]},"marketing_consent":{"type":"boolean"}}},"CustomerWrite":{"type":"object","required":["first_name","marketing_consent"],"properties":{"first_name":{"type":"string","maxLength":255},"last_name":{"type":["string","null"],"maxLength":255},"email":{"type":["string","null"],"format":"email"},"phone_mobile":{"type":["string","null"]},"phone_office":{"type":["string","null"]},"notes":{"type":["string","null"]},"marketing_consent":{"type":"boolean"}}},"Payment":{"type":"object","required":["id","type","status","amount_minor","currency","created_at"],"properties":{"id":{"type":"integer","example":731},"type":{"type":"string","enum":["payment","deposit","refund"],"example":"deposit"},"status":{"type":"string","example":"succeeded"},"amount_minor":{"type":"integer","example":2500},"currency":{"type":"string","example":"GBP"},"created_at":{"type":["string","null"],"format":"date-time","example":"2026-11-02T09:30:00Z"}}},"Service":{"type":"object","required":["id","name","duration_minutes","price_minor"],"properties":{"id":{"type":"integer","example":42},"name":{"type":"string","example":"Initial consultation"},"duration_minutes":{"type":"integer","example":60},"price_minor":{"type":"integer","example":7500}}},"StaffMember":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":18},"name":{"type":"string","example":"Alex Morgan"}}},"Location":{"type":"object","required":["id","name","timezone"],"properties":{"id":{"type":"integer","example":7},"name":{"type":"string","example":"Central Studio"},"timezone":{"type":"string","example":"Europe\/London"}}},"ReportSummary":{"type":"object","required":["period","periodLabel","dateFrom","dateTo","totalBookings","statusBreakdown","bookingsOverTime","popularServices","paymentTotals","upcomingBookings"],"properties":{"period":{"type":"string","example":"this_month"},"periodLabel":{"type":"string","example":"This Month"},"dateFrom":{"type":"string","format":"date","example":"2026-11-01"},"dateTo":{"type":"string","format":"date","example":"2026-11-30"},"totalBookings":{"type":"integer","example":84},"statusBreakdown":{"type":"object","additionalProperties":{"type":"integer"},"example":{"confirmed":71,"cancelled":13}},"bookingsOverTime":{"type":"object","additionalProperties":{"type":"integer"},"example":{"2026-11-02":8}},"popularServices":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"bookings":{"type":"integer"}}}},"paymentTotals":{"type":"object","properties":{"payments":{"type":"integer"},"refunds":{"type":"integer"},"net":{"type":"integer"},"transactions":{"type":"integer"}}},"upcomingBookings":{"type":"array","items":{"type":"object","properties":{"customer":{"type":"string"},"service":{"type":"string"},"starts_at":{"type":"string"},"status":{"type":"string"}}}}}},"AvailabilitySlot":{"type":"object","properties":{"staff_id":{"type":"integer"},"starts_at":{"type":"string","format":"date-time"},"ends_at":{"type":"string","format":"date-time"}}},"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"responses":{"ServiceCollection":{"description":"Active tenant services","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Service"}}}}}}},"StaffCollection":{"description":"Active bookable tenant staff","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/StaffMember"}}}}}}},"LocationCollection":{"description":"Active tenant locations","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Location"}}}}}}},"BookingCollection":{"description":"Booking records","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Booking"}},"meta":{"$ref":"#\/components\/schemas\/PaginationMeta"},"links":{"$ref":"#\/components\/schemas\/PaginationLinks"}}}}}},"CustomerCollection":{"description":"Customer records","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Customer"}},"meta":{"$ref":"#\/components\/schemas\/PaginationMeta"},"links":{"$ref":"#\/components\/schemas\/PaginationLinks"}}}}}},"BookingItem":{"description":"Booking record","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/Booking"}}}}}},"CustomerItem":{"description":"Customer record","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/Customer"}}}}}},"Unauthenticated":{"description":"Invalid or missing token","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"Forbidden":{"description":"Plan or permission does not allow the operation","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"NotFound":{"description":"Record not found in this tenant","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"Conflict":{"description":"Capacity or availability conflict","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"ValidationFailed":{"description":"Invalid request or booking rule failure","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}}}}}