Settle usage from provider evidence without overstating its meaning
Keep provider acceptance, finalized USD cost and recipient delivery separate when reconciling estimated usage records.
Inspect durable meter exports, stable identifiers and invoice guards when accepted usage has not reached the billing provider.
A product action can complete and its retail quantity can settle while export to the billing provider remains pending. Treat those as separate durable steps. Repeating the product action would add an external effect without repairing the missing export, and deleting the outbox entry would hide usage that may already have reached the provider.
Lupin keeps meter export records with a stable identifier and idempotency key. Its worker tracks pending, processing, delivered and blocked states. Those states describe the accounting export, not whether an email was delivered or a resource finished its task. Start investigation at the outbox record’s reason and original period.
The current export worker verifies that the saved meter, price and event name still match the configured catalog. A binding change blocks the record rather than silently submitting its quantity to a different meter. Verify the original and active bindings through authorized operator diagnostics before changing configuration.
Unknown provider outcomes retain the same export identity. The implementation stops automatic export after its conservative twenty-hour attempt window and requires reconciliation. That is a Lupin recovery boundary, not a general statement about every provider’s deduplication guarantee. Do not work around it by generating another identifier for the same quantity.
A late export must not silently move activity into a new cycle. Lupin checks for a uniquely matched draft invoice when the saved cycle has ended. If it cannot establish that the original period remains safely open, the record is blocked for reconciliation rather than sent opportunistically.
Inspect customer, subscription, cycle boundaries and provider invoice state together. A draft invoice belonging to a different subscription or an incomplete invoice listing does not establish safe attribution. Keep uncertain matches unresolved; guessing based on the nearest creation date can bill the correct quantity in the wrong period.
The worker serializes provider requests per customer and meter through a lease and claims each eligible record before dispatch. A lease coordinates workers; it does not prove that a timed-out provider request failed. After a crash or expired lease, preserve the saved identity when evaluating another attempt.
The worker only marks a successful response delivered when the returned identifier and event name match. A nominal HTTP success with an unexpected body remains unverified. This is the same operational discipline used for product actions: transport success must be interpreted against the expected accounting result.
Before clearing a block, establish whether the provider accepted the original identifier, whether the original period remains open and which supported correction path applies. Preserve the earlier record and resolution evidence. Manual reconciliation should explain what happened rather than make an audit trail look as though the first export never existed.
Lupin also guards invoice readiness while applicable reservations or exports remain outstanding. Treat a billing_usage_pending error as a request to finish accounting, not permission to acknowledge an incomplete invoice event. Test these states with local provider stubs and synthetic accounts; no live meter event or invoice change is required for a regression check.
Reviewed against the checked-in Lupin implementation and official reference documentation on 2026-11-05. Operational examples are illustrative; no live paid action, provider mutation or external message was executed.
Prepared with AI assistance by Lupin editorial. How we research and maintain these guides.