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_bodyPaiements
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
Retrouve un paiement à partir de votre propre référence (client_reference). Utile pour la page de retour et la réconciliation.
Query Parameters
| Paramètre | Type | Requis | Description |
|---|---|---|---|
client_reference | string | ✅ | Votre référence interne (ex : ID de commande) |
Exemple
curl "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'); // null si introuvable
payment = client.payments.search('order-123')
$payment = $sahelpay->payments->search('order-123');
Réponse
Retourne le paiement le plus récent portant cette référence.{
"success": true,
"data": {
"id": "8d6f1c2e-...",
"status": "SUCCESS",
"amount": 5000,
"amount_charged": 5000,
"currency": "XOF",
"client_reference": "order-123",
"provider_ref": "MP261003.1000.A12345",
"metadata": {
"customer": { "phone": "+22370123456" },
"description": "Commande #123"
},
"created_at": "2026-10-03T10:00:00.000Z",
"updated_at": "2026-10-03T10:05:00.000Z",
"expires_at": "2026-10-03T10:30:00.000Z"
}
}
Cas sans résultat
L’API répond200 avec success: false :
{ "success": false, "message": "PaymentIntent not found" }
"client_reference is required" si le paramètre manque).