# Billing outcome consent handoff (awaiting API-first release)

Companion to API #610 checkout/card setup outcome tracking. All seven hosted checkout
call sites use the same helper to send the existing full analytics choice and,
only when allowed, the existing first-party session id. Existing request fields,
Authorization, redirect handling and abort signals are preserved.

SignalsProvider synchronizes the signed-in account choice on auth/consent changes,
including withdrawal, excluding support sessions. Existing GPC/DNT and limited /
replay-only / complete opt-out tiers remain governed by hasAnalyticsConsent.
No new banner, checkout control, Stripe configuration or payment behavior is added.

The API must ship and be confirmed healthy before this change for PostHog outcome capture.
Old APIs ignore the additional checkout field; consent sync failures do not block
product use. A network/offline failure cannot update server consent until a later
successful sync. Existing choices remain local until a signed-in synchronization;
this does not infer consent for historical payments/subscriptions.

Local tests: three VM tests of the actual helper cover all three route shapes,
request/abort preservation opt-out without session reads, and serialized sync reading the latest choice. Seven changed modules
transpiled using the isolated API compiler. Full Next build/tests passed CI. The paired real PR-environment proof now
passes 39 assertions across paid Sandbox checkout, zero-charge card setup, expiry
and opt-out; see `proof/billing-outcomes/`. Exact source identities, manual test
staging and production limitations are recorded there. Frontend #650 remains
draft until API #610 is deployed and healthy. Refresh requiredApiSha to that
actual API merge before readiness/merge; no deployment gate is bypassed.

Consent sync requests are serialized. The API captures the grant revision before
awaiting Stripe; a delayed checkout response cannot restore a withdrawn choice.
