Obtenir les détails d'une transaction
curl --request GET \
--url https://api-m.dexchange.sn/api/v1/transaction/{transactionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-m.dexchange.sn/api/v1/transaction/{transactionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-m.dexchange.sn/api/v1/transaction/{transactionId}', 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-m.dexchange.sn/api/v1/transaction/{transactionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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-m.dexchange.sn/api/v1/transaction/{transactionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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-m.dexchange.sn/api/v1/transaction/{transactionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-m.dexchange.sn/api/v1/transaction/{transactionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"transaction": {
"ServiceName": "<string>",
"ServiceCode": "<string>",
"Amount": 123,
"Number": "<string>",
"Status": "<string>",
"Initiated_at": "2023-11-07T05:31:56Z",
"Completed_at": "2023-11-07T05:31:56Z"
}
}{
"message": [
"<string>"
],
"success": true
}API DIRECT
Statut de Transaction
Obtenir le statut d’une transaction
GET
/
api
/
v1
/
transaction
/
{transactionId}
Obtenir les détails d'une transaction
curl --request GET \
--url https://api-m.dexchange.sn/api/v1/transaction/{transactionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-m.dexchange.sn/api/v1/transaction/{transactionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-m.dexchange.sn/api/v1/transaction/{transactionId}', 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-m.dexchange.sn/api/v1/transaction/{transactionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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-m.dexchange.sn/api/v1/transaction/{transactionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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-m.dexchange.sn/api/v1/transaction/{transactionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-m.dexchange.sn/api/v1/transaction/{transactionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"transaction": {
"ServiceName": "<string>",
"ServiceCode": "<string>",
"Amount": 123,
"Number": "<string>",
"Status": "<string>",
"Initiated_at": "2023-11-07T05:31:56Z",
"Completed_at": "2023-11-07T05:31:56Z"
}
}{
"message": [
"<string>"
],
"success": true
}Statut de Transaction
Récupérez les détails et le statut d’une transaction spécifique.Endpoint
GET /api/v1/transaction/{transactionId}
Headers
| Nom | Type | Requis | Description |
|---|---|---|---|
| Authorization | string | Oui | Bearer YOUR_API_KEY |
Paramètres URL
| Paramètre | Type | Description |
|---|---|---|
| transactionId | string | Identifiant unique de la transaction |
Réponse
Réponse Réussie (200)
{
"message": "Transaction fetched successfully",
"transaction": {
"ServiceName": "Orange Money Senegal",
"ServiceCode": "OM_SN_CASHOUT",
"OperatorApi": "OM789012345",
"Type": "CASHOUT",
"Amount": 1000,
"Number": "771234567",
"Status": "SUCCESS",
"Initiated_at": "2024-03-20T10:30:00Z",
"Completed_at": "2024-03-20T10:35:00Z"
}
}
Réponse d’Erreur (404)
{
"message": ["No transaction found"],
"success": false
}
Codes d’Erreur
| Code HTTP | Description |
|---|---|
| 400 | Paramètres invalides |
| 401 | Clé API invalide |
| 403 | API en maintenance |
| 404 | Transaction non trouvée |
Exemple de Requête
curl -X GET https://api-m.dexchange.sn/api/v1/transaction/TID123456789 \
-H "Authorization: Bearer YOUR_API_KEY"
Notes
-
Statuts Possibles
PENDING- En attentePROCESSING- En cours de traitementSUCCESS- Transaction réussieFAILED- Transaction échouéeCANCELLED- Transaction annulée
-
Sécurité
- Seules les transactions liées à votre API key sont accessibles
- Les transactions expirées sont également retournées
- L’historique est conservé pour référence