Account Bans and Prepaid Balance Refunds: Technical Governance for Identity, Ledgers, and Regional Access Controls
This article treats the "banned account, forfeited prepaid balance" dispute as an engineering problem rather than a PR one. It explains why prepayments are contract liabilities before revenue recognition, why identity and funds should be separated into independent state machines, how to design an auditable refund pipeline with immutable double-entry ledgers, how to layer regional access enforcement, how to build provider abstraction and multi-route fallback on the application side, and what to check in vendor due diligence before signing a contract with an AI model service.
1. Reframing the dispute as an engineering problem
Public filings from overseas AI model service vendors were recently read by media outlets as attributing roughly USD 2.3 billion of the first three quarters’ revenue to a set of one-time accounts from a single restricted region — about 7% of total revenue.
The dispute is not about the size of the revenue. It is about what happened afterwards: once those accounts were banned, the unused prepaid balance inside them was frozen outright and never returned.
Strip away brand, share price, market cap, and the public argument, and three questions remain that can be discussed objectively on engineering grounds:
- Ownership of funds. Money a user has prepaid but for which service has not yet been delivered — who does it belong to, under accounting practice and under the contract?
- Strength of the control. If a platform declares that it does not serve a given region, is its access control a best-effort notice, or a verifiable enforced constraint?
- Application-side dependency. When a core business path is hard-wired to a single offshore model service, what order of magnitude of continuity risk does an account disposal event introduce?
None of these are one vendor’s private problem. Any team building cross-border SaaS, AI applications, or products for international markets will hit them. Each is unpacked below.
2. Why “ban the account, seize the balance” is a bad design
2.1 Before revenue recognition, a prepayment is a liability, not profit
Under widely used revenue recognition principles, when a company receives a customer prepayment but has not yet fulfilled the corresponding service obligation, the amount is recorded as contract liabilities (deferred revenue). It only converts to revenue when the service is actually delivered and the performance obligation is satisfied.
Put differently: the remaining token quota inside a banned account corresponds to compute and inference capacity that has not yet been delivered. On the balance sheet, that money is “a service owed to the customer”, not “money earned”. Converting it straight into profit is effectively writing off a liability unilaterally — which is hard to pass under external audit and internal control review. It lacks evidence that the obligation was released by agreement with the customer, and lacks a basis for valuing the unperformed obligation.
2.2 Three concrete risks
- Regulatory and consumer protection risk. Most jurisdictions constrain how prepaid and stored-value balances may be disposed of. Unilateral forfeiture is easily characterized as an unfair contract term.
- Payment channel chargeback risk. Funds paid through the original channel are traceable. Once a user files a chargeback, the platform must not only refund the amount but may also absorb dispute handling costs, rising chargeback-rate penalties, and in some cases a downgrade in risk standing. Not refunding money that could be refunded converts certain revenue into an uncertain contingent liability.
- Reputation and trust cost. For developers, the most painful part of an account disposal is usually not the balance but service interruption and migration cost. A vendor known to forfeit balances will almost certainly be challenged during enterprise procurement review.
2.3 Conclusion
From legal, financial, and product perspectives alike, “banning” and “forfeiting” should be two independently decided actions. Disposal of an identity should not automatically trigger disposal of funds.
3. Decoupling identity from the ledger: account state machine design
The correct approach is to split the identity account from the funds ledger (wallet) into two independent objects, each with its own state machine, linked by events rather than hard binding.
3.1 Recommended state decomposition
| Object | State | Meaning |
|---|---|---|
| Identity account | ACTIVE |
Fully usable |
RESTRICTED |
Partial capability restriction (e.g. only data export and the refund entry remain) | |
SUSPENDED |
Service paused, pending review or appeal | |
TERMINATED |
Service relationship ended; enters the refund and data disposal flow | |
| Funds account | AVAILABLE |
Can be spent normally |
HELD |
Frozen / pending review; not spendable but not writable off | |
SETTLED |
Consumed and converted to revenue | |
REFUND_PENDING |
Refund in progress | |
REFUNDED |
Returned to the original channel | |
FORFEITED |
Written off per contract terms (requires strong audit trail and legal sign-off) |
The key constraint: SUSPENDED and TERMINATED may only change whether the funds account is spendable; they must not change whether it is refundable. FORFEITED must be a path that requires explicit approval, separate accounting treatment, and traceable justification — not a default side effect of a state transition.
3.2 Pseudocode constraints on state transitions
function transition_identity(account_id, target_state, reason_code, operator):require operator.role in {RISK_ANALYST, COMPLIANCE_OFFICER}account = load(account_id)assert is_valid_transition(account.state, target_state) # explicit transition table; arbitrary jumps forbiddenevent = emit_event("identity.state_changed",account_id, account.state, target_state,reason_code, operator.id, timestamp)# Link spendability only; never write off the balancewallet = load_wallet(account.wallet_id)if target_state in {SUSPENDED, TERMINATED}:wallet.set_consumable(false) # stop offsetting usagewallet.open_refund_case(account_id) # open the refund case at the same timeappend_audit_log(event) # append-only audit log; immutable
3.3 Replace “add and subtract on the balance” with a double-entry ledger
Directly incrementing and decrementing a balance field is the technical root cause of this class of incident: once it goes wrong it cannot be reconstructed, and it cannot distinguish “frozen” from “forfeited”. Prefer an immutable transaction stream plus double-entry design:
entry:entry_id uuidaccount_id reftype TOPUP | RESERVE | CONSUME | RELEASE | REFUND | ADJUSTamount_minor int64 # integer in the smallest currency unit; floating point forbiddencurrency char(3) # multi-currency must be recorded explicitly; implicit conversion forbiddenbalance_after int64 # snapshot, for reconciliationref_id uuid # top-up order / refund order / case idcreated_at timestampactor string # user / system job / human operator
Every balance change is a pair: RESERVE → CONSUME or RESERVE → RELEASE, and only RELEASE may flow into REFUND. At the data-structure level, “service not delivered, so refund it” becomes the natural path, while “forfeit” becomes an exception that has to be constructed deliberately.
4. The refund pipeline: refundable, traceable, auditable
4.1 Eligibility checks and preconditions
A refund is not a single transfer. It is a pipeline with preconditions:
- Eligibility decision. A policy engine evaluates “ban reason + account state + balance composition + time window” and returns a conclusion (refundable / partially refundable / not refundable per terms) plus a reason code.
- Source-of-funds and compliance screening. Funds that hit sanctions lists, suspected fraud or cash-out patterns, virtual cards, or stolen cards require manual review rather than automatic refund. This point matters: an unconditional automatic refund becomes a cash-out channel for fraud rings.
- Original route first. The original payment channel is traceable and has the lowest dispute rate; only when it is closed or past its time limit should an alternative route be used.
- Idempotency and approval. Refund requests are deduplicated with a business idempotency key; amounts above a threshold require dual approval.
- Audit trail. Every step writes to an immutable log and retains the policy version number, so the reasoning behind a decision can be reproduced later.
4.2 Pseudocode
function request_refund(account_id, reason_code):case = load_or_create_refund_case(account_id) # idempotent: one case per account per reasonif case.state == REFUNDED: return already_done(case)wallet = load_wallet(account_id)policy = policy_engine.evaluate(reason_code, account, wallet)# policy -> { decision: REFUND|FULL|REVIEW|DENY, amount_minor, reason }if policy.decision == REVIEW:return route_to_manual_review(case, policy.reason)if policy.decision == DENY:# an appeal path and the clause reference are mandatory; silent closure is not allowedreturn notify_with_appeal(case, policy.reason, policy.clause_ref)payment = resolve_refund_route(case.original_payment) # original channel -> fallback channelif payment == NONE:return hold_and_notify(case, "channel unavailable; waiting for a manual plan")ledger.reserve_refund(wallet.id, policy.amount_minor) # reserve first so other flows cannot claim itresult = payment_gateway.refund(idempotency_key = "refund:" + case.id,amount_minor = policy.amount_minor,currency = wallet.currency,target = payment)ledger.commit_refund(wallet.id, case.id, result)notify(case.owner, result)return result
4.3 Edge cases that are easy to miss
- Partial refunds. Consumed usage is not refunded; unconsumed balance is. Promotional credits and paid top-ups must be distinguished, so the ledger should tag different
bucketvalues. - FX and fees. Cross-border refunds via the original route incur exchange loss and channel fees. The party bearing them should be agreed in the contract up front, not deducted from the balance after the fact.
- Refund deadlines. Chargeback dispute windows are usually much shorter than an internal approval cycle, so the process needs buffer time.
- Keep data disposal and refunds decoupled. Exporting data, deleting data, and returning the balance are three independent actions. Do not make the refund a prerequisite for data export.
- Reconciliation loop. Run a daily three-way reconciliation of top-ups, consumption, and refunds. Any entry that fails to balance must raise an alert, not be silently corrected.
5. Regional access: enforced constraints and layered checks
The other half of the dispute is whether the platform was actually enforcing regional restrictions. Technically, the available signals are layered, with different strength and different false-positive rates:
| Layer | Available signals | Strength | Main problem |
|---|---|---|---|
| Network | Outbound IP attribution, ASN properties, datacenter/proxy range detection | High | Misclassification of mobile and CDN egress; collateral impact on travel and cross-border remote work |
| Identity | Registration and billing country, tax information, registered entity location | High | May not match actual usage location; the contracting entity should govern |
| Payment | Issuing bank country, card BIN, channel availability by region | Very high | Virtual cards, third-party payments, top-ups paid on a user’s behalf |
| Behavioral | Time zone, language, request latency, usage hours | Low | Supporting signal only; must never be the sole basis for enforcement |
| Contractual | Territorial terms of service, data processing and cross-border transfer arrangements | Decisive | Requires joint sign-off from legal and procurement |
The reasonable engineering practice is: treat identity and payment layers as the primary determinants, feed network and behavioral signals into a risk score, and on a high-risk hit first degrade capability or require step-up verification rather than terminate immediately. An appeal and manual review channel is mandatory, otherwise every error in a geolocation dataset turns into a customer complaint.
As for “the various ways around this” — residential proxies, virtual cards, falsified entity information, shared accounts — one thing should be stated plainly: these are attempts to circumvent the access controls set by the service provider. Under most platforms’ terms they constitute a breach in their own right, and the possible consequences include termination of service, disposal of the balance, payment channel disputes, and even legal liability. Worse, they escalate a “regional compliance problem” into a “fraud problem”. These paths do exist technically, but they are not a recommendable engineering approach. Any design that documents “how to bypass a platform’s regional restriction” should be rejected at architecture review.
Only two paths are genuinely sustainable: use the official channels for the regions and enterprise procurement that the provider actually offers, or deploy inference in a compliant in-region form. The domestic cloud market offers compliant options — for example, in-region model services from enterprise providers such as Baidu AI Cloud, dedicated deployment forms, and RMB settlement — which align better with local requirements around data export, invoicing, and consistency between contracting entity and business operations. Specific capabilities and terms should be taken from the official documentation and commercial contract; nothing beyond public information is inferred here.
6. Application-side risk control: provider abstraction and multi-route fallback
More important to enterprises than the refund dispute is this: if your core path hard-codes a single offshore model service, one account disposal event equals one outage. An abstraction layer is the only effective technical mitigation.
6.1 A unified adapter interface
interface ModelProvider {chat(request) -> ChatResultembed(request) -> EmbeddingResulthealth() -> ProviderStatus # availability, rate-limit state, remaining quotaprice_per_unit(model) -> Pricing}class ProviderA implements ModelProvider { ... } // commercial offshore serviceclass ProviderB implements ModelProvider { ... } // compliant in-region serviceclass LocalDeploy implements ModelProvider { ... } // self-hosted / dedicated deployment
Upper layers depend only on ModelProvider. No vendor-specific request shape, authentication scheme, or error code should leak into business code.
6.2 Routing and fallback strategy
function route(task):candidates = registry.filter(capability = task.capability, # capability tag, not a model nameregion_ok = task.data_class, # data classification decides whether egress is permittedquota_left = true,health = HEALTHY).sort_by(cost, latency)for provider in candidates:try:result = provider.chat(task.request, timeout = task.timeout)metrics.record(provider.id, task.capability, result.latency, result.tokens)return resultcatch RateLimited | Timeout | AuthFailed | RegionBlocked:breaker.trip(provider.id) # trip the breaker; stop sending doomed requestscontinuereturn fallback.degrade(task) # cached result / rule-based fallback / explicit error
A few practical points:
- Route on capability tags, not specific model versions. Otherwise every provider swap forces business code changes.
- Data classification comes first. For requests containing personal information or important data, whether they may leave the region is decided by the data classification result, not by route availability.
- Contract tests. Every provider adapter should run the same test suite, so behavior stays consistent after a switch.
- Regression evaluation set. Maintain an evaluation set with reference answers (accuracy, format compliance, refusal rate, long-context behavior). When switching providers, let data decide rather than intuition.
- Async and batch fallback. Put non-realtime work on a queue so it can be retried when a provider misbehaves instead of failing outright.
7. Cost and usage governance: make the bill explainable
The biggest pain point of prepaid models is “nobody can explain where the money went”. At minimum, aim for:
- Request-level token accounting. Log
tenant_id / feature / model / input_tokens / output_tokens / costfor every request, ship it to a log service, and build aggregated dashboards. - Per-tenant quotas and budget alerts. Set daily/monthly caps by tenant, environment, and feature. Alert at 80%, trip the breaker past the cap, so a single bug cannot burn through the budget.
- Caching and semantic deduplication. Exact caching plus similarity deduplication for high-frequency repeats (system prompts, common questions, fixed RAG fragments) is usually the fastest cost reduction available.
- Prompt and context slimming. Inject only necessary context, compress conversation history, and place static prefixes where they can be cached.
- Reconciliation and audit. Reconcile billing records against internal usage records daily and alert when the gap exceeds a threshold; log every quota change.
8. Procurement and compliance due diligence checklist
Before signing a contract with any offshore AI service, put these items on the review sheet:
- Serviceable regions. Are the contracting entity, terms of service, and data processing locations explicit? Is there a right to change them unilaterally?
- Account disposal and balance policy. What happens to unconsumed balance when an account is terminated? Are refund terms, deadlines, and fees defined? Require this in writing; do not rely on verbal assurances from support.
- Payment and settlement. Settlement currency, who bears FX risk, whether the invoicing entity matches the contracting entity, and whether cross-border fund-flow reporting applies.
- Compliance documentation. Data processing agreement (DPA), data retention and deletion mechanisms, opt-out from model training, security audit reports.
- Business continuity. Is there a second provider? Have the switching cost and the cutover window actually been rehearsed?
- Content and generation compliance. Depending on the market, generative AI services may also be subject to content management, filing or registration, and output labeling requirements — confirm the applicable local rules.
9. Conclusion
Abstracted into an engineering problem, the conclusions are fairly plain:
- Money for undelivered service is not profit. Use ledgers and state machines to decouple “stop service” from “dispose of funds”, so that refunds are the default path and forfeiture is an approval-gated exception. That is a design and compliance question, not a business-model preference.
- Access control must be layered and appealable. Any single-signal verdict will produce false positives. Behavioral signals are supporting scores; the contracting entity and payment information are the primary basis.
- Bypassing regional restrictions is not an engineering solution. It converts a compliance problem into fraud and contract risk, and should be rejected at architecture review.
- The real moat is on the application side. A provider abstraction layer, multi-route fallback, and a regression-capable evaluation set determine whether your business keeps running when an account or a regional policy changes.
- Prefer compliant paths. Use official channels, or in-region deployment with a compliant settlement structure, and resolve data export, invoicing, and filing — unglamorous but potentially fatal — before they become blockers.
The right posture toward a vendor is “usable, testable, replaceable” — not “cannot live without it, work around it, accept whatever happens if it gets banned”. The former is an architecture capability. The latter is luck.
