curl --request POST \
--url https://api.alphapay.me/api/v1/payouts/initialize/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "10000.00",
"currency": "XAF",
"country": "CM",
"customer": {
"phone": "+237677889900"
},
"method": "mtn_cm",
"recipient": {
"msisdn": "677889900"
},
"description": "Remboursement commande #778"
}
'import requests
url = "https://api.alphapay.me/api/v1/payouts/initialize/"
payload = {
"amount": "10000.00",
"currency": "XAF",
"country": "CM",
"customer": { "phone": "+237677889900" },
"method": "mtn_cm",
"recipient": { "msisdn": "677889900" },
"description": "Remboursement commande #778"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '10000.00',
currency: 'XAF',
country: 'CM',
customer: {phone: '+237677889900'},
method: 'mtn_cm',
recipient: {msisdn: '677889900'},
description: 'Remboursement commande #778'
})
};
fetch('https://api.alphapay.me/api/v1/payouts/initialize/', 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.alphapay.me/api/v1/payouts/initialize/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => '10000.00',
'currency' => 'XAF',
'country' => 'CM',
'customer' => [
'phone' => '+237677889900'
],
'method' => 'mtn_cm',
'recipient' => [
'msisdn' => '677889900'
],
'description' => 'Remboursement commande #778'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.alphapay.me/api/v1/payouts/initialize/"
payload := strings.NewReader("{\n \"amount\": \"10000.00\",\n \"currency\": \"XAF\",\n \"country\": \"CM\",\n \"customer\": {\n \"phone\": \"+237677889900\"\n },\n \"method\": \"mtn_cm\",\n \"recipient\": {\n \"msisdn\": \"677889900\"\n },\n \"description\": \"Remboursement commande #778\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.alphapay.me/api/v1/payouts/initialize/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"10000.00\",\n \"currency\": \"XAF\",\n \"country\": \"CM\",\n \"customer\": {\n \"phone\": \"+237677889900\"\n },\n \"method\": \"mtn_cm\",\n \"recipient\": {\n \"msisdn\": \"677889900\"\n },\n \"description\": \"Remboursement commande #778\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alphapay.me/api/v1/payouts/initialize/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"10000.00\",\n \"currency\": \"XAF\",\n \"country\": \"CM\",\n \"customer\": {\n \"phone\": \"+237677889900\"\n },\n \"method\": \"mtn_cm\",\n \"recipient\": {\n \"msisdn\": \"677889900\"\n },\n \"description\": \"Remboursement commande #778\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Payout transaction initialized successfully",
"id": "a4b5c6d7-e8f9-4a0b-8c1d-2e3f4a5b6c7d"
}{
"message": "IP non autorisée pour les payouts — ajoutez l'IP de votre serveur à la whitelist IP de votre marchand.",
"code": "ip_not_whitelisted"
}{
"message": "La devise XOF ne correspond pas au pays CM.",
"code": "currency_country_mismatch"
}Initier un payout
Envoie des fonds depuis votre solde marchand vers un bénéficiaire mobile money
curl --request POST \
--url https://api.alphapay.me/api/v1/payouts/initialize/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "10000.00",
"currency": "XAF",
"country": "CM",
"customer": {
"phone": "+237677889900"
},
"method": "mtn_cm",
"recipient": {
"msisdn": "677889900"
},
"description": "Remboursement commande #778"
}
'import requests
url = "https://api.alphapay.me/api/v1/payouts/initialize/"
payload = {
"amount": "10000.00",
"currency": "XAF",
"country": "CM",
"customer": { "phone": "+237677889900" },
"method": "mtn_cm",
"recipient": { "msisdn": "677889900" },
"description": "Remboursement commande #778"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '10000.00',
currency: 'XAF',
country: 'CM',
customer: {phone: '+237677889900'},
method: 'mtn_cm',
recipient: {msisdn: '677889900'},
description: 'Remboursement commande #778'
})
};
fetch('https://api.alphapay.me/api/v1/payouts/initialize/', 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.alphapay.me/api/v1/payouts/initialize/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => '10000.00',
'currency' => 'XAF',
'country' => 'CM',
'customer' => [
'phone' => '+237677889900'
],
'method' => 'mtn_cm',
'recipient' => [
'msisdn' => '677889900'
],
'description' => 'Remboursement commande #778'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.alphapay.me/api/v1/payouts/initialize/"
payload := strings.NewReader("{\n \"amount\": \"10000.00\",\n \"currency\": \"XAF\",\n \"country\": \"CM\",\n \"customer\": {\n \"phone\": \"+237677889900\"\n },\n \"method\": \"mtn_cm\",\n \"recipient\": {\n \"msisdn\": \"677889900\"\n },\n \"description\": \"Remboursement commande #778\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.alphapay.me/api/v1/payouts/initialize/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"10000.00\",\n \"currency\": \"XAF\",\n \"country\": \"CM\",\n \"customer\": {\n \"phone\": \"+237677889900\"\n },\n \"method\": \"mtn_cm\",\n \"recipient\": {\n \"msisdn\": \"677889900\"\n },\n \"description\": \"Remboursement commande #778\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alphapay.me/api/v1/payouts/initialize/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"10000.00\",\n \"currency\": \"XAF\",\n \"country\": \"CM\",\n \"customer\": {\n \"phone\": \"+237677889900\"\n },\n \"method\": \"mtn_cm\",\n \"recipient\": {\n \"msisdn\": \"677889900\"\n },\n \"description\": \"Remboursement commande #778\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Payout transaction initialized successfully",
"id": "a4b5c6d7-e8f9-4a0b-8c1d-2e3f4a5b6c7d"
}{
"message": "IP non autorisée pour les payouts — ajoutez l'IP de votre serveur à la whitelist IP de votre marchand.",
"code": "ip_not_whitelisted"
}{
"message": "La devise XOF ne correspond pas au pays CM.",
"code": "currency_country_mismatch"
}403 ip_not_whitelisted, quelle que soit la validité de votre clé. Ajoutez l’IP de votre serveur depuis votre tableau de bord (ou via POST /merchant-ip-whitelist-entries/, accessible par clé API) avant votre premier appel. Ce prérequis ne s’applique pas à un appel authentifié via le dashboard (JWT).currency et country est ici rejeté (422 currency_country_mismatch), sans conversion automatique.method valides par pays et le format attendu de recipient.msisdn.
Éviter un doublon en cas de coupure réseau
Le headerIdempotency-Key est optionnel : sans lui, chaque appel crée un décaissement — un simple retry réseau en envoie donc un second au bénéficiaire. Avec lui, renvoyer la même clé après un timeout vous renvoie la réponse d’origine au lieu de rejouer l’opération.
Un timeout n’est jamais la preuve qu’une requête a échoué : elle a pu aboutir côté serveur. C’est précisément ce cas que la clé couvre.
curl -X POST https://api.alphapay.me/api/v1/payouts/initialize/ \
-H "Authorization: Bearer sk_live_..." \
-H "Idempotency-Key: 3fa85f64-5717-4562-b3fc-2c963f66afa6" \
-H "Content-Type: application/json" \
-d '{ ... }'
409. Détails : Idempotence.Authorizations
Clé API secrète du marchand — header Authorization: Bearer sk_live_xxx (ou sk_test_xxx en environnement de test).
Headers
Identifiant unique que vous générez pour cette tentative (un UUID par exemple). Optionnel : sans lui, chaque appel est traité comme une nouvelle demande. Avec lui, si vous renvoyez la même clé — après un timeout ou une coupure réseau — AlphaPay renvoie la réponse d'origine au lieu de créer un second paiement. Réutilisez la même clé pour les retrys d'une même tentative, changez-en pour toute nouvelle intention. La même clé avec un corps de requête différent renvoie une erreur 409. Voir Idempotence.
255Body
"10000.00"
3"XAF"
2"CM"
Show child attributes
Show child attributes
Code réseau du bénéficiaire
"mtn_cm"
Show child attributes
Show child attributes
UUID du marchand visé. Ignoré pour une clé API (toujours vous-même).
"Remboursement commande #778"
ADD_ON : les frais s'ajoutent au montant débité au client. DEDUCTED : les frais sont déduits du montant net reversé au marchand. Défaut : configuration du marchand.
ADD_ON, DEDUCTED Response
Payout initialisé