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

# Configuring the callback URL

> How to define a reliable callback URL, publicly accessible and ready to receive LigdiCash notifications.

Your callback URL is the address to which LigdiCash sends result notifications. You provide it in the `callback_url` field of every transaction creation request.

## Technical requirements

| Criterion        | Required                                                   |
| ---------------- | ---------------------------------------------------------- |
| Protocol         | HTTP or HTTPS                                              |
| Accessibility    | Publicly reachable from the internet                       |
| Authentication   | No basic auth or token in the URL                          |
| Accepted method  | POST                                                       |
| Accepted formats | `application/json` and `application/x-www-form-urlencoded` |

<Note>
  In production, prefer HTTPS to protect data in transit — even though HTTP is technically accepted by LigdiCash.
</Note>

## Setting the callback at creation

Depending on the transaction type, `callback_url` is passed in two different places in the request body.

**In the `commande` object** — for Payout:

```json theme={null}
{
  "commande": {
    "callback_url": "https://backend.mygreatshop.com/callback",
    ...
  }
}
```

**In the `actions` object** — for Payin:

```json theme={null}
{
  "commande": { 
    ...
    "actions": {
      "cancel_url": "https://mygreatshop.com/cancel",
      "return_url": "https://mygreatshop.com/success",
      "callback_url": "https://backend.mygreatshop.com/callback"
    }
    ...
  },
}
```

You can use a different URL per transaction type or a single URL that dispatches based on the payload content.

## Local development

Your local machine is not reachable from the internet. To test the callback locally, use a tunnel like [ngrok](https://ngrok.com) or [Expose](https://expose.dev), which creates a public HTTPS URL pointing to your local server.

```bash theme={null}
# Example with ngrok
ngrok http 3000
# → https://abc123.ngrok.io receives the POST requests and forwards them to localhost:3000
```

<Note>
  The ngrok URL changes every time you restart on the free plan. Use a fixed subdomain or deploy to a staging environment for more stable testing.
</Note>

## Related pages

* [Payin payload](/en/payment-api/callback/payin-payload) — content of payin notifications
* [Payout payload](/en/payment-api/callback/payout-payload) — content of payout notifications
* [Idempotency](/en/payment-api/callback/idempotency) — handling the two requests per event
