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
}DIRECT API
Transaction Status
Get the status of a 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
}Transaction Status
Retrieve the details and status of a specific transaction.Endpoint
GET /api/v1/transaction/{transactionId}
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer YOUR_API_KEY |
URL Parameters
| Parameter | Type | Description |
|---|---|---|
| transactionId | string | Unique transaction identifier |
Response
Successful Response (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"
}
}
Error Response (404)
{
"message": ["No transaction found"],
"success": false
}
Error Codes
| HTTP Code | Description |
|---|---|
| 400 | Invalid parameters |
| 401 | Invalid API key |
| 403 | API under maintenance |
| 404 | Transaction not found |
Request Example
curl -X GET https://api-m.dexchange.sn/api/v1/transaction/TID123456789 \
-H "Authorization: Bearer YOUR_API_KEY"
Notes
-
Possible Statuses
PENDING- Awaiting processingPROCESSING- Being processedSUCCESS- Transaction successfulFAILED- Transaction failedCANCELLED- Transaction cancelled
-
Security
- Only transactions linked to your API key are accessible
- Expired transactions are also returned
- History is maintained for reference
⌘I