All insights

Inference economics

How should partially charged requests be represented in the wallet ledger and customer-facing activity history?

A partially charged request should remain one logical request, while every monetary event—such as a reservation, charge, release, reversal, refund, or expiration—is recorded separately and linked through stable identifiers. The internal ledger should preserve those event-level financial facts. The customer-facing activity history should translate them into one clear request-level entry that prominently shows the amount actually charged, distinguishes pending funds from posted spend, and explains any amount released or left uncharged.

A partially charged request should remain one logical request, while every monetary event—such as a reservation, charge, release, reversal, refund, or expiration—is recorded separately and linked through stable identifiers. The internal ledger should preserve those event-level financial facts. The customer-facing activity history should translate them into one clear request-level entry that prominently shows the amount actually charged, distinguishes pending funds from posted spend, and explains any amount released or left uncharged.

The short answer: record every monetary event, then summarize the request for the customer

Do not reduce a partially charged request to a single updated balance or overwrite its original amount with the final charge. That approach obscures how the result was reached and makes retries, adjustments, reversals, and reconciliation harder to interpret.

Instead, use a two-layer model:

  1. A financial ledger records distinct monetary events. Each reservation, charge, release, refund, or correction has its own identity, amount, currency, timestamp, and status.
  2. A customer-facing projection groups those events by request. It presents the current outcome in plain language while retaining a path to the underlying details.

This is a conceptual design pattern rather than a universal schema. Exact event names, posting rules, and state transitions depend on the billing model, payment-provider semantics, and the organization’s accounting policies.

What qualifies as a partially charged request

A partially charged request is one logical request for which the final charged amount is lower than the amount initially estimated, reserved, authorized, or requested.

For example, a usage-based service might estimate that a request will cost 10.00 and temporarily reserve that amount. When processing completes, the measured usage produces a final charge of 6.50. The remaining 3.50 is then released rather than charged.

The terms involved should be defined precisely:

  • A reservation or hold generally sets aside an amount while the final obligation is still being determined.
  • An authorization is permission to charge up to an amount under the applicable provider’s rules.
  • A charge or capture records the amount taken or posted. These terms may have different meanings in different systems.
  • A release or void removes an unused reservation or authorization.
  • Settlement refers to a later stage of financial completion in some payment systems and should not automatically be treated as synonymous with capture.
  • A refund returns an amount that was previously charged.
  • A reversal offsets or cancels an earlier event according to the implementation’s rules.
  • An expiration indicates that a reservation or authorization ended without a separate release action, where the provider supports that behavior.

The unused portion of a reservation is not necessarily a refund. If the 3.50 was never posted as a charge, it should ordinarily be shown as released, voided, or uncharged—not refunded.

Why a partial charge is not necessarily a partial payment

“Partial charge” and “partial payment” describe different business situations.

A partial charge generally means the service determined that less than the original estimate or reserved maximum was due. A partial payment often means that only part of an established obligation, such as an invoice, has been paid and an outstanding balance remains.

Calling the first case a partial payment may incorrectly suggest that the customer still owes money. Use that label only when it reflects the underlying commercial and accounting process.

Preserve one request identity and separate event identities

The request should have a stable identity that connects its operational purpose to all related financial events. Each event should then receive its own identity so it can be processed, retried, reconciled, or corrected independently.

Useful conceptual identifiers and attributes may include:

  • A request ID for the logical request
  • A ledger transaction ID for the financial transaction or posting group
  • An event ID for each reservation, charge, release, refund, or reversal
  • A parent or related event ID linking a correction or adjustment to the event it affects
  • An idempotency key for safely recognizing repeated processing attempts
  • Event and effective timestamps
  • Currency and amount
  • An event-level status

These are design considerations, not a mandatory field list. An implementation may require additional account, balance, provider, invoice, usage, or journal references. It should also define which identifiers originate internally and which are received from an external provider.

Define reconciliation invariants explicitly

A ledger design should state how its amounts are expected to reconcile. For a simple finalized request with no later adjustment, a useful conceptual invariant is:

> Initial reserved amount = amount charged + amount released

