Rechercher un paiement
curl --request GET \
--url https://api.example.com/v1/payments/searchimport requests
url = "https://api.example.com/v1/payments/search"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/payments/search', 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://api.example.com/v1/payments/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payments/search"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/payments/search")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payments/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyPayments
Rechercher un paiement
Rechercher un paiement par référence client
GET
/
v1
/
payments
/
search
Rechercher un paiement
curl --request GET \
--url https://api.example.com/v1/payments/searchimport requests
url = "https://api.example.com/v1/payments/search"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/payments/search', 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://api.example.com/v1/payments/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payments/search"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/payments/search")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payments/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyRechercher un paiement
Permet de retrouver un paiement en utilisant votre propre référence (client_reference). Cet endpoint est particulièrement utile pour la réconciliation automatique.
Query Parameters
| Paramètre | Type | Requis | Description |
|---|---|---|---|
client_reference | string | ✅ | Votre référence interne (ex: ID de commande) |
Exemple
curl -X GET "https://api.sahelpay.ml/v1/payments/search?client_reference=order_123" \
-H "Authorization: Bearer sk_live_xxx"
const payment = await sahelpay.payments.search('order_123');
Réponse
Retourne le paiement le plus récent correspondant à cette référence.{
"success": true,
"data": {
"id": "txn_8f525b9f",
"client_reference": "order_123",
"status": "SUCCESS",
"amount": 5000,
"currency": "XOF",
"payment_method": "ORANGE_MONEY",
"created_at": "2025-12-19T10:00:00Z",
"updated_at": "2025-12-19T10:05:00Z"
}
}
Erreurs
| Code | Description |
|---|---|
MISSING_REFERENCE | Le paramètre client_reference est requis |
NOT_FOUND | Aucun paiement trouvé avec cette référence |
⌘I