Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developers.ligdicash.com/llms.txt

Use this file to discover all available pages before exploring further.

Every LigdiCash API response contains three fields that let you interpret the result of a call: response_code, response_text, and wiki. They are present on every endpoint.

response_code

The response_code field indicates whether the request was accepted or rejected by LigdiCash.
ValueMeaning
00Valid request — the transaction is initiated
01Rejected request — invalid payload or authentication error
response_code: "00" does not mean the payment succeeded. It only means your payload was correct and the transaction was properly initiated. The actual outcome of the payment — success or failure — is communicated later via the callback or the confirm endpoint.

response_text

The value of response_text depends on both the result and the endpoint called. On success (response_code: "00"), the content varies by transaction type:
FlowContent of response_text
Hosted payinThe URL of the LigdiCash payment page — this is the link you must open for the customer
Direct payinA text message indicating that the transaction is being processed
On failure (response_code: "01"), it takes the form Echec (CodeXX) where XX is a sub-code specific to the endpoint — for example Echec (Code00) for an authentication failure.
On failure, response_text is a technical code (Echec (CodeXX)). Prefer to consult the wiki field to get a readable description and display a message suited to your user.

The wiki field

The wiki field present in every response contains a URL to the documentation of the sub-codes for the endpoint called. Always consult this URL when response_code is 01 to know the exact cause of the failure. The returned page displays a structured list of possible sub-codes and their description, in PHP var_dump format:
array:2 [▼
  0 => array:2 [▶]
  1 => array:3 [▼
    "code" => "01"
    "description" => "There is an error"
    "subcodes" => array:19 [▼
      0 => array:2 [▼
        "code" => "Echec (Code00)"
        "description" => "Authentification failure"
      ]
      1 => array:2 [▶]
      2 => array:2 [▶]
      ...
    ]
  ]
]
Each entry of subcodes corresponds to a possible value of response_text and its meaning in English.

Example response

{
  "response_code": "00",
  "token": "eyJ0eXAiOiJKV1Qi...",
  "response_text": "https://app.ligdicash.com/pay/invoice/eyJ0eXAiOiJKV1Qi...",
  "description": "",
  "custom_data": {},
  "wiki": "https://client.ligdicash.com/wiki/createInvoice"
}
Node.js
const data = await response.json();

if (data.response_code === "01") {
  // Log the technical sub-code
  console.error("LigdiCash error:", data.response_text);

  // Consult data.wiki to get the description of the sub-code
  // and build a message suited to your user
}