Skip to main content
This guide walks you through everything you need to make your first successful API call.

Prerequisites Checklist

Before you can call any endpoint, you need the following:
  • A Partner Account provisioned by the CleanLife integration team
  • An API Key issued for your partner account
  • At least one allowed webhook domain registered (required before creating webhook subscriptions)
  • The correct permissions granted to your API Key for the operations you intend to perform
Contact the CleanLife partner integration team to obtain these.

Step 1 — Obtain Your API Key

API Keys are provisioned by the CleanLife platform and are tied directly to your partner account. You cannot self-register through the API. Once provisioned, you will receive:
  • An opaque API key string
  • A list of permissions granted to the key
  • An optional rate limit (requests per minute)
Security: Treat your API Key like a password. Never embed it in client-side code (browser JavaScript, mobile apps). Always call the Partner API from your backend servers.

Step 2 — Set Required Headers

Every request to the Partner API requires the following header:
HeaderRequiredDescription
x-api-keyYesYour partner API key
Content-TypeYes (for POST/PATCH)Must be application/json
x-request-idNoYour own idempotent request identifier; echoed back in X-Request-Id response header for tracing

Example

GET /v1/partners/services HTTP/1.1
Host: apiv3.thecleanlife.dev
x-api-key: pk_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

Step 3 — Make Your First Call

The simplest call to verify your credentials is listing available services:
curl -X GET "https://apiv3.thecleanlife.dev/v1/partners/services" \
  -H "x-api-key: pk_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
A successful response looks like:
{
  "success": true,
  "data": [...],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 45,
    "totalPages": 3
  }
}
If your API key is invalid or missing, you will receive:
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "...",
    "requestId": "a1b2c3d4-..."
  }
}

Step 4 — Understand Your Payment Responsibility

Every partner account has a paymentResponsibility configuration, which determines how payments for bookings are handled:
ValueMeaning
CLEANOSCleanLife handles all payment collection from the end customer. The partner only creates bookings; CleanLife sends a payment link to the customer.
PARTNERThe partner is responsible for collecting payment from their customers. CleanLife accepts the booking and expects the partner to call Confirm Payment after charging their customer.
This affects which endpoints are available to you and how the booking workflow behaves. Know your paymentResponsibility before integrating.
If you plan to receive webhook notifications, you must:
  1. Have at least one allowed webhook domain registered with your partner account (done by the CleanLife team)
  2. Create a webhook subscription via POST /partners/webhooks/subscriptions
See the Webhooks guide for complete instructions.

Environments

EnvironmentBase URLWhen to Use
Sandboxhttps://apiv3.thecleanlife.dev/v1Development and integration testing
Productionhttps://api.cleanlife.sa/v1Live traffic after go-live approval
Start all integration work against the Sandbox environment. Your sandbox API key is separate from your production key — contact the CleanLife integration team to obtain both.
Example endpoint paths:
# Sandbox
GET https://apiv3.thecleanlife.dev/v1/partners/services

# Production
GET https://api.cleanlife.sa/v1/partners/services

Quick Reference

ResourceEndpoint
Find or Create ContactPOST /partners/contacts
Get Contact by IDGET /partners/contacts/:contactId
List ServicesGET /partners/services
Get Service DetailsGET /partners/services/:serviceId
Get Available TimeslotsGET /partners/timeslots/available
Get Pricing TiersGET /partners/pricing/tiers
Calculate PricePOST /partners/pricing/calculate-price
Create BookingPOST /partners/bookings
List BookingsGET /partners/bookings
Get Booking StatusGET /partners/bookings/:bookingId/status
Update BookingPATCH /partners/bookings/:bookingId
Cancel BookingPATCH /partners/bookings/:bookingId/cancel
Confirm PaymentPOST /partners/bookings/:bookingId/confirm-payment
Create Webhook SubscriptionPOST /partners/webhooks/subscriptions
List Webhook SubscriptionsGET /partners/webhooks/subscriptions
Update Webhook SubscriptionPATCH /partners/webhooks/subscriptions/:id
Delete Webhook SubscriptionDELETE /partners/webhooks/subscriptions/:id
Rotate Webhook SecretPOST /partners/webhooks/subscriptions/:id/rotate-secret
List Webhook DeliveriesGET /partners/webhooks/deliveries
Retry Webhook DeliveryPOST /partners/webhooks/deliveries/:id/retry