Overview
Creates a new booking on the CleanLife platform on behalf of one of your customers. This is the core endpoint of the Partner API. The booking creation flow varies based on your partner account’spaymentResponsibility setting:
CLEANOSresponsibility: CleanLife handles payment. Depending on the service price, the booking may transition towaiting payment(CleanLife sends a payment link asynchronously) or directly toin progress(free service).PARTNERresponsibility: Your system handles payment. The booking is set toin progressimmediately, bypassing CleanLife payment processing. You are expected to confirm payment later viaPOST /partners/bookings/:bookingId/confirm-payment.
Endpoint
Authentication
Requires a valid API Key with thepartner_bookings_create permission.
Request Headers
Request Body
Field Reference
Example Request
Success Response
HTTP Status:200 OK
Response Fields
Booking Statuses
Payment Statuses
Appointment Statuses
Error Responses
Business Rules
-
externalReferenceuniqueness: If you provide anexternalReference, it must be unique across all bookings for your partner account. Duplicate values result in a409error. This is your primary tool for preventing duplicate bookings — generate a unique ID on your side before calling the API. -
serviceIdis required. Choose aserviceIdfromGET /partners/services?addressId=...for the same address. Do not sendcategoryId— the platform resolves the service category automatically. -
Partner-specific pricing. You do not send a price in the request. The booking amount is determined by the price configured for your partner account for the selected service (returned in
GET /partners/services). A catalog price of0means deferred payment — the booking is created and confirmed immediately (success) with no upfront payment. -
contactIdis required. Obtain it fromPOST /partners/contactsbefore creating a booking. -
Timeslot interpretation. All timeslot times (
startAt,endAt) are interpreted as Asia/Riyadh local time (UTC+3). -
Payment flow — CLEANOS responsibility:
- If the booking total is zero (free service), it goes directly to
in progress. - If the booking requires payment, CleanLife sends a payment link asynchronously. The booking enters
waiting payment. PollGET /partners/bookings/:bookingId/statusto track payment outcome.
- If the booking total is zero (free service), it goes directly to
-
Payment flow — PARTNER responsibility:
- The booking is immediately set to
in progress. - You must call
POST /partners/bookings/:bookingId/confirm-paymentonce you collect payment from your customer.
- The booking is immediately set to
-
Failed reference save. In the rare event that a booking is created but the partner reference cannot be saved, the booking is marked as
FAILEDso you can safely retry with the sameexternalReference.
Notes
- The
appointmentIdmay benullimmediately after creation in some scheduling flows. PollGET /partners/bookings/:bookingId/statusuntil an appointment is assigned. - The
trackingReferenceis the value you should display to your customers for tracking purposes. - Do not rely on the
appointmentobject being present at creation time.
Integration Tips
- Always use
externalReferenceto tie CleanLife bookings back to your internal orders. Without it, deduplication on retry is much harder. - Call
POST /partners/contactsfirst, then pass the returnedidascontactIdandaddressIdin this request. - List bookable services with
GET /partners/services?addressId=...using the same address. Use the returnedpriceas the amount to charge your customer. - Verify available timeslots first using
GET /partners/timeslots/availablebefore creating a booking.
Common Mistakes
Related Endpoints
POST /partners/contacts— Create contact and optional address; returnsid(ascontactId) andaddressIdGET /partners/services?addressId=...— List services available at the booking addressGET /partners/bookings/:bookingId/status— Poll booking statusPATCH /partners/bookings/:bookingId/cancel— Cancel the bookingPOST /partners/bookings/:bookingId/confirm-payment— Confirm payment (PARTNER responsibility only)