> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thecleanlife.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# CleanLife Partner API

> Complete developer portal for CleanLife Partner API integrations.

Welcome to the **CleanLife Partner API** — the integration layer that lets authorized third-party platforms embed CleanLife home services directly into their products.

<CardGroup cols={2}>
  <Card title="Getting Started" icon="rocket" href="getting-started">
    Set up your API key and make your first call in minutes.
  </Card>

  <Card title="Authentication" icon="lock" href="authentication">
    API key auth, permissions model, and security best practices.
  </Card>

  <Card title="Find or Create Contact" icon="user-plus" href="endpoints/contacts/find-or-create-contact">
    Create a contact and optional service address before booking.
  </Card>

  <Card title="Create a Booking" icon="plus" href="endpoints/bookings/create-booking">
    The core endpoint — create bookings on behalf of your customers.
  </Card>
</CardGroup>

***

## What You Can Do

<CardGroup cols={3}>
  <Card title="Browse Catalog" icon="grid" href="endpoints/catalog/list-services">
    Query categories and services available at an address.
  </Card>

  <Card title="Manage Bookings" icon="calendar" href="endpoints/bookings/create-booking">
    Create, cancel, and track bookings end-to-end.
  </Card>

  <Card title="Handle Payments" icon="credit-card" href="endpoints/bookings/confirm-payment">
    Confirm payments for PARTNER responsibility accounts.
  </Card>

  <Card title="SDK Examples" icon="code" href="sdk-examples">
    Ready-to-use code in cURL, JS, TypeScript, Python, C#, PHP.
  </Card>
</CardGroup>

***

## Quick Start

```bash theme={null}
# 1. Register contact and address
curl -X POST "https://apiv3.thecleanlife.dev/v1/partners/contacts" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+966500000000",
    "name": "Ahmed Ali",
    "latitude": "24.7136",
    "longitude": "46.6753",
    "cityName": "Riyadh",
    "districtName": "Al Olaya",
    "streetName": "King Fahd Road"
  }'

# 2. List services available at that address
curl -X GET "https://apiv3.thecleanlife.dev/v1/partners/services?addressId=ADDR_ID&page=1&limit=50" \
  -H "x-api-key: YOUR_API_KEY"

# 3. Check available timeslots
curl -X GET "https://apiv3.thecleanlife.dev/v1/partners/timeslots/available?addressId=ADDR_ID&serviceId=SVC_ID&date=2026-06-20" \
  -H "x-api-key: YOUR_API_KEY"

# 4. Create a booking
curl -X POST "https://apiv3.thecleanlife.dev/v1/partners/bookings" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "externalReference": "ORDER-001",
    "contactId": "...",
    "addressId": "...",
    "serviceId": "...",
    "date": "2026-06-20",
    "timeslot": { "startAt": "09:00", "endAt": "12:00" }
  }'
```

***

## Environments

| Environment                       | Base URL                            |
| --------------------------------- | ----------------------------------- |
| **Sandbox** (default in examples) | `https://apiv3.thecleanlife.dev/v1` |
| **Production**                    | `https://api.cleanlife.sa/v1`       |

All partner endpoints are prefixed with `/partners`:

```text theme={null}
https://apiv3.thecleanlife.dev/v1/partners/...
```

***

## Support

<Info>
  Contact the CleanLife integration team for: API key provisioning, permission grants, rate limit increases, and technical support. Always include the `X-Request-Id` from error responses when reporting issues.
</Info>
