Contingency polling
Webhooks are the primary notification channel. Polling is the mandatory fallback.
Webhook delivery depends on your endpoint being reachable at the moment the event fires. A deploy, a certificate renewal, a five-minute outage in your ingress — any of these silently drops events. Without a polling job, those transactions stay in a transitional state forever, and the player never gets credited.
What to implement
A sweeping job. Query every transaction that has been sitting in a transitional state
(PENDING, INITIATED, PROCESSING) for more than 30 seconds, and resolve it with a
GET. Run it on a short interval — once per minute is a reasonable default.
Alerting on aging. Any transaction still transitional after 5 minutes should raise an internal alert. That is no longer normal latency; something needs a human.
Daily reconciliation. Independently of the sweep, compare your ledger against LB Pay's records once per day. See Reconciliation.
Choosing an interval
Poll proportionally to how long the operation has been open — not on a fixed timer for everything. A charge created two seconds ago does not need querying; one open for ten minutes does.
| Age of the transaction | Suggested check |
|---|---|
| < 30 s | Do not poll — wait for the webhook |
| 30 s – 5 min | Every 30–60 s |
| 5 min – 1 h | Every 5 min, plus an alert |
| > 1 h | Hourly, plus escalation to a human queue |
The rule that prevents losses
PENDING, INITIATED and PROCESSING mean the outcome is not yet known. Polling tells
you the current state — it does not authorise a decision until that state is terminal.
Do not cancel a withdrawal, do not return balance to a player, and do not block a new deposit attempt while the status is transitional.
Terminal states are listed per operation in the Status Machine.
Query endpoints
| Operation | Endpoint |
|---|---|
| Deposit | GET /v1/pix/deposit/immediate-charge/{chargeId} |
| Withdrawal | GET /v1/pix/withdraw/{externalId} |
| Refund | GET /v1/pix/refund/{endToEndId} |
| Internal transfer | GET /v1/transfer/{externalId} |
| Balance | GET /v1/balance/realtime |