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

# API Reference

> Base URL, required headers, request and response format for all LigdiCash endpoints.

## Base URL

All endpoints are reachable at:

```
https://app.ligdicash.com
```

There is no separate sandbox URL. During integration, you use the same URL with the credentials of your temporary account. See [Environments](/en/concepts/environments).

## Required headers

All requests must include these headers:

| Header          | Value                                   |
| --------------- | --------------------------------------- |
| `Apikey`        | API key of your project                 |
| `Authorization` | `Bearer {API_TOKEN}`                    |
| `Accept`        | `application/json`                      |
| `Content-Type`  | `application/json` (POST requests only) |

```bash theme={null}
curl -X POST https://app.ligdicash.com/pay/v01/... \
  -H "Apikey: {API_KEY}" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json"
```

See [Authentication](/en/concepts/authentication) to obtain your credentials.

## Request format

Request bodies are in JSON. The root object is always `commande` for transaction creation endpoints.

## Response format

All responses are in JSON. Fields common to all responses:

| Field           | Type     | Description                                    |
| --------------- | -------- | ---------------------------------------------- |
| `response_code` | `string` | `"00"` = success, `"01"` = error               |
| `token`         | `string` | Transaction token (empty on error)             |
| `response_text` | `string` | Message or error sub-code (`Echec (CodeXX)`)   |
| `wiki`          | `string` | URL to the list of sub-codes for this endpoint |

<Note>
  `response_code: "00"` means the **API request succeeded**, not necessarily that the transaction is completed. Use the `status` field (via `confirm` or callback) to know the payment outcome.
</Note>

## Versioning

The LigdiCash API exposes two versions:

| Version | Endpoints                                              | Usage                                   |
| ------- | ------------------------------------------------------ | --------------------------------------- |
| `v01`   | All standard payin and payout endpoints                | Mobile money operators and general flow |
| `v02`   | `/pay/v02/debitotp` and `/pay/v02/debitwallet/withotp` | LigdiCash Wallet only                   |

## Available endpoints

<CardGroup cols={2}>
  <Card title="Hosted payin — create" href="/en/reference/endpoints/payin-redirect-create">
    `POST /pay/v01/redirect/checkout-invoice/create`
  </Card>

  <Card title="Payin — confirm" href="/en/reference/endpoints/payin-redirect-confirm">
    `GET /pay/v01/redirect/checkout-invoice/confirm`
  </Card>

  <Card title="Direct payin — create" href="/en/reference/endpoints/payin-straight-create">
    `POST /pay/v01/straight/checkout-invoice/create`
  </Card>

  <Card title="Wallet — send OTP" href="/en/reference/endpoints/debit-otp">
    `GET /pay/v02/debitotp/{phone}/{amount}`
  </Card>

  <Card title="Wallet — submit payment" href="/en/reference/endpoints/debit-wallet-with-otp">
    `POST /pay/v02/debitwallet/withotp`
  </Card>

  <Card title="Wallet payout — create" href="/en/reference/endpoints/withdrawal-create">
    `POST /pay/v01/withdrawal/create`
  </Card>

  <Card title="Mobile money payout — create" href="/en/reference/endpoints/straight-payout">
    `POST /pay/v01/straight/payout`
  </Card>

  <Card title="Payout — confirm" href="/en/reference/endpoints/withdrawal-confirm">
    `GET /pay/v01/withdrawal/confirm/`
  </Card>
</CardGroup>
