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

# Customers

> Register and authenticate customers in Wilow

## Link Customer

Register a new customer or retrieve an existing one (matched by mobile number). Returns a customer token for subsequent requests.

```http theme={null}
POST /external-partner/customers/link-customer
```

**Headers**

| Header            | Value                |
| ----------------- | -------------------- |
| `API-KEY`         | Your partner API key |
| `Idempotency-Key` | Unique UUID          |
| `Accept-Language` | `ar` or `en`         |

**Body** `multipart/form-data`

| Field           | Type   | Required | Notes                                    |
| --------------- | ------ | -------- | ---------------------------------------- |
| `name`          | string | ✅        | Customer's full name                     |
| `mobile`        | string | ✅        | Saudi mobile number without country code |
| `date_of_birth` | string | ✅        | Format: `YYYY-MM-DD`                     |
| `gender`        | string | ✅        | `male` or `female`                       |
| `family_status` | string | ❌        | `married`, `single`, etc.                |
| `lat`           | float  | ❌        | Customer's latitude                      |
| `long`          | float  | ❌        | Customer's longitude                     |

**Response**

```json theme={null}
{
  "success": true,
  "data": {
    "auth_token": "4055|5TJnGse60PlKk8PSmxHXz3HjgbaDAMvv5Z5mrGSF...",
    "customer_id": 961,
    "is_location_covered": true,
    "coverage_message": "Your location is covered by our service",
    "customer": {
      "id": 961,
      "name": "Ahmed Ali",
      "mobile": "501214561",
      "gender": { "code": "male", "name": "Male" },
      "language": { "code": "en", "name": "English" }
    }
  },
  "status_code": 200
}
```

<Note>
  Store the `auth_token` — it's required as `Authorization: Bearer {token}` for all customer-scoped endpoints.
</Note>

**Error — Invalid mobile (422)**

```json theme={null}
{
  "success": false,
  "message": "The given data was invalid.",
  "errors": {
    "mobile": ["The mobile format is invalid."]
  }
}
```
