Conversation
## Context The only public way to remove credits was voided_credits, which voids an amount from the wallet pool in consumption order, with no way to target a specific grant. A customer granting pooled credits per source (for example free monthly credits) needs to revoke one grant's unused remainder without touching the rest of the pool. ## Description Add an optional voided_transaction_id to POST /wallet_transactions. Given alone it voids the targeted inbound grant's entire remaining balance; given with voided_credits it voids that amount from the grant, capped at its remaining. voided_credits alone keeps the pool-wide behavior. Targeting requires a traceable wallet and a settled inbound that still has a remaining balance; the underlying VoidService already validates and decrements only that grant's ledger row.
aquinofb
requested review from
a team,
mariohd and
vincent-pochet
and removed request for
a team
July 22, 2026 16:28
vincent-pochet
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Wallet transactions expose
voided_credits, which voids an amount from the wallet pool in consumption order (priority, then granted-before-purchased, then oldest first). There was no way to target a single grant, so a customer granting pooled credits per source (for example free monthly credits) could not revoke one grant's unused remainder without disturbing the rest of the pool.Changes
voided_transaction_idtoPOST /api/v1/wallet_transactions. On its own it voids the targeted inbound grant's entire remaining balance; combined withvoided_creditsit voids that amount from the grant, capped at its remaining.voided_creditson its own keeps the existing pool-wide behavior, so nothing changes for current callers.422:wallet_not_traceable,wallet_transaction_not_found, andno_remaining_amount.VoidServicealready validates the amount against the grant's remaining balance and decrements only that grant's ledger row.Pairs with the metadata filter (#5998), which is how a caller locates the grant to void. Targeted restore is intentionally left for a follow-up.