Create a wallet payout
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
Create a wallet payout
Transfers funds to a beneficiary’s LigdiCash wallet, with an option to auto-transfer to their mobile money.
POST
/
pay
/
v01
/
withdrawal
/
create
Create a wallet payout
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>"
}The beneficiary must have a LigdiCash account. To send directly to a mobile money number without a LigdiCash account, use POST /pay/v01/straight/payout.
Headers
API key of the LigdiCash project.
Bearer {API_TOKEN}application/jsonapplication/jsonBody
Hide commande
Hide commande
Amount in XOF (positive integer).
Operation description.
Beneficiary’s phone number. Format: country code + number, no
+ or spaces. Example: 22670000000.HTTPS notification URL. Must be publicly accessible.
1— funds stay in the beneficiary’s LigdiCash wallet.0— LigdiCash automatically triggers a transfer to the linked mobile money account.
Free-form metadata. Recommended: include a unique
transaction_id.Response
"00" = payout initiated, any other value = error.Payout token. Store it — required to verify the status.
Associated message. Can be empty.
Additional description. Can be empty.
Always
[].URL to the sub-codes documentation.
{
"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"
}
Error codes
Wiki:https://client.ligdicash.com/wiki/createWithdrawal — see Sub-codes per endpoint.
Related guide
Customer payout — to LigdiCash wallet — use cases andtop_up_wallet details.⌘I
