Créer un payout wallet
curl --request POST \
--url https://app.ligdicash.com/pay/v01/withdrawal/create \
--header 'Accept: <accept>' \
--header 'Apikey: <apikey>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"commande": {
"amount": 123,
"description": "<string>",
"customer": "<string>",
"callback_url": "<string>",
"top_up_wallet": 123,
"custom_data": {}
}
}
'import requests
url = "https://app.ligdicash.com/pay/v01/withdrawal/create"
payload = { "commande": {
"amount": 123,
"description": "<string>",
"customer": "<string>",
"callback_url": "<string>",
"top_up_wallet": 123,
"custom_data": {}
} }
headers = {
"Apikey": "<apikey>",
"Authorization": "<authorization>",
"Accept": "<accept>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Apikey: '<apikey>',
Authorization: '<authorization>',
Accept: '<accept>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({
commande: {
amount: 123,
description: '<string>',
customer: '<string>',
callback_url: '<string>',
top_up_wallet: 123,
custom_data: {}
}
})
};
fetch('https://app.ligdicash.com/pay/v01/withdrawal/create', 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://app.ligdicash.com/pay/v01/withdrawal/create",
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([
'commande' => [
'amount' => 123,
'description' => '<string>',
'customer' => '<string>',
'callback_url' => '<string>',
'top_up_wallet' => 123,
'custom_data' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Apikey: <apikey>",
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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://app.ligdicash.com/pay/v01/withdrawal/create"
payload := strings.NewReader("{\n \"commande\": {\n \"amount\": 123,\n \"description\": \"<string>\",\n \"customer\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"top_up_wallet\": 123,\n \"custom_data\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Apikey", "<apikey>")
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Accept", "<accept>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.ligdicash.com/pay/v01/withdrawal/create")
.header("Apikey", "<apikey>")
.header("Authorization", "<authorization>")
.header("Accept", "<accept>")
.header("Content-Type", "<content-type>")
.body("{\n \"commande\": {\n \"amount\": 123,\n \"description\": \"<string>\",\n \"customer\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"top_up_wallet\": 123,\n \"custom_data\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.ligdicash.com/pay/v01/withdrawal/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Apikey"] = '<apikey>'
request["Authorization"] = '<authorization>'
request["Accept"] = '<accept>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"commande\": {\n \"amount\": 123,\n \"description\": \"<string>\",\n \"customer\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"top_up_wallet\": 123,\n \"custom_data\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"response_code": "<string>",
"token": "<string>",
"response_text": "<string>",
"description": "<string>",
"custom_data": [
{}
],
"wiki": "<string>"
}Endpoints — Payout
Créer un payout wallet
Transfère des fonds vers le wallet LigdiCash d’un bénéficiaire, avec option de virement automatique vers son mobile money.
POST
/
pay
/
v01
/
withdrawal
/
create
Créer un payout wallet
curl --request POST \
--url https://app.ligdicash.com/pay/v01/withdrawal/create \
--header 'Accept: <accept>' \
--header 'Apikey: <apikey>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"commande": {
"amount": 123,
"description": "<string>",
"customer": "<string>",
"callback_url": "<string>",
"top_up_wallet": 123,
"custom_data": {}
}
}
'import requests
url = "https://app.ligdicash.com/pay/v01/withdrawal/create"
payload = { "commande": {
"amount": 123,
"description": "<string>",
"customer": "<string>",
"callback_url": "<string>",
"top_up_wallet": 123,
"custom_data": {}
} }
headers = {
"Apikey": "<apikey>",
"Authorization": "<authorization>",
"Accept": "<accept>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Apikey: '<apikey>',
Authorization: '<authorization>',
Accept: '<accept>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({
commande: {
amount: 123,
description: '<string>',
customer: '<string>',
callback_url: '<string>',
top_up_wallet: 123,
custom_data: {}
}
})
};
fetch('https://app.ligdicash.com/pay/v01/withdrawal/create', 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://app.ligdicash.com/pay/v01/withdrawal/create",
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([
'commande' => [
'amount' => 123,
'description' => '<string>',
'customer' => '<string>',
'callback_url' => '<string>',
'top_up_wallet' => 123,
'custom_data' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Apikey: <apikey>",
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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://app.ligdicash.com/pay/v01/withdrawal/create"
payload := strings.NewReader("{\n \"commande\": {\n \"amount\": 123,\n \"description\": \"<string>\",\n \"customer\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"top_up_wallet\": 123,\n \"custom_data\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Apikey", "<apikey>")
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Accept", "<accept>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.ligdicash.com/pay/v01/withdrawal/create")
.header("Apikey", "<apikey>")
.header("Authorization", "<authorization>")
.header("Accept", "<accept>")
.header("Content-Type", "<content-type>")
.body("{\n \"commande\": {\n \"amount\": 123,\n \"description\": \"<string>\",\n \"customer\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"top_up_wallet\": 123,\n \"custom_data\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.ligdicash.com/pay/v01/withdrawal/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Apikey"] = '<apikey>'
request["Authorization"] = '<authorization>'
request["Accept"] = '<accept>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"commande\": {\n \"amount\": 123,\n \"description\": \"<string>\",\n \"customer\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"top_up_wallet\": 123,\n \"custom_data\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"response_code": "<string>",
"token": "<string>",
"response_text": "<string>",
"description": "<string>",
"custom_data": [
{}
],
"wiki": "<string>"
}Le bénéficiaire doit posséder un compte LigdiCash. Pour envoyer directement vers un numéro mobile money sans compte LigdiCash, utilisez POST /pay/v01/straight/payout.
En-têtes
Clé API du projet LigdiCash.
Bearer {API_TOKEN}application/jsonapplication/jsonCorps
Masquer commande
Masquer commande
Montant en XOF (entier positif).
Description de l’opération.
Numéro de téléphone du bénéficiaire. Format : indicatif + numéro, sans
+ ni espaces. Exemple : 22670000000.URL HTTPS de notification. Doit être accessible publiquement.
1— les fonds restent dans le wallet LigdiCash du bénéficiaire.0— LigdiCash déclenche automatiquement un virement vers le compte mobile money lié.
Métadonnées libres. Recommandé : inclure un
transaction_id unique.Réponse
"00" = payout initié, autre valeur = erreur.Token du payout. À stocker — requis pour vérifier le statut.
Message associé. Peut être vide.
Description complémentaire. Peut être vide.
Toujours
[].URL de la documentation des sous-codes.
{
"response_code": "00",
"token": "{PAYOUT_TOKEN}",
"response_text": "",
"description": "",
"custom_data": [],
"wiki": "https://client.ligdicash.com/wiki/createWithdrawal"
}
{
"response_code": "01",
"token": "",
"response_text": "Echec (Code01)",
"wiki": "https://client.ligdicash.com/wiki/createWithdrawal"
}
Codes d’erreur
Wiki :https://client.ligdicash.com/wiki/createWithdrawal — voir Sous-codes par endpoint.
Guide associé
Payout Client — vers wallet LigdiCash — cas d’usage et détail detop_up_wallet.⌘I
