> ## 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.

# Response codes and statuses

> Understanding response_code, response_text, and the wiki field to interpret every LigdiCash API response.

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.

| Value | Meaning                                                    |
| ----- | ---------------------------------------------------------- |
| `00`  | Valid request — the transaction is initiated               |
| `01`  | Rejected request — invalid payload or authentication error |

<Warning>
  `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.
</Warning>

## 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:

| Flow         | Content of `response_text`                                                              |
| ------------ | --------------------------------------------------------------------------------------- |
| Hosted payin | The URL of the LigdiCash payment page — this is the link you must open for the customer |
| Direct payin | A 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.

<Tip>
  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.
</Tip>

## 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

<CodeGroup>
  ```json Success — hosted payin theme={null}
  {
    "response_code": "00",
    "token": "eyJ0eXAiOiJKV1Qi...",
    "response_text": "https://app.ligdicash.com/pay/invoice/eyJ0eXAiOiJKV1Qi...",
    "description": "",
    "custom_data": {},
    "wiki": "https://client.ligdicash.com/wiki/createInvoice"
  }
  ```

  ```json Success — direct payin theme={null}
  {
    "response_code": "00",
    "token": "eyJ0eXAiOiJKV1Qi...",
    "response_text": "Transaction en cours de traitement",
    "description": "",
    "custom_data": {},
    "wiki": "https://client.ligdicash.com/wiki/createInvoice"
  }
  ```

  ```json Failure theme={null}
  {
    "response_code": "01",
    "token": "",
    "response_text": "Echec (Code00)",
    "description": "",
    "custom_data": {},
    "wiki": "https://client.ligdicash.com/wiki/createInvoice"
  }
  ```
</CodeGroup>

## Recommended pattern

```javascript Node.js theme={null}
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
}
```

## Related pages

* [Transaction lifecycle](/en/concepts/transaction-lifecycle) — statuses `pending`, `completed`, `notcompleted`
* [Common errors](/en/errors/common-errors) — causes and solutions per endpoint
* [The wiki field](/en/errors/wiki-field) — advanced usage
