Créer un retrait
curl --request POST \
--url https://api.example.com/v1/withdrawalsimport requests
url = "https://api.example.com/v1/withdrawals"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/withdrawals', 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/withdrawals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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/withdrawals"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/withdrawals")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/withdrawals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyWithdrawals
Créer un retrait
Demander le retrait de votre solde vers Orange Money (traitement manuel)
POST
/
v1
/
withdrawals
Créer un retrait
curl --request POST \
--url https://api.example.com/v1/withdrawalsimport requests
url = "https://api.example.com/v1/withdrawals"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/withdrawals', 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/withdrawals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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/withdrawals"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/withdrawals")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/withdrawals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyCréer un retrait
Crée une demande de retrait de votre solde disponible vers un numéro Orange Money. Les fonds sont réservés immédiatement ; le transfert est vérifié puis exécuté manuellement par SahelPay.Endpoint
POST /v1/withdrawals
Headers
| Header | Requis | Description |
|---|---|---|
Authorization | ✅ | Bearer sk_xxx |
X-Idempotency-Key | ✅ | Clé unique par demande (rejeu sûr) |
Body
| Paramètre | Type | Requis | Description |
|---|---|---|---|
amount | integer | ✅ | Montant en FCFA, entre 50 000 et 5 000 000 |
provider | string | ✅ | ORANGE_MONEY |
phone_number | string | ✅ | Numéro Orange Money destinataire (32 caractères max) |
quoted_fee | integer | Frais affichés par GET /v1/withdrawals/quote. S’ils ont changé : 409 | |
notes | string | Note libre (500 caractères max) |
Exemple
curl -X POST https://api.sahelpay.ml/v1/withdrawals \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: withdrawal-2026-10-03" \
-d '{
"amount": 100000,
"quoted_fee": 1000,
"provider": "ORANGE_MONEY",
"phone_number": "+22370123456"
}'
Réponse
{
"success": true,
"message": "Demande de retrait créée avec succès",
"data": {
"id": "0b6c0f3e-...",
"reference": "WD_1759480000000_A1B2C3D4",
"amount": 100000,
"fee": 1000,
"net_amount": 99000,
"currency": "XOF",
"status": "PENDING",
"provider": "ORANGE_MONEY",
"phone_number": "+22370123456",
"created_at": "2026-10-03T10:00:00.000Z",
"_source": "LEDGER"
}
}
Erreurs
| HTTP | Cause |
|---|---|
400 | Header X-Idempotency-Key absent, montant hors bornes, KYC non approuvé, solde insuffisant |
403 PARTNER_WITHDRAWAL_CLOSED | Partenaire SPAY : la redevance est versée chaque mois par SahelPay |
409 | Frais modifiés depuis le devis, ou clé d’idempotence déjà utilisée pour une autre demande |
Les helpers
withdrawals.create() des SDK JavaScript et Python envoient encore recipient_phone au lieu de
provider / phone_number et n’envoient pas X-Idempotency-Key : l’API les refuse. Utilisez l’appel HTTP
direct. Le SDK PHP n’expose pas les retraits.