Digitalpaye API
Digitalpaye API
  • Welcome 🥳
  • Introduction
  • API Références
    • v1
      • Créer un Token
      • Balance
      • Customers
        • Créer un client
        • Fetch data customer
        • Fetch all customers
      • Collecte
        • MTN Mobile Money
        • Moov Mobile Money
        • Orange Mobile Money
        • Wave Money
      • Disbursment (Transfert)
        • MTN Mobile Money
        • Moov Mobile Money
        • Orange Mobile Money
        • Wave Money
      • Get status transaction
      • Get all transactions
  • Change log
    • v1
  • SDK ET PLUGINS
    • SDK PHP
    • Flutter
  • Webhook
Propulsé par GitBook
Sur cette page

Cet article vous a-t-il été utile ?

  1. API Références
  2. v1
  3. Customers

Fetch data customer

Cet endpoint permet de récupérer les informations d'un client.

GET https://api.digitalpaye.com/v1/customers/fetch-data/:{id}

Headers

Name
Value

X-Environment

Production

Content-Type

application/json

Authorization

Bearer <AccessToken>

Params

Name
Required
Description
Type

id

true

ID customer

String

Response

{
    "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"
    }
}
{
    "statusCode": 401,
    "message": "UnauthorizedError",
    "reason": "Token d'accès invalide. Veuillez vous reconnecter."
}
{
    "statusCode": 500,
    "message": "InternalServerError",
    "reason": "Une erreur est survenue. Veuillez réessayer"
}
<?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;
<?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();
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();
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);
});
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);
}
PrécédentCréer un clientSuivantFetch all customers

Dernière mise à jour il y a 1 mois

Cet article vous a-t-il été utile ?