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

Créer un client

Cet endpoint permet de créer un client avec ses informations personnelles et son adresse.

POST https://api.digitalpaye.com/v1/customers/create

Headers

Name
Value

X-Environment

Production

Content-Type

application/json

Authorization

Bearer <AccessToken>

Body Json

Name
Required
Description
Type

firstName

true

Prénom du client

String

lastName

true

Nom du client

String

email

true

Email du client

String

phoneNumber

true

Téléphone du client

String

Address

true

Adresse du client

Object

Response

{
    "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"
    }
}
{
    "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/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;
<?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();
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();
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);
});
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);
}
PrécédentCustomersSuivantFetch data customer

Dernière mise à jour il y a 1 mois

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