When you create a transaction through the LigdiCash API, you receive aDocumentation Index
Fetch the complete documentation index at: https://developers.ligdicash.com/llms.txt
Use this file to discover all available pages before exploring further.
token in return. This token is not stable: its value in the callback differs from the one obtained at creation. If you rely on it to identify your transactions, you will lose the thread between what you initiated and what you confirmed.
The solution is simple: generate your own identifier on the merchant side, store it before calling the API, and pass it in the custom_data field. LigdiCash will return it intact in the callback, and display it in your dashboard.
The problem: the token changes between creation and callback
When a transaction is created, the API returns atoken:
The solution: inject your transaction_id into custom_data
Thecustom_data field of each request is a JSON object whose keys you define freely. This is where you inject your identifier:
transaction_id appears in this form:
keyof_customdata to extract your value — do not rely on the position in the array, other entries may be present.
transaction_id format
You are free to choose the format that fits your business:| Format | Example | Typical use |
|---|---|---|
| Order reference | ORD-2026-00042 | E-commerce — displayed to the customer |
| Short readable code | PAY-8KXZ | Customer support, memorable |
| UUID v4 | f47ac10b-58cc-4372-a567-0e02b2c3d479 | Distributed systems, internal use |
| Timestamp + random | 1723718400-a3f9 | Job queue |
| Internal ID | order_8821 | Existing application |
Recommended lifecycle
Persist it in your database
Save it in your database with the
pending status before calling the API. If the call fails, you still have a trace.Store the creation token
Also store the
token returned by the API — it will be needed to call the confirm endpoint when re-verifying the callback.Retrieving the transaction_id in the callback
The callback payload contains acustom_data field. Its shape varies depending on the flow (see Parsing custom_data), but for a payin it is an array:
Visibility in the LigdiCash dashboard
Thetransaction_id you inject in custom_data is displayed in the LigdiCash dashboard, in the transaction table — for both payin and payout. This lets you reconcile your transactions visually without having to query your own database.
Complete request example
Related pages
- Tokens and identifiers — differences between
token,transaction_id, andexternal_id - Securing the callback — why re-verify with the stored token
- Parsing custom_data — the 3 possible shapes of
custom_data
