Support Billing Evidence: How to Review Auto-Recharge Versus Post-Paid Attribution
For API auto-recharge versus post-paid billing, require a reconstructable link between an authorized support workload and its usage before finance signs the access review. A payment receipt alone cannot establish that li
For API auto-recharge versus post-paid billing, require a reconstructable link between an authorized support workload and its usage before finance signs the access review. A payment receipt alone cannot establish that link. Neither can a monthly total.
TL;DR: API auto-recharge and post-paid billing move the payment boundary; they do not establish who was authorized to incur each charge. With a prepaid balance, investigate recharge attempts and balance consumption separately. With post-paid billing, reconcile accrued usage before settlement. For either arrangement, retain complete attribution evidence while sampling diagnostic detail.
This decision record proposes a customer support review that finance can sign: which workload had access, which team owned it at execution time, and which usage remains unresolved. The analysis concerns evidence completeness rather than a provider's particular collection schedule or commercial terms. Payment behavior must be confirmed against the relevant agreement.
1. What evidence does finance need for API auto-recharge versus post-paid billing?
The invariant is that every billable usage entry resolves to a workload, an authorization decision, and the ownership mapping effective when it ran. A current directory lookup is insufficient for historical attribution: a credential may belong to a different support team by the time the review occurs. Preserve the mapping version alongside the usage reference. Keep secret values out of the evidence. The OWASP Secrets Management Cheat Sheet provides the relevant foundation for credential lifecycle management, access control, and auditing.
Consider an illustrative review covering two workloads, support-triage and support-reply. They belong to two teams and use three credential references during the review interval. Those numbers define a hypothetical fixture, not an observed deployment. A reviewer needs to distinguish legitimate credential rotation from an unowned caller. Treating both as a single account total removes precisely the distinction the signature is supposed to attest.
Count the dimensions.
If a metrics design permits 2 workload values, 2 team values, 3 credential references, and 4 outcomes, their Cartesian product contains 48 possible label combinations. That is a capacity bound for this fixture, not a claim that all combinations occur. Adding unique request references as metric labels makes the bound grow with requests. Store those references in the evidence records; use bounded dimensions for aggregate monitoring.
The proposed failure boundary is explicit: a payment failure is a payment event, missing attribution is an evidence failure, and an unauthorized request is an access failure. One must not silently stand in for another.
A funded account can still have an unsigned access review.
2. Separate the payment boundary from the evidence boundary
The following comparison describes review design choices. It does not assert universal provider behavior. In particular, retry policies, balance enforcement, collection dates, and spending limits require verification for the account under review.
| Arrangement | Evidence finance should examine | Failure the review must distinguish | Acceptance criterion |
|---|---|---|---|
| Prepaid balance with auto-recharge | Recharge attempt, funding confirmation, usage entries, opening and closing balance | Funding did not complete versus usage has no accountable owner | Reconcile confirmed funding and recorded usage separately; resolve unattributed entries |
| Post-paid billing | Accrued usage entries, ownership history, settlement reference | Liability attribution is incomplete versus settlement did not complete | Attribute accrued usage before signing; record settlement status independently |
| Either arrangement with sampled diagnostics | Complete billing evidence plus selected diagnostic traces | A dropped trace mistaken for absent usage | Preserve the usage ledger independently of diagnostic sampling |
For an auto-recharge design, finance should be able to ask whether funding was attempted, confirmed, or still unresolved without inferring those states from application availability. A local request rejection also needs an explicit cause. It should not automatically be classified as insufficient balance merely because the account is prepaid.
For a post-paid design, delay between execution and settlement gives an ownership error time to persist into the review. The proposed control is a reconciliation checkpoint before approval. This is a control choice, not a promise that a particular billing model prevents interruption. Both paths need duplicate handling. A replayed usage event must preserve its original identity; a second financial action requires its own identity. Conflating a retry with new consumption is an attribution error even when the final payment succeeds. For example, two accepted records carrying the same usage reference should trigger investigation before either becomes a second attributed charge. Checking only whether a payment reference exists would miss that distinction.
3. Exercise the critical path with a local review contract
The following curl requests define an illustrative interface for a self-hosted review service. They are not public provider APIs. Run them only after implementing this local contract on port 8080: idempotent event ingestion at /review-events, and review retrieval and signoff at /reviews/support-close. The service must apply authorization, retain event history, and derive the review from accepted events. These commands exercise that contract; curl alone does not implement it.
First, submit one support usage entry. The fixture uses abstract usage units so that no volatile price enters the test. The credential reference identifies an inventory entry, never a credential value. The required decision rule is that usage-support-001 appears once in the ledger and resolves to the named historical owner.
curl --fail-with-body --silent --show-error \
--request POST 'http://localhost:8080/review-events' \
--header 'Content-Type: application/json' \
--data '{"event_id":"usage-support-001","review_id":"support-close","kind":"usage","workload":"support-triage","team":"support-operations","credential_ref":"credential-03","ownership_version":7,"authorization_decision_ref":"decision-117","usage_units":120,"billing_mode":"prepaid"}'
Repeat that exact request during testing. The implementation should acknowledge the replay without adding another 120 units. Reject reuse of the same event identifier with different content. This protects the review against a common ambiguity: a caller retries because the response was lost, while the first submission already entered the ledger.
Next, submit a recharge attempt as a separate event. Its identifier belongs to the payment workflow. The proposed service must leave funding unconfirmed until a distinct confirmation arrives; an attempt contributes no confirmed funds to a balance reconciliation.
curl --fail-with-body --silent --show-error \
--request POST 'http://localhost:8080/review-events' \
--header 'Content-Type: application/json' \
--data '{"event_id":"funding-attempt-001","review_id":"support-close","kind":"recharge_attempt","payment_ref":"payment-041","state":"pending"}'
For the post-paid test variant, change the usage entry's billing mode to postpaid, assign a fresh event identifier, and start with an empty fixture ledger. Evaluate accrued usage without expecting a recharge event. Settlement evidence can arrive later. The attribution requirement remains identical.
Then retrieve the review. Require a version, attributed usage, unresolved ownership count, pending payment count, and reconciliation status. The service should expose these as separate results so the reviewer can identify what remains open.
A successful HTTP response only proves retrieval succeeded.
curl --fail-with-body --silent --show-error \
'http://localhost:8080/reviews/support-close'
Finally, attempt signoff against the version actually returned. Here, 1 is a fixture value: replace it with the current review version when exercising the service. A concurrent ownership correction must cause this condition to fail, forcing the reviewer to retrieve the revised evidence. Otherwise a signature can approve a document the signer never saw.
curl --fail-with-body --silent --show-error \
--request PATCH 'http://localhost:8080/reviews/support-close' \
--header 'Content-Type: application/json' \
--header 'If-Match: "1"' \
--data '{"action":"signoff","reviewer_ref":"finance-reviewer-02","scope":"access-and-attribution"}'
Under this contract, unresolved ownership blocks signoff. A pending payment is reported independently: signing access and attribution does not certify settlement. The review service must enforce the version condition and record the authenticated signer.
A body field naming a reviewer is context, not proof of identity.
Deploy the ingestion path and reconciliation view before enabling signatures. Test duplicate delivery, conflicting payloads, an unknown credential reference, a late ownership correction, and a stale review version. For each case, specify the expected ledger count and whether signoff is permitted. These checks test the evidence boundary directly; a green payment status would not exercise it.
4. Retain enough evidence without retaining every diagnostic byte
The retention budget should begin with the records needed to reconstruct a signature. As a hypothetical sizing exercise, 100,000 evidence events per day at 600 bytes each produce 60,000,000 bytes daily. Retaining 90 days gives 5,400,000,000 bytes, or 5.4 decimal GB, before indexes, replication, and other storage overhead. This is arithmetic for a planning assumption, not a measured footprint or a retention recommendation. The actual review interval and legal requirements determine the policy.
Now change the record size to 6,000 bytes by attaching diagnostic payloads. The same calculation becomes 54 GB before overhead. That tenfold difference comes entirely from the example's record sizes. No pricing claim is needed to justify separating compact financial evidence from verbose debugging material.
Keep the join keys. Sample the detail.
In this design, sampling diagnostic traces is acceptable only because the billing evidence stream remains complete within its declared scope. A 10% trace sample cannot establish that every usage entry has an owner. Sampling the only copy of the attribution record would make completeness unprovable for the omitted events. Preserve credential references, decision references, ownership versions, event identities, and reconciliation links; exclude raw secrets and unnecessary support conversation content.
Track ingestion lag and unresolved ownership counts using bounded labels. A request identifier belongs in the underlying record. Alert thresholds are local decisions, but the signoff rule should remain deterministic: no unexplained gap in the review interval, no unresolved owner, and a stable evidence version.
5. Rejected option: use payment totals as the access record
A receipt-only review is attractive because it keeps fewer records. Its limitation is that it cannot answer which support workload had authority when usage occurred. Auto-recharge receipts describe funding; post-paid settlement totals describe a financial outcome. Neither is sufficient evidence for the proposed access signature.
The trade-off in the proposed evidence ledger is additional ingestion, retention, and reconciliation work. It is not suitable for a team seeking only a cash-movement summary; a payment reconciliation is the narrower alternative for that job. Historical access approval, however, requires the ownership evidence that the summary omits.
Payment totals remain useful for a deliberately narrower cash reconciliation, where historical access attribution is outside the question. Use them there. For the support access review, choose the payment arrangement according to the verified funding and settlement boundaries, and require complete ownership evidence under either one. The signature should say exactly what was reviewed.
References
- OWASP Secrets Management Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.