{"openapi":"3.1.0","info":{"title":"AllotBox Schedule Backend API","version":"1.0.0"},"paths":{"/bookings/create":{"post":{"tags":["bookings"],"summary":"Create Booking","description":"Create a pending booking and a Razorpay order for the given service.\nPricing (amount + currency) is fetched from the services table.","operationId":"create_booking_bookings_create_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/bookings/verify":{"post":{"tags":["bookings"],"summary":"Verify Payment","description":"Verify Razorpay payment signature and confirm the booking.\nOn success: payment_status -> 'paid', status -> 'confirmed'.\nOn failure: payment_status -> 'failed'.","operationId":"verify_payment_bookings_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingVerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/bookings/my":{"get":{"tags":["bookings"],"summary":"Get My Bookings","description":"Return all bookings for the authenticated client.","operationId":"get_my_bookings_bookings_my_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/bookings/{booking_id}":{"get":{"tags":["bookings"],"summary":"Get Booking","description":"Return a single booking by ID (must belong to the authenticated client).","operationId":"get_booking_bookings__booking_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"booking_id","in":"path","required":true,"schema":{"type":"string","title":"Booking Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/verification/send-otp":{"post":{"tags":["verification"],"summary":"Send a WhatsApp OTP to the given phone number","description":"Generates a 6-digit OTP and sends it to `phone` via WhatsApp.\n\n- The OTP is valid for **5 minutes**.\n- Calling this endpoint again before expiry replaces the previous OTP.\n- Requires a valid Bearer token.","operationId":"send_whatsapp_otp_verification_send_otp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendOTPRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/verification/verify-otp":{"post":{"tags":["verification"],"summary":"Verify the WhatsApp OTP for the given phone number","description":"Validates the OTP that was previously sent to `phone`.\n\n- Returns `verified: true` on success and consumes the OTP (single-use).\n- Returns **400** if the OTP is wrong or expired.\n- Requires a valid Bearer token.","operationId":"verify_whatsapp_otp_verification_verify_otp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyOTPRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/appointments/{session_id}/scheduled":{"post":{"tags":["appointments"],"summary":"Appointment Scheduled","description":"Notify the client (and optionally the provider) that an appointment has\nbeen scheduled.  The authenticated user must be the service provider.","operationId":"appointment_scheduled_appointments__session_id__scheduled_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/appointments/{session_id}/scheduled_recurring":{"post":{"tags":["appointments"],"summary":"Appointment Scheduled Recurring","description":"Notify the client that a recurring series has been scheduled.\nsession_id  – first session in the series\ntotal_sessions  – query param: total number of sessions created\nrecurrence_label – query param: human-readable pattern, e.g. \"Weekly on Mon & Wed\"","operationId":"appointment_scheduled_recurring_appointments__session_id__scheduled_recurring_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"total_sessions","in":"query","required":true,"schema":{"type":"integer","title":"Total Sessions"}},{"name":"recurrence_label","in":"query","required":true,"schema":{"type":"string","title":"Recurrence Label"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/appointments/{session_id}/rescheduled":{"post":{"tags":["appointments"],"summary":"Appointment Rescheduled","description":"Notify the client that their appointment has been rescheduled.\nThe authenticated user must be the service provider.","operationId":"appointment_rescheduled_appointments__session_id__rescheduled_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/appointments/{session_id}/cancelled":{"post":{"tags":["appointments"],"summary":"Appointment Cancelled","description":"Notify the client that their appointment has been cancelled.\nThe authenticated user must be the service provider.","operationId":"appointment_cancelled_appointments__session_id__cancelled_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/collect/telegram/webhook":{"post":{"tags":["Collect","Telegram"],"summary":"Telegram Webhook","operationId":"telegram_webhook_collect_telegram_webhook_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Update"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/collect/share/image":{"post":{"tags":["Collect","Share"],"summary":"Share Target","operationId":"share_target_collect_share_image_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_share_target_collect_share_image_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/collect/share/text":{"post":{"tags":["Collect","Share"],"summary":"Share Target Text","operationId":"share_target_text_collect_share_text_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"content","in":"query","required":true,"schema":{"type":"string","title":"Content"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/collect/share/member_selection":{"post":{"tags":["Collect","Share"],"summary":"Member Selection","operationId":"member_selection_collect_share_member_selection_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"query","required":true,"schema":{"type":"string","title":"Member Id"}},{"name":"amount","in":"query","required":true,"schema":{"type":"number","title":"Amount"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Sender Info"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense/image":{"post":{"tags":["Expense"],"summary":"Share Target","operationId":"share_target_expense_image_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_share_target_expense_image_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/expense/text":{"post":{"tags":["Expense"],"summary":"Share Target Text","operationId":"share_target_text_expense_text_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"content","in":"query","required":true,"schema":{"type":"string","title":"Content"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense/receipt":{"post":{"tags":["Expense"],"summary":"Share Target Receipt","operationId":"share_target_receipt_expense_receipt_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_share_target_receipt_expense_receipt_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/expense/upload_receipt":{"post":{"tags":["Expense"],"summary":"Upload Receipt","operationId":"upload_receipt_expense_upload_receipt_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"query","required":false,"schema":{"type":"string","title":"Event Id"}},{"name":"expense_id","in":"query","required":false,"schema":{"type":"string","title":"Expense Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_receipt_expense_upload_receipt_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense/get_receipt":{"get":{"tags":["Expense"],"summary":"Get Receipt","operationId":"get_receipt_expense_get_receipt_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"query","required":true,"schema":{"type":"string","title":"Event Id"}},{"name":"expense_id","in":"query","required":true,"schema":{"type":"string","title":"Expense Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expense/delete_receipt":{"delete":{"tags":["Expense"],"summary":"Delete Receipt","operationId":"delete_receipt_expense_delete_receipt_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"query","required":true,"schema":{"type":"string","title":"Event Id"}},{"name":"expense_id","in":"query","required":true,"schema":{"type":"string","title":"Expense Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_share_target_collect_share_image_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"}},"type":"object","required":["image"],"title":"Body_share_target_collect_share_image_post"},"Body_share_target_expense_image_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"}},"type":"object","required":["image"],"title":"Body_share_target_expense_image_post"},"Body_share_target_receipt_expense_receipt_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"}},"type":"object","required":["image"],"title":"Body_share_target_receipt_expense_receipt_post"},"Body_upload_receipt_expense_upload_receipt_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"}},"type":"object","required":["image"],"title":"Body_upload_receipt_expense_upload_receipt_post"},"BookingCreateRequest":{"properties":{"service_id":{"type":"string","title":"Service Id"},"start_time":{"type":"string","format":"date-time","title":"Start Time"},"end_time":{"type":"string","format":"date-time","title":"End Time"},"client_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Note"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["service_id","start_time","end_time"],"title":"BookingCreateRequest"},"BookingVerifyRequest":{"properties":{"booking_id":{"type":"string","title":"Booking Id"},"razorpay_payment_id":{"type":"string","title":"Razorpay Payment Id"},"razorpay_order_id":{"type":"string","title":"Razorpay Order Id"},"razorpay_signature":{"type":"string","title":"Razorpay Signature"}},"type":"object","required":["booking_id","razorpay_payment_id","razorpay_order_id","razorpay_signature"],"title":"BookingVerifyRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SendOTPRequest":{"properties":{"phone":{"type":"string","title":"Phone","description":"Phone number in E.164 format without '+', e.g. '919876543210'","examples":["919876543210"]}},"type":"object","required":["phone"],"title":"SendOTPRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyOTPRequest":{"properties":{"phone":{"type":"string","title":"Phone","description":"Phone number in E.164 format without '+'","examples":["919876543210"]},"otp":{"type":"string","maxLength":6,"minLength":6,"title":"Otp","examples":["839201"]}},"type":"object","required":["phone","otp"],"title":"VerifyOTPRequest"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}