Créer une facture payin redirect
curl --request POST \
--url https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/create \
--header 'Accept: <accept>' \
--header 'Apikey: <apikey>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"commande": {
"invoice": {
"items": [
{
"name": "<string>",
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"total_price": 123
}
],
"total_amount": 123,
"devise": "<string>",
"description": "<string>",
"customer": "<string>",
"customer_firstname": "<string>",
"customer_lastname": "<string>",
"customer_email": "<string>",
"external_id": "<string>",
"otp": "<string>"
},
"store": {
"name": "<string>",
"website_url": "<string>"
},
"actions": {
"cancel_url": "<string>",
"return_url": "<string>",
"callback_url": "<string>"
},
"custom_data": {}
}
}
'import requests
url = "https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/create"
payload = { "commande": {
"invoice": {
"items": [
{
"name": "<string>",
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"total_price": 123
}
],
"total_amount": 123,
"devise": "<string>",
"description": "<string>",
"customer": "<string>",
"customer_firstname": "<string>",
"customer_lastname": "<string>",
"customer_email": "<string>",
"external_id": "<string>",
"otp": "<string>"
},
"store": {
"name": "<string>",
"website_url": "<string>"
},
"actions": {
"cancel_url": "<string>",
"return_url": "<string>",
"callback_url": "<string>"
},
"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: {
invoice: {
items: [
{
name: '<string>',
description: '<string>',
quantity: 123,
unit_price: 123,
total_price: 123
}
],
total_amount: 123,
devise: '<string>',
description: '<string>',
customer: '<string>',
customer_firstname: '<string>',
customer_lastname: '<string>',
customer_email: '<string>',
external_id: '<string>',
otp: '<string>'
},
store: {name: '<string>', website_url: '<string>'},
actions: {cancel_url: '<string>', return_url: '<string>', callback_url: '<string>'},
custom_data: {}
}
})
};
fetch('https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/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/redirect/checkout-invoice/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' => [
'invoice' => [
'items' => [
[
'name' => '<string>',
'description' => '<string>',
'quantity' => 123,
'unit_price' => 123,
'total_price' => 123
]
],
'total_amount' => 123,
'devise' => '<string>',
'description' => '<string>',
'customer' => '<string>',
'customer_firstname' => '<string>',
'customer_lastname' => '<string>',
'customer_email' => '<string>',
'external_id' => '<string>',
'otp' => '<string>'
],
'store' => [
'name' => '<string>',
'website_url' => '<string>'
],
'actions' => [
'cancel_url' => '<string>',
'return_url' => '<string>',
'callback_url' => '<string>'
],
'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/redirect/checkout-invoice/create"
payload := strings.NewReader("{\n \"commande\": {\n \"invoice\": {\n \"items\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"total_price\": 123\n }\n ],\n \"total_amount\": 123,\n \"devise\": \"<string>\",\n \"description\": \"<string>\",\n \"customer\": \"<string>\",\n \"customer_firstname\": \"<string>\",\n \"customer_lastname\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"external_id\": \"<string>\",\n \"otp\": \"<string>\"\n },\n \"store\": {\n \"name\": \"<string>\",\n \"website_url\": \"<string>\"\n },\n \"actions\": {\n \"cancel_url\": \"<string>\",\n \"return_url\": \"<string>\",\n \"callback_url\": \"<string>\"\n },\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/redirect/checkout-invoice/create")
.header("Apikey", "<apikey>")
.header("Authorization", "<authorization>")
.header("Accept", "<accept>")
.header("Content-Type", "<content-type>")
.body("{\n \"commande\": {\n \"invoice\": {\n \"items\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"total_price\": 123\n }\n ],\n \"total_amount\": 123,\n \"devise\": \"<string>\",\n \"description\": \"<string>\",\n \"customer\": \"<string>\",\n \"customer_firstname\": \"<string>\",\n \"customer_lastname\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"external_id\": \"<string>\",\n \"otp\": \"<string>\"\n },\n \"store\": {\n \"name\": \"<string>\",\n \"website_url\": \"<string>\"\n },\n \"actions\": {\n \"cancel_url\": \"<string>\",\n \"return_url\": \"<string>\",\n \"callback_url\": \"<string>\"\n },\n \"custom_data\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/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 \"invoice\": {\n \"items\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"total_price\": 123\n }\n ],\n \"total_amount\": 123,\n \"devise\": \"<string>\",\n \"description\": \"<string>\",\n \"customer\": \"<string>\",\n \"customer_firstname\": \"<string>\",\n \"customer_lastname\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"external_id\": \"<string>\",\n \"otp\": \"<string>\"\n },\n \"store\": {\n \"name\": \"<string>\",\n \"website_url\": \"<string>\"\n },\n \"actions\": {\n \"cancel_url\": \"<string>\",\n \"return_url\": \"<string>\",\n \"callback_url\": \"<string>\"\n },\n \"custom_data\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"response_code": "<string>",
"token": "<string>",
"response_text": "<string>",
"wiki": "<string>"
}Endpoints — Payin
Créer une facture payin redirect
Crée une facture de paiement avec redirection et retourne l’URL de la page de paiement LigdiCash.
POST
/
pay
/
v01
/
redirect
/
checkout-invoice
/
create
Créer une facture payin redirect
curl --request POST \
--url https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/create \
--header 'Accept: <accept>' \
--header 'Apikey: <apikey>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"commande": {
"invoice": {
"items": [
{
"name": "<string>",
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"total_price": 123
}
],
"total_amount": 123,
"devise": "<string>",
"description": "<string>",
"customer": "<string>",
"customer_firstname": "<string>",
"customer_lastname": "<string>",
"customer_email": "<string>",
"external_id": "<string>",
"otp": "<string>"
},
"store": {
"name": "<string>",
"website_url": "<string>"
},
"actions": {
"cancel_url": "<string>",
"return_url": "<string>",
"callback_url": "<string>"
},
"custom_data": {}
}
}
'import requests
url = "https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/create"
payload = { "commande": {
"invoice": {
"items": [
{
"name": "<string>",
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"total_price": 123
}
],
"total_amount": 123,
"devise": "<string>",
"description": "<string>",
"customer": "<string>",
"customer_firstname": "<string>",
"customer_lastname": "<string>",
"customer_email": "<string>",
"external_id": "<string>",
"otp": "<string>"
},
"store": {
"name": "<string>",
"website_url": "<string>"
},
"actions": {
"cancel_url": "<string>",
"return_url": "<string>",
"callback_url": "<string>"
},
"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: {
invoice: {
items: [
{
name: '<string>',
description: '<string>',
quantity: 123,
unit_price: 123,
total_price: 123
}
],
total_amount: 123,
devise: '<string>',
description: '<string>',
customer: '<string>',
customer_firstname: '<string>',
customer_lastname: '<string>',
customer_email: '<string>',
external_id: '<string>',
otp: '<string>'
},
store: {name: '<string>', website_url: '<string>'},
actions: {cancel_url: '<string>', return_url: '<string>', callback_url: '<string>'},
custom_data: {}
}
})
};
fetch('https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/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/redirect/checkout-invoice/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' => [
'invoice' => [
'items' => [
[
'name' => '<string>',
'description' => '<string>',
'quantity' => 123,
'unit_price' => 123,
'total_price' => 123
]
],
'total_amount' => 123,
'devise' => '<string>',
'description' => '<string>',
'customer' => '<string>',
'customer_firstname' => '<string>',
'customer_lastname' => '<string>',
'customer_email' => '<string>',
'external_id' => '<string>',
'otp' => '<string>'
],
'store' => [
'name' => '<string>',
'website_url' => '<string>'
],
'actions' => [
'cancel_url' => '<string>',
'return_url' => '<string>',
'callback_url' => '<string>'
],
'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/redirect/checkout-invoice/create"
payload := strings.NewReader("{\n \"commande\": {\n \"invoice\": {\n \"items\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"total_price\": 123\n }\n ],\n \"total_amount\": 123,\n \"devise\": \"<string>\",\n \"description\": \"<string>\",\n \"customer\": \"<string>\",\n \"customer_firstname\": \"<string>\",\n \"customer_lastname\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"external_id\": \"<string>\",\n \"otp\": \"<string>\"\n },\n \"store\": {\n \"name\": \"<string>\",\n \"website_url\": \"<string>\"\n },\n \"actions\": {\n \"cancel_url\": \"<string>\",\n \"return_url\": \"<string>\",\n \"callback_url\": \"<string>\"\n },\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/redirect/checkout-invoice/create")
.header("Apikey", "<apikey>")
.header("Authorization", "<authorization>")
.header("Accept", "<accept>")
.header("Content-Type", "<content-type>")
.body("{\n \"commande\": {\n \"invoice\": {\n \"items\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"total_price\": 123\n }\n ],\n \"total_amount\": 123,\n \"devise\": \"<string>\",\n \"description\": \"<string>\",\n \"customer\": \"<string>\",\n \"customer_firstname\": \"<string>\",\n \"customer_lastname\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"external_id\": \"<string>\",\n \"otp\": \"<string>\"\n },\n \"store\": {\n \"name\": \"<string>\",\n \"website_url\": \"<string>\"\n },\n \"actions\": {\n \"cancel_url\": \"<string>\",\n \"return_url\": \"<string>\",\n \"callback_url\": \"<string>\"\n },\n \"custom_data\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/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 \"invoice\": {\n \"items\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"total_price\": 123\n }\n ],\n \"total_amount\": 123,\n \"devise\": \"<string>\",\n \"description\": \"<string>\",\n \"customer\": \"<string>\",\n \"customer_firstname\": \"<string>\",\n \"customer_lastname\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"external_id\": \"<string>\",\n \"otp\": \"<string>\"\n },\n \"store\": {\n \"name\": \"<string>\",\n \"website_url\": \"<string>\"\n },\n \"actions\": {\n \"cancel_url\": \"<string>\",\n \"return_url\": \"<string>\",\n \"callback_url\": \"<string>\"\n },\n \"custom_data\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"response_code": "<string>",
"token": "<string>",
"response_text": "<string>",
"wiki": "<string>"
}En-têtes
Clé API du projet LigdiCash.
Bearer {API_TOKEN}application/jsonapplication/jsonCorps
Masquer commande
Masquer commande
Masquer invoice
Masquer invoice
Montant total en XOF (entier).
Toujours
"XOF".Description affichée sur la page de paiement.
Toujours
"". Un numéro non vide filtre les opérateurs affichés.Prénom du client.
Nom du client.
Email du client.
Identifiant marchand alternatif.
"" si non utilisé.Toujours
"".Métadonnées libres retournées dans le callback. Recommandé : inclure un
transaction_id unique.Réponse
"00" = succès, "01" = erreur.Token de la transaction. À stocker immédiatement — requis pour appeler
confirm.Succès : URL de la page de paiement à ouvrir pour le client. Échec : sous-code
Echec (CodeXX).URL de la documentation des sous-codes pour cet endpoint.
{
"response_code": "00",
"token": "eyJ0eXAiOiJKV1Qi...",
"response_text": "https://app.ligdicash.com/pay/invoice/eyJ0eXAiOiJKV1Qi...",
"wiki": "https://client.ligdicash.com/wiki/createInvoice"
}
{
"response_code": "01",
"token": "",
"response_text": "Echec (Code00)",
"wiki": "https://client.ligdicash.com/wiki/createInvoice"
}
Codes d’erreur
Wiki :https://client.ligdicash.com/wiki/createInvoice — voir Sous-codes par endpoint.
Guide associé
Créer une facture — exemples complets et pièges à éviter.⌘I
