# Créer un client

<mark style="color:red;">`POST`</mark> `https://api.digitalpaye.com/v1/customer`

**Headers**

| Name          | Value                      |
| ------------- | -------------------------- |
| X-Environment | `Production`               |
| Content-Type  | `application/json`         |
| Authorization | `Bearer <`**AccessToken>** |

**Body Json**

<table><thead><tr><th>Name</th><th width="225">Required</th><th>Description</th><th>Type</th></tr></thead><tbody><tr><td>firstName</td><td>true</td><td>Prénom du client</td><td>String</td></tr><tr><td>lastName</td><td>true</td><td>Nom du client</td><td>String</td></tr><tr><td>email</td><td>true</td><td>Email du client</td><td>String</td></tr><tr><td>phoneNumber</td><td>true</td><td>Téléphone du client</td><td>String</td></tr><tr><td>Address</td><td>true</td><td>Adresse du client</td><td>Object</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200: Successful" %}

```json
{
    "statusCode": 200,
    "message": "Successful",
    "data": {
        "id": "8db1ad33-50d6-4e6f-9ec3-5f9169c621a6",
        "lastName": "GUEI",
        "firstName": "HELIE",
        "email": "elieguei224@digitalpaye.com",
        "phoneNumber": "0151737309",
        "address": {
            "countryCode": "CI",
            "city": "Abidjan",
            "streetAddress": "Yopougon, Niangon"
        },
        "createdAt": "2025-03-28T06:54:41.000Z"
    }
}
```

{% endtab %}

{% tab title="401: Unauthorized" %}

```json
{
    "statusCode": 401,
    "message": "UnauthorizedError",
    "reason": "Token d'accès invalide. Veuillez vous reconnecter."
}
```

{% endtab %}

{% tab title="500:  Internal Server Error" %}

```json
{
    "statusCode": 500,
    "message": "InternalServerError",
    "reason": "Une erreur est survenue. Veuillez réessayer"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Curl" %}

```url
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.digitalpaye.com/v1/customers/create',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "lastName": "GUEI",
    "firstName": "HELIE",
    "email": "elieguei224@digitalpaye.com",
    "phoneNumber": "0151737309",
    "address": {
        "countryCode": "CI",
        "city": "Abidjan",
        "streetAddress": "Yopougon, Niangon"
    }
}',
  CURLOPT_HTTPHEADER => array(
    'X-Environment: Production',
    'Content-Type: application/json',
    'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiI4NDM3ZGQxMy04OWFjLTQ1ZTEtYTdhYS1jOGJhMDk1ZDFiMjciLCJpYXQiOjE3NDMxNDQ4NjYsImV4cCI6MTc0MzE0NTQ2Nn0.wc9Na6-dRS2xVWekiysNCthn45gUkQAn5PK3AY03UR4'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'X-Environment' => 'Production',
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiI4NDM3ZGQxMy04OWFjLTQ1ZTEtYTdhYS1jOGJhMDk1ZDFiMjciLCJpYXQiOjE3NDMxNDQ4NjYsImV4cCI6MTc0MzE0NTQ2Nn0.wc9Na6-dRS2xVWekiysNCthn45gUkQAn5PK3AY03UR4'
];
$body = '{
  "lastName": "GUEI",
  "firstName": "HELIE",
  "email": "elieguei224@digitalpaye.com",
  "phoneNumber": "0151737309",
  "address": {
    "countryCode": "CI",
    "city": "Abidjan",
    "streetAddress": "Yopougon, Niangon"
  }
}';
$request = new Request('POST', 'https://api.digitalpaye.com/v1/customers/create', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"lastName\": \"GUEI\",\n    \"firstName\": \"HELIE\",\n    \"email\": \"elieguei224@digitalpaye.com\",\n    \"phoneNumber\": \"0151737309\",\n    \"address\": {\n        \"countryCode\": \"CI\",\n        \"city\": \"Abidjan\",\n        \"streetAddress\": \"Yopougon, Niangon\"\n    }\n}");
Request request = new Request.Builder()
  .url("https://api.digitalpaye.com/v1/customers/create")
  .method("POST", body)
  .addHeader("X-Environment", "Production")
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiI4NDM3ZGQxMy04OWFjLTQ1ZTEtYTdhYS1jOGJhMDk1ZDFiMjciLCJpYXQiOjE3NDMxNDQ4NjYsImV4cCI6MTc0MzE0NTQ2Nn0.wc9Na6-dRS2xVWekiysNCthn45gUkQAn5PK3AY03UR4")
  .build();
Response response = client.newCall(request).execute();
```

{% endtab %}

{% tab title="Node JS" %}

```javascript
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.digitalpaye.com/v1/customers/create',
  'headers': {
    'X-Environment': 'Production',
    'Content-Type': 'application/json',
    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiI4NDM3ZGQxMy04OWFjLTQ1ZTEtYTdhYS1jOGJhMDk1ZDFiMjciLCJpYXQiOjE3NDMxNDQ4NjYsImV4cCI6MTc0MzE0NTQ2Nn0.wc9Na6-dRS2xVWekiysNCthn45gUkQAn5PK3AY03UR4'
  },
  body: JSON.stringify({
    "lastName": "GUEI",
    "firstName": "HELIE",
    "email": "elieguei224@digitalpaye.com",
    "phoneNumber": "0151737309",
    "address": {
      "countryCode": "CI",
      "city": "Abidjan",
      "streetAddress": "Yopougon, Niangon"
    }
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

{% endtab %}

{% tab title="Dart" %}

```dart
var headers = {
  'X-Environment': 'Production',
  'Content-Type': 'application/json',
  'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiI4NDM3ZGQxMy04OWFjLTQ1ZTEtYTdhYS1jOGJhMDk1ZDFiMjciLCJpYXQiOjE3NDMxNDQ4NjYsImV4cCI6MTc0MzE0NTQ2Nn0.wc9Na6-dRS2xVWekiysNCthn45gUkQAn5PK3AY03UR4'
};
var request = http.Request('POST', Uri.parse('https://api.digitalpaye.com/v1/customers/create'));
request.body = json.encode({
  "lastName": "GUEI",
  "firstName": "HELIE",
  "email": "elieguei224@digitalpaye.com",
  "phoneNumber": "0151737309",
  "address": {
    "countryCode": "CI",
    "city": "Abidjan",
    "streetAddress": "Yopougon, Niangon"
  }
});
request.headers.addAll(headers);

http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
  print(await response.stream.bytesToString());
}
else {
  print(response.reasonPhrase);
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalpaye.com/api-references/v1/customers/creer-un-client.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
