# Fetch data customer

<mark style="color:green;">`GET`</mark> `https://api.digitalpaye.com/v1/customer/:{`<mark style="color:red;">`id`</mark>`}`

**Headers**

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

**Params**

<table><thead><tr><th>Name</th><th width="225">Required</th><th>Description</th><th>Type</th></tr></thead><tbody><tr><td>id</td><td>true</td><td>ID customer</td><td>String</td></tr></tbody></table>

**Response**

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

```json
{
    "statusCode": 200,
    "message": "Successful",
    "data": {
        "id": "26b35534-3165-4143-8fff-ec2f70bb430c",
        "lastName": "GUEI",
        "firstName": "HELIE",
        "email": "elieguei225@gmail.com",
        "phoneNumber": "0777101308",
        "address": {
            "countryCode": "CI",
            "city": "Abidjan",
            "streetAddress": "Plateau Cocody"
        },
        "createdAt": "2024-10-11T07:07:59.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/fetch-data/26b35534-3165-4143-8fff-ec2f70bb430c',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'X-Environment: Production',
    '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',
  'Authorization' => 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiI4NDM3ZGQxMy04OWFjLTQ1ZTEtYTdhYS1jOGJhMDk1ZDFiMjciLCJpYXQiOjE3NDMxNDQ4NjYsImV4cCI6MTc0MzE0NTQ2Nn0.wc9Na6-dRS2xVWekiysNCthn45gUkQAn5PK3AY03UR4'
];
$request = new Request('GET', 'https://api.digitalpaye.com/v1/customers/fetch-data/26b35534-3165-4143-8fff-ec2f70bb430c', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("https://api.digitalpaye.com/v1/customers/fetch-data/26b35534-3165-4143-8fff-ec2f70bb430c")
  .method("GET", body)
  .addHeader("X-Environment", "Production")
  .addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiI4NDM3ZGQxMy04OWFjLTQ1ZTEtYTdhYS1jOGJhMDk1ZDFiMjciLCJpYXQiOjE3NDMxNDQ4NjYsImV4cCI6MTc0MzE0NTQ2Nn0.wc9Na6-dRS2xVWekiysNCthn45gUkQAn5PK3AY03UR4")
  .build();
Response response = client.newCall(request).execute();
```

{% endtab %}

{% tab title="Node JS" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://api.digitalpaye.com/v1/customers/fetch-data/26b35534-3165-4143-8fff-ec2f70bb430c',
  headers: { 
    'X-Environment': 'Production', 
    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiI4NDM3ZGQxMy04OWFjLTQ1ZTEtYTdhYS1jOGJhMDk1ZDFiMjciLCJpYXQiOjE3NDMxNDQ4NjYsImV4cCI6MTc0MzE0NTQ2Nn0.wc9Na6-dRS2xVWekiysNCthn45gUkQAn5PK3AY03UR4'
  }
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

{% endtab %}

{% tab title="Dart" %}

```dart
var headers = {
  'X-Environment': 'Production',
  'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiI4NDM3ZGQxMy04OWFjLTQ1ZTEtYTdhYS1jOGJhMDk1ZDFiMjciLCJpYXQiOjE3NDMxNDQ4NjYsImV4cCI6MTc0MzE0NTQ2Nn0.wc9Na6-dRS2xVWekiysNCthn45gUkQAn5PK3AY03UR4'
};
var request = http.Request('GET', Uri.parse('https://api.digitalpaye.com/v1/customers/fetch-data/26b35534-3165-4143-8fff-ec2f70bb430c'));

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/fetch-data-customer.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.
