Skip to main content
POST
/
pay
/
v02
/
debitwallet
/
withotp
Submit a LigdiCash Wallet payment
curl --request POST \
  --url https://app.ligdicash.com/pay/v02/debitwallet/withotp \
  --header 'Accept: <accept>' \
  --header 'Apikey: <apikey>' \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "commande": {
    "invoice": {
      "items": [
        {}
      ],
      "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/v02/debitwallet/withotp"

payload = { "commande": {
"invoice": {
"items": [{}],
"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: [{}],
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/v02/debitwallet/withotp', 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/v02/debitwallet/withotp",
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' => [
[

]
],
'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/v02/debitwallet/withotp"

payload := strings.NewReader("{\n \"commande\": {\n \"invoice\": {\n \"items\": [\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/v02/debitwallet/withotp")
.header("Apikey", "<apikey>")
.header("Authorization", "<authorization>")
.header("Accept", "<accept>")
.header("Content-Type", "<content-type>")
.body("{\n \"commande\": {\n \"invoice\": {\n \"items\": [\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/v02/debitwallet/withotp")

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 ],\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>"
}
This endpoint is exclusive to the LigdiCash Wallet, to be called after GET /pay/v02/debitotp which triggers the OTP being sent to the customer.

Headers

Apikey
string
required
API key of the LigdiCash project.
Authorization
string
required
Bearer {API_TOKEN}
Accept
string
required
application/json
Content-Type
string
required
application/json

Body

Same structure as POST /pay/v01/straight/checkout-invoice/create, with customer filled and otp containing the code received by the customer.
commande
object
required

Response

response_code
string
"00" = success, "01" = error.
token
string
Transaction token. Store it immediately — required for confirm.
response_text
string
Success: "Votre requête est en cours de traitement". Failure: Echec (CodeXX).
wiki
string
URL to the sub-codes documentation.
{
  "response_code": "00",
  "token": "eyJ0eXAiOiJKV1Qi...",
  "response_text": "Votre requête est en cours de traitement",
  "wiki": "https://client.ligdicash.com/wiki/createInvoice"
}
{
  "response_code": "01",
  "token": "",
  "response_text": "Echec (Code00)",
  "wiki": "https://client.ligdicash.com/wiki/createInvoice"
}

Error codes

Wiki: https://client.ligdicash.com/wiki/createInvoice — see Sub-codes per endpoint. LigdiCash Wallet — full two-step flow.