Skip to main content

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’s paymentResponsibility setting:
  • CLEANOS responsibility: CleanLife handles payment. Depending on the service price, the booking may transition to waiting payment (CleanLife sends a payment link asynchronously) or directly to in progress (free service).
  • PARTNER responsibility: Your system handles payment. The booking is set to in progress immediately, bypassing CleanLife payment processing. You are expected to confirm payment later via POST /partners/bookings/:bookingId/confirm-payment.

Endpoint

Authentication

Requires a valid API Key with the partner_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

  1. externalReference uniqueness: If you provide an externalReference, it must be unique across all bookings for your partner account. Duplicate values result in a 409 error. This is your primary tool for preventing duplicate bookings — generate a unique ID on your side before calling the API.
  2. serviceId is required. Choose a serviceId from GET /partners/services?addressId=... for the same address. Do not send categoryId — the platform resolves the service category automatically.
  3. 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 of 0 means deferred payment — the booking is created and confirmed immediately (success) with no upfront payment.
  4. contactId is required. Obtain it from POST /partners/contacts before creating a booking.
  5. Timeslot interpretation. All timeslot times (startAt, endAt) are interpreted as Asia/Riyadh local time (UTC+3).
  6. 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. Poll GET /partners/bookings/:bookingId/status to track payment outcome.
  7. Payment flow — PARTNER responsibility:
    • The booking is immediately set to in progress.
    • You must call POST /partners/bookings/:bookingId/confirm-payment once you collect payment from your customer.
  8. Failed reference save. In the rare event that a booking is created but the partner reference cannot be saved, the booking is marked as FAILED so you can safely retry with the same externalReference.

Notes

  • The appointmentId may be null immediately after creation in some scheduling flows. Poll GET /partners/bookings/:bookingId/status until an appointment is assigned.
  • The trackingReference is the value you should display to your customers for tracking purposes.
  • Do not rely on the appointment object being present at creation time.

Integration Tips

  • Always use externalReference to tie CleanLife bookings back to your internal orders. Without it, deduplication on retry is much harder.
  • Call POST /partners/contacts first, then pass the returned id as contactId and addressId in this request.
  • List bookable services with GET /partners/services?addressId=... using the same address. Use the returned price as the amount to charge your customer.
  • Verify available timeslots first using GET /partners/timeslots/available before creating a booking.

Common Mistakes


  • POST /partners/contacts — Create contact and optional address; returns id (as contactId) and addressId
  • GET /partners/services?addressId=... — List services available at the booking address
  • GET /partners/bookings/:bookingId/status — Poll booking status
  • PATCH /partners/bookings/:bookingId/cancel — Cancel the booking
  • POST /partners/bookings/:bookingId/confirm-payment — Confirm payment (PARTNER responsibility only)