Webhook concepts
A webhook is an HTTP call that LX CloudPos makes to the integrator’s system to notify it that an event occurred (typically, that Hacienda (Costa Rica’s tax authority) has resolved a document). The direction of the call is the opposite of the rest of the API: instead of the integrator repeatedly polling to check whether the result is already available, LX CloudPos sends the notification the moment the result is produced.
Why webhook and not polling
| Webhook | Polling | |
|---|---|---|
| Latency | Immediate (<2 s) | Depends on the interval (typically 30 s+) |
| Cost | 1 call | N calls, most of them redundant |
| Load on LX CloudPos | Low | High |
| Reliability | With persistent retries | Implemented by the integrator |
| Initial complexity | Requires a public endpoint | Simpler to test |
Using a webhook is recommended whenever possible. Polling should be reserved for cases where exposing a public endpoint is not possible (isolated intranets, mobile apps without a backend).