Skip to main content

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.

The confirm endpoint is the same as for hosted payin. The difference is when you call it: without a redirect, there is no return_url to trigger a verification from the frontend. You must wait for the callback — it is the signal that the operator has finished processing.
GET https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/confirm?token={TOKEN}
For the full reference (headers, response fields, real payloads), see Verify the status — hosted payin.

When to call confirm

Always when the callback is received. Whatever the validation mode, the operator’s confirmation can take a variable amount of time — from a few seconds to several minutes, even when the customer has already entered their OTP. The callback is the only reliable signal that the operator has processed the transaction. Call confirm from your callback handler, with the token stored at creation, before fulfilling the order.
Always call confirm with the token stored at creation, not the one received in the callback. Both tokens let you call the endpoint, but only the creation token lets you reconcile with your order.

Request example

curl -X GET "https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/confirm?token={TOKEN}" \
  -H "Apikey: {API_KEY}" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -H "Accept: application/json"

status values

statusMeaningRecommended action
completedPayment confirmedFulfill the order
pendingAwaiting customer validationContinue polling or wait for the callback
notcompletedPayment did not go throughOffer to retry

Polling — safety net only

If the callback is delayed or unavailable in your environment, you can poll confirm at regular intervals. The status will be pending until the operator has finalized the transaction:
JavaScript
async function waitForConfirmation(token, { interval = 4000, maxAttempts = 15 } = {}) {
  for (let i = 0; i < maxAttempts; i++) {
    const res = await fetch(
      `https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/confirm?token=${token}`,
      {
        headers: {
          Apikey: process.env.LIGDICASH_API_KEY,
          Authorization: `Bearer ${process.env.LIGDICASH_API_TOKEN}`,
          Accept: "application/json",
        },
      }
    );
    const data = await res.json();

    if (data.status === "completed") return { success: true, data };
    if (data.status === "notcompleted") return { success: false, data };

    await new Promise((r) => setTimeout(r, interval));
  }
  return { success: false, reason: "timeout" };
}
Polling is a safety net, not a replacement for the callback. Always base your business logic on the callback. See Polling vs callback for trade-offs.