If 10.00 was reserved, 6.50 was charged, and 3.50 was released, the three amounts reconcile. If the request later receives a 1.00 refund, the system should retain the original 6.50 charge and record the 1.00 refund separately rather than rewriting the original charge as 5.50.

More complex workflows may involve multiple charges, fees, taxes, currency conversion, expiration, or provider-specific settlement behavior. Their invariants should be defined accordingly. The essential requirement is that the system can explain the relationship among:

  • The original estimate, reservation, or authorization
  • The amount actually charged
  • The amount released or left uncharged
  • Any amount still available for a later charge
  • Subsequent refunds, reversals, or adjustments

A displayed balance alone is not enough. The events that produced that balance must remain traceable within the financial system.

Conceptual example: reserve 10.00, charge 6.50, release 3.50

Consider this hypothetical sequence. The values are illustrative and do not prescribe a currency, posting order, or accounting treatment.

Logical request: REQ-1042

  1. Reservation created: 10.00 pending
  2. Charge posted: 6.50
  3. Unused reservation released: 3.50
  4. Request finalized: no amount remains available for another charge

The internal ledger would retain distinct records for the reservation, charge, and release. All three would link to REQ-1042, but each would have its own event identity and processing status.

The simplified customer-facing entry might read:

> Request completed — Final charge: 6.50 > 3.50 of the original reservation was released.

An expandable detail view could show that 10.00 was initially pending, 6.50 was posted, and 3.50 was released. This preserves transparency without forcing the customer to interpret raw ledger rows.

Keep the financial ledger separate from the activity-history projection

The ledger and the activity history serve different audiences and should not be treated as interchangeable views.

The ledger supports financial processing, correction, and reconciliation. The activity history helps a customer understand what happened. Both should derive from consistent amounts and relationships, but they do not need to use identical terminology or presentation.

The ledger preserves event-level financial facts

The internal ledger should retain the events necessary to reconstruct the request’s financial lifecycle. It should not overwrite an earlier event merely because the request has moved to a new status.

In an immutable ledger architecture, a correction is typically represented by a linked reversal or compensating event. In another correction-preserving architecture, an earlier record might be superseded while its history remains available. The appropriate method depends on the ledger model, but simply replacing the original amount or status can erase financially important context.

A request-level status may be derived from several event-level states. Illustrative statuses include:

  • Pending: a reservation exists, but no final charge has posted.
  • Partially charged: one or more charges have posted, while some reserved capacity remains open.
  • Completed: the final amount has been charged and no further charge is expected.
  • Released: the unused reservation has been made available again.
  • Failed: an attempted financial event did not complete.
  • Reversed: an earlier event has been offset or canceled.
  • Refunded: previously charged funds have subsequently been returned, in whole or in part.

These names are examples rather than a universal state machine. Teams should define whether statuses apply to the request, individual events, or both. They should also avoid collapsing distinct conditions—such as a failed capture and a successful release—into one ambiguous “failed” request status.

The activity history translates related events into one understandable request

A customer generally wants to know three things: how much is pending, how much was actually charged, and what happened to the difference.

The activity history can answer those questions by grouping related events under the stable request identity. A useful collapsed entry should:

  • Display the current request status in plain language
  • Show the final posted charge prominently
  • Distinguish a pending reservation from completed spend
  • Identify the amount released or left uncharged
  • Show the currency consistently
  • Provide meaningful timestamps and explain which event each timestamp represents
  • Allow expansion into reservation, charge, release, refund, or reversal details

Internal labels can remain precise while customer labels stay understandable. For example, an internal authorization_voided event might appear to the customer as “Unused reserved amount released.” The wording differs, but the amount, currency, timing, and relationship to the request must remain consistent.

Avoid exposing raw ledger rows as the only customer experience. Raw events can be technically accurate yet confusing when several rows appear to debit and credit the same request. Conversely, do not simplify the history to the point that it shows only a final balance and hides the reservation or release that affected the customer’s available funds.

Why pending reservations must not appear as completed spend

A reservation can temporarily affect available funds without representing a posted charge. Presenting it as completed spend may lead customers to believe they were charged twice when the final charge later appears.

During processing, the activity entry might say:

