Skip to main content
The LigdiCash API distinguishes between two levels of errors that must not be confused: the immediate rejection of a malformed request, and the failure of a transaction that was successfully initiated. This guide explains how to handle each one.

The two error levels

Level 1 — Request rejection (response_code)

Happens immediately on the HTTP call. LigdiCash has read your payload and rejected it. When response_code is 01, the response_text field contains a technical sub-code in the form Echec (CodeXX). Read the wiki field to get the human-readable description.
response_code: "00" does not guarantee that the payment will succeed. It only confirms that your request was syntactically correct and that the transaction has been queued. The actual payment outcome is delivered via the callback or the confirm endpoint.

Level 2 — Transaction failure (callback / confirm)

Happens after response_code: "00". The transaction was initiated but did not complete on the operator side. These failures indicate business issues: insufficient balance, wrong OTP, ineligible number, etc.

Error categories


General handling strategy

1

Check response_code immediately

If response_code === "01": log response_text, follow the URL in wiki to read the human description. Do not retry immediately — fix the root cause first.
2

Store the creation token

If response_code === "00": store the returned token in your database, linked to your transaction_id. You will need it to re-verify the callback.
3

Handle the callback defensively

Never trust the callback payload alone. Always call confirm with the token stored in the previous step to validate the real outcome.

Complete handling example

Node.js