> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/rest-api/identity-api/identity-api-reference/onboarding/civil-registry/dha/crear-cliente.md).

# Create client

Allows creating a customer before performing any consumer checks and validations during registration **DHA** of South Africa 🇿🇦.

### Endpoint

```
POST /civil-registry/dha/customers
```

### Authentication

| Type    | Location | Name          |
| ------- | -------- | ------------- |
| API Key | Header   | **x-api-key** |

### Request body

**Content-Type:** `application/json`

#### Parameters

| Parameter              | Type    | Required | Description                                                                                                                                                   |
| ---------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id_type`              | string  | **Yes**  | Identification type. Possible values: `id_number`, `passport`                                                                                                 |
| `id_number`            | string  | **Yes**  | South African identification number of **13 digits**.                                                                                                         |
| `first_name`           | string  | **Yes**  | Customer's first name as it appears on their Identity document.                                                                                               |
| `middle_name`          | string  | **Yes**  | Customer's middle name as it appears on their Identity document.                                                                                              |
| `last_name`            | string  | **Yes**  | Customer's last name as it appears on their Identity document.                                                                                                |
| `email`                | string  | **Yes**  | Customer's email address. Must be in the format `example@123.com`                                                                                             |
| `client_reference`     | string  | **Yes**  | Reference that can be used to identify and search for the customer in your system. Each customer must have a `client_reference` **unique**.                   |
| `country`              | string  | No       | Customer's nationality.                                                                                                                                       |
| `popi`                 | boolean | **Yes**  | Indicates whether the customer has given consent under the Personal Information Protection Act (POPI) to continue with data collection and additional checks. |
| `terms_and_conditions` | boolean | **Yes**  | Indicates whether the customer has accepted the Application Terms and Conditions and the checks being performed.                                              |

#### Request example

```bash
curl --location '{IDENTITY_API_BASE_URL}/civil-registry/dha/customers' \
--data-raw '{
    "id_type": "id_number",
    "id_number": "9999999999999",
    "client_reference": "clientnumber1",
    "email": "walter.w@facephi.com",
    "first_name": "Walter",
    "middle_name": "Hartwell",
    "last_name": "White",
    "popi": true,
    "terms_and_conditions": true,
    "country": null
}' \
--header 'x-api-key: {API_KEY}'
```

### Responses

#### `200` Success

#### Response example

```json
{
    "id": "16cd33d2-cf0a-66ad-8150-cb39e9b9ff27",
    "client_reference": "clientnumber1",
    "popi": null,
    "terms_and_conditions": null,
    "email": "walter.w@facephi.com",
    "id_number": "9999999999999",
    "first_name": "Walter",
    "middle_name": "Hartwell",
    "last_name": "White",
    "full_name": "Walter Hartwell White",
    "id_type": "id_number",
    "country": null,
    "initials": "WHW"
}
```

#### `400` Bad Request

```json
{
  "status": 400,
  "title": "Bad Request",
  "detail": "Invalid request.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400",
  "errors": []
}
```

#### `401` Unauthorized

```json
{
  "message": "Unauthorized"
}
```

#### `403` Forbidden

```json
{
  "Message": "User is not authorized to access this resource with an explicit deny"
}
```

#### `502` Bad Gateway

```json
{
  "status": 502,
  "title": "Bad Gateway",
  "detail": "Server got an invalid response.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502"
}
```

#### `504` Gateway Timeout

```json
{
  "message": "Endpoint request timed out"
}
```
