Why the current usage endpoint returns outdated data after ingesting events
Last updated: May 6, 2026
Querying a customer's current usage immediately after sending events can return data that doesn't yet include those events. This is expected behavior caused by asynchronous event processing, not a bug in most cases.
How it works
When an event is ingested, it is saved to the database immediately. However, cache invalidation for the affected charges happens inside Events::PostProcessJob, which runs asynchronously in Sidekiq. Until that job completes, the usage cache still holds the pre-ingestion values. How long this takes depends on Sidekiq queue throughput — typically a few seconds under normal load, but potentially longer if the queue is busy.
What to do
Wait for the PostProcessJob to clear before querying current usage. Rather than relying on a fixed delay, either poll the usage endpoint until the expected values appear, or build your integration to treat current usage as eventually consistent rather than immediately consistent after ingestion.
The correct endpoint is GET /api/v1/customers/{customer_external_id}/current_usage with external_subscription_id as a required query parameter.
If stale data persists beyond expected processing time
If usage remains stale well after event ingestion — across multiple queries and retries — the cache may not be invalidating correctly.
For self-hosted deployments, expire the cache for the affected subscription from the Rails console:
subscription = Subscription.find_by(external_id: 'SUBSCRIPTION_EXTERNAL_ID')
Subscriptions::ChargeCacheService.expire_for_subscription(subscription)For Lago Cloud, contact Lago support with the affected customer and subscription IDs.
This article reflects guidance drawn from customer case resolutions. It is not officially supported documentation and may not apply to all situations.