Créer un payout
curl --request POST \
--url https://api.example.com/v1/payoutsimport requests
url = "https://api.example.com/v1/payouts"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/payouts', 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/payouts",
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/payouts"
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/payouts")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payouts")
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_bodyPayouts
Créer un payout
Envoyer de l’argent vers Mobile Money
POST
/
v1
/
payouts
Créer un payout
curl --request POST \
--url https://api.example.com/v1/payoutsimport requests
url = "https://api.example.com/v1/payouts"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/payouts', 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/payouts",
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/payouts"
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/payouts")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payouts")
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 payout
Crée un nouveau payout (envoi d’argent) vers un compte Mobile Money.Endpoint
POST /v1/payouts
Headers
| Header | Requis | Description |
|---|---|---|
Authorization | ✅ | Bearer sk_xxx |
Content-Type | ✅ | application/json |
X-Idempotency-Key | Recommandé | Clé unique pour éviter les doublons |
Body
| Paramètre | Type | Requis | Description |
|---|---|---|---|
amount | integer | ✅ | Montant en FCFA (min: 100, max: 5,000,000) |
provider | string | ✅ | ORANGE_MONEY, WAVE, ou MOOV |
recipient_phone | string | ✅ | Numéro de téléphone du destinataire (+223…) |
recipient_name | string | Nom du destinataire | |
description | string | Description du payout | |
type | string | Type: MERCHANT_WITHDRAWAL, SUPPLIER_PAYMENT, SALARY, COMMISSION, REFUND, OTHER | |
metadata | object | Données personnalisées | |
idempotency_key | string | Clé d’idempotence |
Exemple
curl -X POST https://api.sahelpay.ml/v1/payouts \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: supplier-123" \
-d '{
"amount": 50000,
"provider": "ORANGE_MONEY",
"recipient_phone": "+22370123456",
"recipient_name": "Mamadou Diallo",
"description": "Paiement fournisseur #123",
"type": "SUPPLIER_PAYMENT"
}'
const response = await fetch('https://api.sahelpay.ml/v1/payouts', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_xxx',
'Content-Type': 'application/json',
'X-Idempotency-Key': 'supplier-123',
},
body: JSON.stringify({
amount: 50000,
provider: 'ORANGE_MONEY',
recipient_phone: '+22370123456',
recipient_name: 'Mamadou Diallo',
description: 'Paiement fournisseur #123',
type: 'SUPPLIER_PAYMENT',
}),
});
Réponse
{
"success": true,
"data": {
"id": "pay_abc123def456",
"reference": "PAY_abc123def456",
"amount": 50000,
"fee": 250,
"net_amount": 49750,
"currency": "XOF",
"provider": "ORANGE_MONEY",
"recipient_phone": "+22370123456",
"recipient_name": "Mamadou Diallo",
"type": "SUPPLIER_PAYMENT",
"status": "PENDING",
"description": "Paiement fournisseur #123",
"created_at": "2025-12-18T16:45:00.000Z"
}
}
Erreurs
| Code | Description |
|---|---|
INVALID_AMOUNT | Montant invalide (< 100 ou > 5,000,000) |
INSUFFICIENT_FUNDS | Solde insuffisant |
INVALID_PROVIDER | Provider non supporté |
DUPLICATE_PAYOUT | Payout déjà créé (idempotence) |
⌘I