Use Checkout Sessions first
Bumpgrade will create Checkout Sessions server-side for on-session purchases, subscriptions, order bumps, and future upsell paths before considering lower-level PaymentIntent flows.
Agent docs
Bumpgrade has a Stripe architecture, secret mapping, D1 commerce schema, billing-safe agent contract, self-serve live subscription checkout for Bumpgrade plans, sandbox publisher-offer Checkout Session path, constrained order-bump checkout start, sandbox webhook-backed entitlement grants, optional referral-click attribution evidence, review-only commission ledger evidence, owner review/reversal actions, non-billing post-purchase upsell/downsell decision evidence, owner-confirmed non-destructive product revocation intent records, and protected content readiness. Publisher-offer live billing and payout rollout remain deliberately separated.
Commerce source dataStatus
Sandbox path liveIssue #11 defines the contract. Issue #34 owns the first sandbox checkout path.Expected shape
Stripe node 22.1.1 is installed and pinned to API version 2026-04-22.dahlia.
Checkout Sessions are the first payment surface for on-session purchases and subscriptions.
Subscriptions use Stripe Billing patterns; future self-service changes should use Customer Portal before custom billing state.
Future publisher payout work uses Connect Accounts v2, not legacy account-type shortcuts.
Raw Stripe customer, checkout, payment, subscription, connected-account, webhook, and secret values stay server-private.
Decisions
Bumpgrade will create Checkout Sessions server-side for on-session purchases, subscriptions, order bumps, and future upsell paths before considering lower-level PaymentIntent flows.
Subscriptions, trials, upgrades, downgrades, cancellations, and payment-method updates should use Stripe Billing plus Checkout and Customer Portal patterns rather than hand-rolled renewal loops.
Publisher payout or marketplace flows will use Accounts v2 with explicit configuration, capabilities, dashboard access, and responsibility choices. No connected-account onboarding is live in this slice.
Every Stripe event must be keyed by its event id, store a payload hash, record processing status, and write redacted billing audit entries for state changes.
Public and agent-readable commerce routes expose stable Bumpgrade IDs, statuses, and source evidence. Raw Stripe customer, session, payment, subscription, and account IDs stay server-private.
Sandbox checkout
A one-time checkout offer used to prove Checkout Session creation, intent persistence, webhook idempotency, and redacted payment audit trails before live billing is enabled.
POST /api/commerce/checkout with confirmation text Create checkout for Bumpgrade launch pass at 9.00 USD. Without a valid sandbox secret, the endpoint returns a safe preview instead of calling Stripe.
The webhook route verifies raw Stripe signatures when configured, stores redacted event evidence, and updates matching checkout intents before fulfillment is trusted.
D1 contract
Canonical Bumpgrade product records for products, memberships, services, downloads, and future offers.
Stable price records mapped to Stripe Prices for one-time and subscription checkout.
Idempotent checkout-start record created before Stripe is called.
Public-safe evidence that a validated seeded referral click was attached to a sandbox checkout intent.
Non-billing post-purchase upsell/downsell decision evidence for trusted sandbox checkout intents before one-click charging exists.
Review-only, non-payable commission ledger evidence created from trusted checkout referral attribution before payout workflows exist.
Owner-gated review, hold, and reversal actions for review-only commission ledger evidence before payout mutation exists.
Webhook idempotency and redacted event evidence keyed by Stripe event id.
Subscription access state derived from Stripe Billing events.
Redacted audit trail for billing-impacting checkout, webhook, and agent actions.
Idempotent product access grants derived from trusted paid checkout webhook evidence.
Public-safe fulfillment queue evidence created with entitlement rows before private delivery exists.
Owner-confirmed private product asset upload records backed by PRODUCT_ASSETS without exposing object keys, signed URLs, upload bodies, or private metadata.
Owner-visible revocation intent records that document confirmation, stale-state, audit, and non-destructive boundaries before live entitlement removal exists.
Protected content readiness metadata for future course and member-area delivery without exposing protected bodies or enabling customer delivery.
Billing safety
Agents must not create, expire, refund, cancel, upgrade, downgrade, or publish a billing object without explicit confirmation text.
Model-visible output must not include raw Stripe secret keys, webhook secrets, customer IDs, Checkout Session IDs, PaymentIntent IDs, Subscription IDs, connected-account IDs, or private customer data.
Billing-impacting writes require actor identity, client attribution, idempotency key, audit correlation id, stale-state check, and redacted output.