> ## Documentation Index
> Fetch the complete documentation index at: https://aidocs.ethanbragdon.icu/llms.txt
> Use this file to discover all available pages before exploring further.

# Checkout & Provisioning Lifecycle

> Follow Starfire AI checkout from billing context selection through Stripe customer linkage, payment, webhook processing, reconciliation, and entitlements.

# Checkout & provisioning lifecycle

Starfire Billing 4.0 treats checkout as the beginning of a state transition, not the entire billing process.

## Lifecycle

```text theme={null}
Select personal or organization context
        ↓
Resolve BillingAccount
        ↓
Resolve/create Stripe Customer
        ↓
Create checkout for mapped price
        ↓
Customer completes Stripe payment flow
        ↓
Stripe updates subscription state
        ↓
Webhook processing
        ↓
Starfire subscription reconciliation
        ↓
Plan entitlements + credits provisioned
```

## 1. Choose billing context

Confirm whether the subscription belongs to your personal account or an organization before starting checkout.

## 2. Customer linkage

Starfire links the BillingAccount to a Stripe Customer before the subscription is treated as owned by the account context.

## 3. Price mapping

The selected Starfire plan maps to configured Stripe price identifiers. Production configuration—not documentation text—is the source of truth for active prices.

## 4. Payment completion

Completing Stripe checkout means the payment/subscription flow reached Stripe successfully. Starfire still needs to process and reconcile the resulting subscription state.

## 5. Provisioning

Entitlements, plan state, credits, and seat behavior are derived from reconciled billing state.

## If the page returns before access updates

Allow normal webhook/reconciliation processing to complete and refresh the billing view. Do not immediately create another checkout.

## Duplicate prevention

Billing 4.0 is designed around deterministic ownership and idempotent event handling so network retries or duplicate webhook delivery do not create duplicate entitlement grants.

<Warning>
  If payment succeeded but Starfire still shows the old plan, troubleshoot the existing billing chain. A second purchase can create a more complicated duplicate-subscription problem.
</Warning>