> Pending — Up to 10.00 reserved > The final charge will be based on completed usage.

After finalization, the same request-level entry can become:

> Completed — 6.50 charged > 3.50 released from the original reservation.

The history changes because its projection has changed; the underlying reservation event has not been rewritten. If provider timing means a release will not appear immediately in the customer’s external account, the interface should avoid promising an exact availability time unless that timing is known for the relevant provider and workflow.

Multiple partial charges and request finalization

Some workflows allow more than one charge against the same reservation. In that case, the request may remain open after the first partial charge.

Suppose 10.00 is reserved, followed by charges of 4.00 and 2.50. The system must know whether another charge is allowed against the remaining 3.50. That decision should follow an explicit rule, such as:

  • Keep the request open until a defined charging window closes.
  • Finalize it when the service reports that no more usage will accrue.
  • Finalize it when the unused amount is explicitly released.
  • Let the reservation expire under provider-specific rules.

The customer view can show a cumulative charge of 6.50 while allowing expansion into both charge events. It should not mark the request completed if another valid charge may still occur. Once the remaining amount is released or expires, the request-level projection can become final.

Retries, duplicate events, ordering, and concurrency

Partial-charge workflows often receive events more than once or in an unexpected order. The implementation should account for:

  • Retries and duplicate callbacks: Repeated delivery should not automatically create another charge or release. Idempotency keys and provider event identifiers can help recognize repetition.
  • Out-of-order events: A release notification may arrive before confirmation of the charge it follows. The system needs an ordering or dependency policy rather than relying only on arrival time.
  • Concurrent updates: Two workers may attempt to charge or release the same remaining amount. Atomic balance controls, locking, sequencing, or other concurrency mechanisms may be required.
  • Failed captures: A failed charge attempt should remain distinguishable from a successful charge, and the reservation should not be assumed released unless that transition actually occurs.
  • Expiration: An expired reservation may need a distinct event or provider-derived state so it is not confused with an explicit release.
  • Refunds and reversals: These should link to the affected posted event and should not erase the original financial history.
  • Reconciliation differences: Internal events, provider records, and customer-visible history may temporarily diverge. Exception handling should surface unresolved differences for investigation.

Idempotency and explicit state transitions reduce duplicate-processing and ambiguity risks, but they do not replace concurrency controls, event-ordering policies, exception handling, or periodic reconciliation.

Why neither layer should overwrite the other

The activity projection may change as new events arrive, but it should remain derived from the financial record—not become a substitute for it. Likewise, internal ledger terminology should not be exposed without considering whether customers can understand it.

A practical design keeps three concerns distinct:

  1. Financial truth: What monetary events occurred, and how are they related?
  2. Request state: Is the request still open, finalized, reversed, or adjusted?
  3. Customer explanation: What amount is pending, posted, released, or returned?

This separation makes it possible to improve customer wording without changing the financial record and to correct a financial event without concealing its history.

Implementation and review considerations

Before implementing a reservation and partial-charge lifecycle, product, engineering, finance, and operations teams should agree on the meaning of each event and status. They should document when a request becomes final, whether additional charges are permitted, how unused amounts are released, and how discrepancies are escalated.

Accounting, tax, stored-value, payment, and regulatory treatment varies by jurisdiction and implementation. Qualified legal, accounting, tax, payments, and compliance teams should review the chosen terminology, ledger behavior, customer disclosures, and operational controls. No ledger structure, including append-only or double-entry approaches, guarantees correctness or compliance on its own.

For usage-based AI services, this design pattern can help teams reason about estimated versus finalized consumption, but it is not a statement that Token Forge Cloud provides wallet, payment-processing, settlement, or customer transaction-history functionality.

Next step

Token Forge Cloud Managed Model APIs provide an API-first path for teams evaluating model demand, while Token Forge Cloud Private LLM Inference supports private deployment and serving-layer optimization. Our serving-layer work includes caching, routing, batching, quantization, and GPU scheduling, helping enterprises evaluate inference economics and operational control without conflating infrastructure usage measurement with payment-ledger functionality.

Contact Token Forge Cloud to discuss API access, private deployment, and LLM inference cost control.

Contact us