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

# Submit a LigdiCash Wallet payment

> Finalizes a LigdiCash wallet payment by submitting the OTP received by the customer. Second step of the wallet flow.

<Note>
  This endpoint is **exclusive to the LigdiCash Wallet**, to be called after [GET /pay/v02/debitotp](/en/reference/endpoints/debit-otp) which triggers the OTP being sent to the customer.
</Note>

## Headers

<ParamField header="Apikey" type="string" required>
  API key of the LigdiCash project.
</ParamField>

<ParamField header="Authorization" type="string" required>
  `Bearer {API_TOKEN}`
</ParamField>

<ParamField header="Accept" type="string" required>
  `application/json`
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Body

Same structure as [POST /pay/v01/straight/checkout-invoice/create](/en/reference/endpoints/payin-straight-create), with `customer` filled and `otp` containing the code received by the customer.

<ParamField body="commande" type="object" required>
  <Expandable title="commande" defaultOpen>
    <ParamField body="invoice" type="object" required>
      <Expandable title="invoice" defaultOpen>
        <ParamField body="items" type="array" required>Items. Can be `[]`.</ParamField>
        <ParamField body="total_amount" type="integer" required>Amount in XOF (integer).</ParamField>
        <ParamField body="devise" type="string" required>Always `"XOF"`.</ParamField>
        <ParamField body="description" type="string" required>Order description.</ParamField>
        <ParamField body="customer" type="string" required>Phone number of the customer's LigdiCash account. Format: `22670XXXXXXX`.</ParamField>
        <ParamField body="customer_firstname" type="string">First name.</ParamField>
        <ParamField body="customer_lastname" type="string">Last name.</ParamField>
        <ParamField body="customer_email" type="string">Email.</ParamField>
        <ParamField body="external_id" type="string" required>Always `""`.</ParamField>
        <ParamField body="otp" type="string" required>OTP received by the customer on their LigdiCash app or by SMS.</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="store" type="object" required>
      <Expandable title="store" defaultOpen>
        <ParamField body="name" type="string" required>Store name.</ParamField>
        <ParamField body="website_url" type="string" required>Merchant site URL.</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="actions" type="object" required>
      <Expandable title="actions" defaultOpen>
        <ParamField body="cancel_url" type="string" required>Always `""`.</ParamField>
        <ParamField body="return_url" type="string" required>Always `""`.</ParamField>
        <ParamField body="callback_url" type="string" required>Backend notification URL. Publicly accessible.</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="custom_data" type="object">Free-form metadata. Recommended: include a unique `transaction_id`.</ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="response_code" type="string">`"00"` = success, `"01"` = error.</ResponseField>
<ResponseField name="token" type="string">Transaction token. **Store it immediately** — required for `confirm`.</ResponseField>
<ResponseField name="response_text" type="string">Success: `"Votre requête est en cours de traitement"`. Failure: `Echec (CodeXX)`.</ResponseField>
<ResponseField name="wiki" type="string">URL to the sub-codes documentation.</ResponseField>

<CodeGroup>
  ```json Success theme={null}
  {
    "response_code": "00",
    "token": "eyJ0eXAiOiJKV1Qi...",
    "response_text": "Votre requête est en cours de traitement",
    "wiki": "https://client.ligdicash.com/wiki/createInvoice"
  }
  ```

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

## Error codes

Wiki: `https://client.ligdicash.com/wiki/createInvoice` — see [Sub-codes per endpoint](/en/errors/sub-codes#createinvoice).

## Related guide

[LigdiCash Wallet](/en/payment-api/direct-payin/operators/ligdicash-wallet) — full two-step flow.
