Vérifier l'existence d'un instrument de paiement
curl --request POST \
--url https://egimgarsud.gimpayapp.com/api/v1/check-existence \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"refContributeurEmetteur": "<string>",
"identifiantCompte": "<string>",
"numero": "<string>",
"indicatif": "225"
}
'import requests
url = "https://egimgarsud.gimpayapp.com/api/v1/check-existence"
payload = {
"refContributeurEmetteur": "<string>",
"identifiantCompte": "<string>",
"numero": "<string>",
"indicatif": "225"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
refContributeurEmetteur: '<string>',
identifiantCompte: '<string>',
numero: '<string>',
indicatif: '225'
})
};
fetch('https://egimgarsud.gimpayapp.com/api/v1/check-existence', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://egimgarsud.gimpayapp.com/api/v1/check-existence",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'refContributeurEmetteur' => '<string>',
'identifiantCompte' => '<string>',
'numero' => '<string>',
'indicatif' => '225'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://egimgarsud.gimpayapp.com/api/v1/check-existence"
payload := strings.NewReader("{\n \"refContributeurEmetteur\": \"<string>\",\n \"identifiantCompte\": \"<string>\",\n \"numero\": \"<string>\",\n \"indicatif\": \"225\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://egimgarsud.gimpayapp.com/api/v1/check-existence")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"refContributeurEmetteur\": \"<string>\",\n \"identifiantCompte\": \"<string>\",\n \"numero\": \"<string>\",\n \"indicatif\": \"225\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://egimgarsud.gimpayapp.com/api/v1/check-existence")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"refContributeurEmetteur\": \"<string>\",\n \"identifiantCompte\": \"<string>\",\n \"numero\": \"<string>\",\n \"indicatif\": \"225\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"body": true
}{
"message": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"body": null
}{
"message": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"body": null
}{
"message": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"body": null
}Vérification d'existence
Vérifier l'existence d'un instrument de paiement
Déterminer si un instrument de paiement est déjà enrôlé dans GIMpay, et déclencher l’envoi d’un OTP si ce n’est pas le cas.
POST
/
api
/
v1
/
check-existence
Vérifier l'existence d'un instrument de paiement
curl --request POST \
--url https://egimgarsud.gimpayapp.com/api/v1/check-existence \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"refContributeurEmetteur": "<string>",
"identifiantCompte": "<string>",
"numero": "<string>",
"indicatif": "225"
}
'import requests
url = "https://egimgarsud.gimpayapp.com/api/v1/check-existence"
payload = {
"refContributeurEmetteur": "<string>",
"identifiantCompte": "<string>",
"numero": "<string>",
"indicatif": "225"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
refContributeurEmetteur: '<string>',
identifiantCompte: '<string>',
numero: '<string>',
indicatif: '225'
})
};
fetch('https://egimgarsud.gimpayapp.com/api/v1/check-existence', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://egimgarsud.gimpayapp.com/api/v1/check-existence",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'refContributeurEmetteur' => '<string>',
'identifiantCompte' => '<string>',
'numero' => '<string>',
'indicatif' => '225'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://egimgarsud.gimpayapp.com/api/v1/check-existence"
payload := strings.NewReader("{\n \"refContributeurEmetteur\": \"<string>\",\n \"identifiantCompte\": \"<string>\",\n \"numero\": \"<string>\",\n \"indicatif\": \"225\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://egimgarsud.gimpayapp.com/api/v1/check-existence")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"refContributeurEmetteur\": \"<string>\",\n \"identifiantCompte\": \"<string>\",\n \"numero\": \"<string>\",\n \"indicatif\": \"225\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://egimgarsud.gimpayapp.com/api/v1/check-existence")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"refContributeurEmetteur\": \"<string>\",\n \"identifiantCompte\": \"<string>\",\n \"numero\": \"<string>\",\n \"indicatif\": \"225\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"body": true
}{
"message": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"body": null
}{
"message": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"body": null
}{
"message": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"body": null
}C’est le point de départ de tout enrôlement. Cet appel vérifie si un instrument de paiement est déjà connu de GIMpay et, s’il ne l’est pas, déclenche l’envoi d’un OTP au numéro rattaché au compte amorçant ainsi le parcours d’enrôlement.
Interpréter la réponse
La logique de cet endpoint est inversée par rapport à ce que son nom suggère :| Réponse | Signification | Suite du parcours |
|---|---|---|
200 avec body: true | L’instrument n’existe pas encore dans GIMpay. Un OTP vient d’être envoyé au numéro rattaché. | Validez l’OTP, puis enrôlez l’usager. |
400 | L’instrument de paiement fourni existe déjà. | Inutile de l’enrôler à nouveau. |
Le
400 n’est pas ici une erreur de votre requête au sens habituel : c’est le résultat métier « instrument déjà enrôlé ». Ne le traitez pas comme une donnée malformée dans votre gestion d’erreurs, sous peine d’afficher un message trompeur à l’usager.Les quatre champs sont obligatoires
Contrairement à beaucoup d’endpoints où certains champs sont facultatifs, les quatre sont ici tous exigés :| Champ | Rôle |
|---|---|
identifiantCompte | Identifiant du compte chez le contributeur émetteur (code client, MSISDN, RIB…) |
indicatif | Indicatif international sans le symbole + |
numero | Numéro de téléphone lié au compte |
refContributeurEmetteur | Référence du contributeur détenteur de l’instrument |
Notez soigneusement
indicatif et numero : la vérification de l’OTP exigera exactement les mêmes valeurs.Réponses
Le corps utile est un booléen dansbody, à l’intérieur de l’enveloppe commune { message, status, body, timestamp }. Un 404 indique que le contributeur renseigné est introuvable — vérifiez refContributeurEmetteur via GET /contributors.
Voir la référence des codes d’erreur.
Et ensuite ?
Vérifier l'OTP
Validez le code reçu par l’usager auprès du contributeur émetteur.
Enrôler l'usager
Créez l’usager et rattachez son premier instrument de paiement.
Authorizations
Jeton émis par POST /api/v1/auth/token.
Body
application/json
La référence du contributeur émetteur de l'instrument de paiement à enrôler
MSISDN (mobile wallet), RIB (compte bancaire), code client (carte prépayée) ou 4 derniers chiffres du PAN (carte bancaire).
Numéro local du téléphone.
Indicatif international pays, sans le symbole +.
Example:
"225"