Payout API
Envoyez des fonds instantanément vers n'importe quel wallet Mobile Money. Idéal pour les salaires, remboursements, et décaissements.
Fonds disponibles requis
Un payout débite directement votre wallet EnvoiFacile. Assurez-vous d'avoir un solde suffisant avant d'initier un payout.
Endpoint
POST
/api/v1/merchant/payout
Scope requis :
payout
Paramètres
| Champ | Type | Requis | Description |
|---|---|---|---|
amount |
integer | Requis | Montant en XOF (min : 500) |
currency |
string | Requis | Code ISO 4217 — XOF |
method |
string | Requis | Opérateur : orange · mtn · moov · wave |
country |
string | Requis | Code ISO alpha-2 : CI · SN · BF · TG |
phone |
string | Requis | Numéro du bénéficiaire au format E.164 |
reference |
string | Requis | Référence unique côté marchand (max 100 chars) |
recipient_name |
string | Optionnel | Nom du bénéficiaire (recommandé) |
description |
string | Optionnel | Motif du virement (max 255 chars) |
metadata |
object | Optionnel | Données libres retournées dans le webhook |
Exemples
Payout Wave CI
bash
curl
curl -X POST https://envoifacile.com/api/v1/merchant/payout \
-H "X-API-KEY: ef_live_xxxxxxxxxxxxxxxxxx" \
-H "Idempotency-Key: payout_salaire_avril_001" \
-H "Content-Type: application/json" \
-d '{
"amount": 150000,
"currency": "XOF",
"method": "wave",
"country": "CI",
"phone": "+2250701234567",
"reference": "payout_salaire_avril_001",
"recipient_name": "Kouame Jean",
"description": "Salaire Avril 2024"
}'
json
Réponse
{
"success": true,
"status": "initiated",
"transaction_id": "OUT_XYZABC789012_1719100000",
"provider": "jeko",
"provider_ref": "wth_abc123def456",
"requires_action": false,
"action_url": null,
"message": "Payment initiated successfully."
}
Exemple JavaScript (Node.js)
javascript
fetch API
const response = await fetch('https://envoifacile.com/api/v1/merchant/payout', {
method: 'POST',
headers: {
'X-API-KEY': process.env.ENVOIFACILE_API_KEY,
'Idempotency-Key': `payout_${payoutId}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: 50000,
currency: 'XOF',
method: 'orange',
country: 'CI',
phone: '+2250701234567',
reference: `payout_${payoutId}`,
recipient_name: 'Diallo Moussa',
description: 'Remboursement commande #4521',
}),
});
const data = await response.json();
console.log(data.transaction_id); // OUT_XYZABC789012_...
Traitement asynchrone
Le statut initiated signifie que le payout est en cours. Le statut final (success ou failed) vous sera notifié via webhook. Conservez le transaction_id pour la réconciliation.