Récupérer un paiement
curl --request GET \
--url https://api.example.com/v1/payments/{id}import requests
url = "https://api.example.com/v1/payments/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/payments/{id}', 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/{id}",
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/{id}"
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/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payments/{id}")
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
Récupérer un paiement
Récupérer les détails d’un paiement
GET
/
v1
/
payments
/
{id}
Récupérer un paiement
curl --request GET \
--url https://api.example.com/v1/payments/{id}import requests
url = "https://api.example.com/v1/payments/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/payments/{id}', 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/{id}",
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/{id}"
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/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payments/{id}")
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_bodyRécupérer un paiement
Récupère les détails d’un paiement existant.Endpoint
GET /v1/payments/{id}
Paramètres
| Paramètre | Type | Description |
|---|---|---|
id | string | ID du paiement (txn_xxx) |
Exemple
curl https://api.sahelpay.ml/v1/payments/txn_abc123 \
-H "Authorization: Bearer sk_test_xxx"
Réponse
{
"success": true,
"data": {
"id": "txn_abc123def456",
"status": "SUCCESS",
"amount": 5000,
"currency": "XOF",
"provider": "ORANGE_MONEY",
"provider_ref": "OM123456789",
"customer_phone": "+22370123456",
"client_reference": "order_123",
"metadata": {
"order_id": "order_123"
},
"created_at": "2025-12-18T16:45:00.000Z",
"updated_at": "2025-12-18T16:50:00.000Z"
}
}
Statuts
| Statut | Description |
|---|---|
PENDING | En attente de paiement |
SUCCESS | Paiement confirmé |
FAILED | Paiement échoué |
EXPIRED | Délai expiré |
CANCELLED | Annulé par le client |
⌘I