There are two ways to know whether a LigdiCash transaction succeeded: wait for LigdiCash to notify you (callback), or query the API at regular intervals (polling). Both approaches are complementary — using one without the other leaves a blind spot.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.
Definitions
Callback (passive notification) LigdiCash sends a POST request to yourcallback_url as soon as the status of a transaction changes. You do not have to trigger anything: LigdiCash comes to notify you.
Polling (active checking)
Your backend periodically calls the confirm endpoint with the transaction’s token until it obtains a terminal status (completed or notcompleted). You query LigdiCash instead of waiting for it to reach out.
Benefits and limits
| Callback | Polling | |
|---|---|---|
| Latency | Low — near-instant notification | Variable — depends on the chosen interval |
| Server load | Minimal — one incoming call | Repeated — N outgoing calls per transaction |
| Network reliability | Fragile — your server must be reachable | Robust — you initiate the calls |
| Local environment | Difficult — requires a tunnel (ngrok, etc.) | Easy — works anywhere |
| Security | Requires re-verification with confirm | Native — you query the API directly |
| Slow transactions | Ideal — notified as soon as something changes | Costly — keeps polling during the wait |
Recommendations by use case
Use the callback as the primary strategy The callback is the mechanism designed by LigdiCash for production notification. It is reactive, low-cost, and suited to transactions whose confirmation delay is variable (from a few seconds to several minutes depending on the operator). Use polling in local development Locally, your server is not reachable from the internet. Use polling to simulate production behavior without having to set up a tunnel. Use polling as a safety net in production Even in production, a callback may not arrive: your server was temporarily unavailable, the network dropped, or LigdiCash encountered an error sending the notification. A fallback polling triggered a few minutes after the creation of a stillpending transaction lets you catch these cases.
Do not replace the callback with polling
Fast polling (every second) to replace the callback is a bad idea: it multiplies API calls, increases perceived latency, and creates concurrency issues if two workers process the same transaction.
Recommended hybrid pattern
The most robust architecture combines the two: primary callback + fallback polling.JavaScript — fallback polling
Security: mandatory re-verification
Whether you use the callback or polling, never fulfill an order without callingconfirm with the token stored at creation. A forged callback payload can be sent by anyone who knows your URL. confirm is the only source of truth.
See Securing the callback for the full re-verification pattern with idempotency handling.
Related pages
- Recommendations — polling intervals, timeouts, pending handling
- Callback — security — re-verification with
confirm - Callback — idempotency — deduplicating the two requests
- Response codes and statuses — full reference of
statusvalues
