{"id":"bumpgrade-commerce-source-data","updatedAt":"2026-05-22","stripeNodeVersion":"22.1.1","stripeApiVersion":"2026-04-22.dahlia","contract":{"id":"stripe-commerce-architecture-v1","issue":11,"firstCheckoutIssue":34,"status":"live","activeMode":"sandbox","summary":"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.","notLiveYet":["Publisher-offer live checkout is not enabled through /api/commerce/checkout.","No publisher payout or connected-account onboarding flow exists yet.","A live Stripe webhook signing secret is not currently listed in Cloudflare secret inventory."],"selfServePricing":{"id":"bumpgrade-self-serve-pricing-v1","status":"live","issue":316,"updatedAt":"2026-05-22","checkoutRoute":"/api/billing/checkout","successRoute":"/pricing/success","stripeMode":"live","publicPlans":[{"slug":"experiment","name":"Experiment","status":"self_serve","monthlyAmountCents":9700,"billingInterval":"month","productId":"product-bumpgrade-experiment","priceId":"price-bumpgrade-experiment-monthly-usd"},{"slug":"grow","name":"Grow","status":"self_serve","monthlyAmountCents":19700,"billingInterval":"month","productId":"product-bumpgrade-grow","priceId":"price-bumpgrade-grow-monthly-usd"},{"slug":"enterprise","name":"Enterprise","status":"contact","monthlyAmountCents":null,"billingInterval":"contact","productId":null,"priceId":null}],"setupAddon":{"slug":"white-glove-setup","name":"White glove","label":"Optional setup","description":"Paired with humans to help you set up and scale with confidence.","unitAmountCents":100000,"currency":"usd","productId":"product-bumpgrade-white-glove-setup","priceId":"price-bumpgrade-white-glove-setup-usd"},"provisioning":"Successful Stripe Checkout Sessions are verified server-side on /pricing/success and create active publisher plan entitlements keyed by buyer email.","webhookCaveat":"Cloudflare currently has live Stripe secret material configured, but live webhook signing secret setup is still a separate operational step."},"sandboxCheckout":{"issue":34,"orderBumpIssue":99,"entitlementGrantIssue":101,"checkoutEndpoint":"/api/commerce/checkout","webhookEndpoint":"/api/stripe/webhook","createsStripeCheckoutSession":true,"supportsConstrainedOrderBump":true,"grantsSandboxEntitlementsFromPaidWebhook":true,"supportsReferralAttributionEvidence":true,"supportsPostPurchaseDecisionEvidence":true,"liveModeEnabled":false},"referralAttribution":{"id":"checkout-referral-attribution-contract","status":"checkout-attribution-evidence-ready","issue":111,"parentIssue":19,"relatedIssues":[15,109],"checkoutApiRoute":"/api/commerce/checkout","sourceDataRoutes":["/commerce/source-data","/affiliates/source-data"],"tables":["checkout_referral_attributions"],"publicSafeFields":["checkoutIntentId","referralClickId","referralLinkId","referralCode","partnerId","destinationRoute","attributionStatus"],"serverPrivateFields":["audit_correlation_id","metadata_json","raw click rows","raw cookies","buyer identifiers","raw Stripe identifiers","payout or tax data"],"writeBoundary":"Issue #111 can attach a validated seeded referral click to a sandbox checkout intent as public-safe attribution evidence. Cookie assignment, buyer attribution finalization, commission writes, fraud enforcement, payout mutation, tax handling, partner notification, and direct agent affiliate writes require future confirmed-write APIs."},"affiliateCommissionLedger":{"id":"affiliate-commission-ledger-contract","status":"owner-review-actions-ready","issue":115,"parentIssue":19,"relatedIssues":[15,101,109,111,113],"apiRoute":"/api/affiliates/commission-ledger","confirmationText":"Create review-only commission evidence for Bumpgrade sandbox checkout","sourceDataRoutes":["/affiliates/source-data","/commerce/source-data"],"tables":["affiliate_commission_ledger_entries","affiliate_commission_ledger_actions"],"publicSafeFields":["commissionLedgerId","checkoutIntentId","referralAttributionId","referralClickId","referralLinkId","partnerId","grossSaleCents","commissionCents","ledgerStatus","reviewStatus","payoutStatus","reviewActionCounts"],"serverPrivateFields":["idempotency_key","audit_correlation_id","metadata_json","actor_user_id","actor_email","private action reason","buyer identifiers","raw Stripe identifiers","partner payout accounts","tax forms","private review notes"],"writeBoundary":"Issue #113 can create one review-only, non-payable commission ledger evidence row from a confirmed sandbox checkout intent that already has referral attribution. Issue #115 lets an owner-gated admin session apply idempotent review, hold, or reversal actions with exact confirmation and stale-state checks. Payable commission state, payout mutation, tax collection, fraud enforcement, partner notification, partner payout accounts, buyer attribution finalization, and direct agent affiliate writes require future confirmed-write APIs."},"affiliateCommissionReviewActions":{"id":"affiliate-commission-review-actions-contract","status":"owner-review-actions-ready","issue":115,"parentIssue":19,"relatedIssues":[15,111,113],"apiRoute":"/api/admin/affiliates/commission-ledger/actions","auth":"Better Auth owner session required","confirmationText":"Apply owner review action to Bumpgrade commission ledger evidence","allowedActions":[{"actionKind":"mark_reviewed","nextLedgerStatus":"review_only","nextReviewStatus":"owner_reviewed","nextPayoutStatus":"not_payable"},{"actionKind":"hold_for_review","nextLedgerStatus":"review_only","nextReviewStatus":"owner_hold","nextPayoutStatus":"not_payable"},{"actionKind":"reverse_evidence","nextLedgerStatus":"reversed","nextReviewStatus":"owner_reversed","nextPayoutStatus":"not_payable"}],"writeSafety":["owner session","exact confirmation text","idempotency key","expectedUpdatedAt stale-state check","audit correlation","public-safe redaction"],"writeBoundary":"Owner review actions may update only review-only commission ledger evidence status. They cannot create payable commission state, payout batches, Stripe payouts, tax records, partner notifications, fraud decisions, buyer attribution finalization, or direct agent writes."},"postPurchaseDecisions":{"id":"post-purchase-decision-contract","status":"non-billing-decision-ready","issue":117,"parentIssue":15,"relatedIssues":[34,81,99,101,111,113,115],"apiRoute":"/api/commerce/post-purchase-decisions","routePrefix":"/commerce/post-purchase","confirmationText":"Record non-billing post-purchase decision for Bumpgrade checkout","eligibleCheckoutStatuses":["paid","completed"],"allowedDecisions":[{"decisionKind":"accept_upsell_follow_up","presentedOfferId":"offer-upsell-launch-accelerator","billingMutationCreated":false},{"decisionKind":"decline_upsell","presentedOfferId":"offer-upsell-launch-accelerator","billingMutationCreated":false},{"decisionKind":"accept_downsell_follow_up","presentedOfferId":"offer-downsell-launch-review","billingMutationCreated":false},{"decisionKind":"decline_downsell","presentedOfferId":"offer-downsell-launch-review","billingMutationCreated":false}],"publicSafeFields":["decisionId","checkoutIntentId","offerStackId","presentedOfferId","decisionKind","checkoutStatus","checkoutUpdatedAt","aggregateDecisionCounts"],"serverPrivateFields":["idempotency_key","audit_correlation_id","raw Stripe identifiers","buyer email","payment method","private checkout metadata"],"writeBoundary":"Issue #117 can record non-billing post-purchase upsell/downsell decisions for trusted checkout intents. It cannot create Stripe charges, PaymentIntents, subscriptions, fulfillment, entitlement grants, payable commissions, payout state, tax records, partner notifications, or direct agent billing writes."},"secretNames":[{"name":"STRIPE_SECRET_KEY_SANDBOX","storage":"Cloudflare Worker secret and ignored local .env.local","visibility":"server-only"},{"name":"STRIPE_SECRET_KEY_LIVE","storage":"Cloudflare Worker secret and ignored local .env.local","visibility":"server-only"},{"name":"STRIPE_PUBLIC_KEY_SANDBOX","storage":"Cloudflare Worker secret and ignored local .env.local","visibility":"safe to expose only through an intentional public config route"},{"name":"STRIPE_PUBLIC_KEY_LIVE","storage":"Cloudflare Worker secret and ignored local .env.local","visibility":"safe to expose only through an intentional public config route"},{"name":"STRIPE_WEBHOOK_SECRET_SANDBOX","storage":"Cloudflare Worker secret when the webhook endpoint ships","visibility":"server-only"},{"name":"STRIPE_WEBHOOK_SECRET_LIVE","storage":"Cloudflare Worker secret when live billing is enabled","visibility":"server-only"}],"sourceReferences":[{"id":"stripe-docs-checkout-sessions","title":"Stripe Checkout Sessions API","url":"https://docs.stripe.com/api/checkout/sessions","retrievedAt":"2026-05-22","confidence":"high"},{"id":"stripe-docs-subscription-design","title":"Stripe subscription integration design","url":"https://docs.stripe.com/billing/subscriptions/design-an-integration","retrievedAt":"2026-05-22","confidence":"high"},{"id":"stripe-docs-accounts-v2","title":"Stripe Connect Accounts v2","url":"https://docs.stripe.com/connect/accounts-v2","retrievedAt":"2026-05-22","confidence":"high"},{"id":"stripe-node-changelog-22-1-0","title":"stripe-node 22.1.0 changelog","url":"https://github.com/stripe/stripe-node/blob/master/CHANGELOG.md","retrievedAt":"2026-05-22","confidence":"medium"}]},"decisions":[{"id":"commerce-decision-checkout-sessions-first","title":"Use Checkout Sessions first","status":"accepted","summary":"Bumpgrade will create Checkout Sessions server-side for on-session purchases, subscriptions, order bumps, and future upsell paths before considering lower-level PaymentIntent flows.","evidence":["Stripe Checkout Sessions represent a customer payment session for one-time purchases or subscriptions.","Checkout redirects keep payment collection off Bumpgrade's infrastructure for the first checkout path."]},{"id":"commerce-decision-billing-for-subscriptions","title":"Use Stripe Billing for recurring plans","status":"accepted","summary":"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.","evidence":["Stripe's subscription design guide starts with pricing model, checkout interface, and billing model choices.","Issue #16 product access and issue #15 checkout offers depend on subscription state staying provider-backed."]},{"id":"commerce-decision-connect-v2-later","title":"Use Connect Accounts v2 for future publisher payouts","status":"accepted","summary":"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.","evidence":["Stripe documents Accounts v2 as the unified identity model for connected accounts.","Bumpgrade needs creator payout responsibility decisions before enabling platform fund flows."]},{"id":"commerce-decision-idempotent-webhooks","title":"Webhook events are idempotent and auditable","status":"accepted","summary":"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.","evidence":["Billing-impacting writes are explicitly covered by Bumpgrade's agent-ready confirmed-write rules.","The D1 schema includes stripe_webhook_events and payment_audit_events before checkout code ships."]},{"id":"commerce-decision-no-public-provider-ids","title":"Public routes redact provider identifiers","status":"accepted","summary":"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.","evidence":["AGENTS.md requires raw provider identifiers and private user data to stay out of prompt-visible surfaces.","The commerce source-data route only returns schema and safety contract metadata."]}],"tables":[{"table":"commerce_products","status":"live","publicSafeFields":["id","slug","name","kind","status","description","fulfillment_kind"],"serverPrivateFields":["owner_user_id","metadata_json"],"purpose":"Canonical Bumpgrade product records for products, memberships, services, downloads, and future offers."},{"table":"commerce_prices","status":"live","publicSafeFields":["id","product_id","nickname","currency","unit_amount_cents","billing_interval","active"],"serverPrivateFields":["stripe_price_id","metadata_json"],"purpose":"Stable price records mapped to Stripe Prices for one-time and subscription checkout."},{"table":"checkout_intents","status":"live","publicSafeFields":["id","checkout_kind","status","product_id","price_id","amount_cents","currency","stripe_mode"],"serverPrivateFields":["idempotency_key","owner_user_id","buyer_user_id","buyer_email","stripe_checkout_session_id","stripe_payment_intent_id","stripe_subscription_id","success_url","cancel_url","audit_correlation_id","agent_client_id","metadata_json"],"purpose":"Idempotent checkout-start record created before Stripe is called."},{"table":"checkout_referral_attributions","status":"live","publicSafeFields":["id","checkout_intent_id","referral_click_id","referral_link_id","referral_code","partner_id","destination_route","attribution_status"],"serverPrivateFields":["checkout_product_id","checkout_price_id","audit_correlation_id","metadata_json","raw click rows","buyer identifiers","raw Stripe identifiers","payout or tax data"],"purpose":"Public-safe evidence that a validated seeded referral click was attached to a sandbox checkout intent."},{"table":"checkout_post_purchase_decisions","status":"live","publicSafeFields":["id","checkout_intent_id","offer_stack_id","presented_offer_id","decision_kind","checkout_status","checkout_updated_at","actor_kind","created_at"],"serverPrivateFields":["idempotency_key","audit_correlation_id","metadata_json","buyer identifiers","raw Stripe identifiers","payment method data","private checkout metadata"],"purpose":"Non-billing post-purchase upsell/downsell decision evidence for trusted sandbox checkout intents before one-click charging exists."},{"table":"affiliate_commission_ledger_entries","status":"live","publicSafeFields":["id","checkout_intent_id","referral_attribution_id","referral_click_id","referral_link_id","partner_id","source_checkout_amount_cents","commission_cents","ledger_status","review_status","payout_status"],"serverPrivateFields":["idempotency_key","audit_correlation_id","metadata_json","buyer identifiers","raw Stripe identifiers","partner payout accounts","tax forms","private review notes"],"purpose":"Review-only, non-payable commission ledger evidence created from trusted checkout referral attribution before payout workflows exist."},{"table":"affiliate_commission_ledger_actions","status":"live","publicSafeFields":["id","commission_ledger_id","checkout_intent_id","action_kind","previous_ledger_status","next_ledger_status","previous_review_status","next_review_status","next_payout_status","created_at"],"serverPrivateFields":["idempotency_key","actor_user_id","actor_email","private reason","metadata_json","buyer identifiers","raw Stripe identifiers","partner payout accounts","tax forms"],"purpose":"Owner-gated review, hold, and reversal actions for review-only commission ledger evidence before payout mutation exists."},{"table":"stripe_webhook_events","status":"live","publicSafeFields":["event_type","api_version","livemode","status","processed_at"],"serverPrivateFields":["id","payload_redacted_json","error"],"purpose":"Webhook idempotency and redacted event evidence keyed by Stripe event id."},{"table":"billing_subscriptions","status":"live","publicSafeFields":["id","product_id","price_id","status","current_period_start","current_period_end","cancel_at_period_end"],"serverPrivateFields":["owner_user_id","buyer_user_id","buyer_email","stripe_customer_id","stripe_subscription_id","stripe_price_id","metadata_json"],"purpose":"Subscription access state derived from Stripe Billing events."},{"table":"payment_audit_events","status":"live","publicSafeFields":["id","checkout_intent_id","event_kind","actor_kind","summary","created_at"],"serverPrivateFields":["stripe_event_id","actor_id","metadata_json"],"purpose":"Redacted audit trail for billing-impacting checkout, webhook, and agent actions."},{"table":"product_entitlements","status":"live","publicSafeFields":["id","checkout_intent_id","product_id","entitlement_template_id","access_rule_id","status","grant_kind","source_price_id","granted_at"],"serverPrivateFields":["source_stripe_event_id","source_commerce_product_id","buyer_user_id","buyer_email_hash","metadata_json"],"purpose":"Idempotent product access grants derived from trusted paid checkout webhook evidence."},{"table":"product_fulfillment_tasks","status":"live","publicSafeFields":["id","entitlement_id","checkout_intent_id","product_id","status","fulfillment_kind","summary"],"serverPrivateFields":["metadata_json"],"purpose":"Public-safe fulfillment queue evidence created with entitlement rows before private delivery exists."},{"table":"product_asset_uploads","status":"live","publicSafeFields":["id","product_id","asset_id","file_name","content_type","byte_count","body_sha256","status"],"serverPrivateFields":["idempotency_key","actor_user_id","actor_email_hash","r2_object_key","confirmation_text_sha256","metadata_json"],"purpose":"Owner-confirmed private product asset upload records backed by PRODUCT_ASSETS without exposing object keys, signed URLs, upload bodies, or private metadata."},{"table":"product_entitlement_revocation_intents","status":"live","publicSafeFields":["id","product_id","entitlement_template_id","access_rule_id","status","intent_kind","reason_code","destructive_action_enabled","entitlement_mutation_enabled"],"serverPrivateFields":["target_entitlement_id","idempotency_key","actor_user_id","actor_email_hash","confirmation_text_sha256","private_reason_sha256","metadata_json","future buyer identifiers","future private reason notes"],"purpose":"Owner-visible revocation intent records that document confirmation, stale-state, audit, and non-destructive boundaries before live entitlement removal exists."},{"table":"product_protected_content_sections","status":"live","publicSafeFields":["id","product_id","asset_id","entitlement_template_id","status","content_kind","title","public_summary","delivery_enabled","protected_body_included"],"serverPrivateFields":["metadata_json","lesson bodies","member post bodies","progress rows","private R2 object keys","signed URLs"],"purpose":"Protected content readiness metadata for future course and member-area delivery without exposing protected bodies or enabling customer delivery."}],"selfServePricing":{"contract":{"id":"bumpgrade-self-serve-pricing-v1","status":"live","issue":316,"updatedAt":"2026-05-22","checkoutRoute":"/api/billing/checkout","successRoute":"/pricing/success","stripeMode":"live","publicPlans":[{"slug":"experiment","name":"Experiment","status":"self_serve","monthlyAmountCents":9700,"billingInterval":"month","productId":"product-bumpgrade-experiment","priceId":"price-bumpgrade-experiment-monthly-usd"},{"slug":"grow","name":"Grow","status":"self_serve","monthlyAmountCents":19700,"billingInterval":"month","productId":"product-bumpgrade-grow","priceId":"price-bumpgrade-grow-monthly-usd"},{"slug":"enterprise","name":"Enterprise","status":"contact","monthlyAmountCents":null,"billingInterval":"contact","productId":null,"priceId":null}],"setupAddon":{"slug":"white-glove-setup","name":"White glove","label":"Optional setup","description":"Paired with humans to help you set up and scale with confidence.","unitAmountCents":100000,"currency":"usd","productId":"product-bumpgrade-white-glove-setup","priceId":"price-bumpgrade-white-glove-setup-usd"},"provisioning":"Successful Stripe Checkout Sessions are verified server-side on /pricing/success and create active publisher plan entitlements keyed by buyer email.","webhookCaveat":"Cloudflare currently has live Stripe secret material configured, but live webhook signing secret setup is still a separate operational step."},"plans":[{"slug":"experiment","name":"Experiment","label":"Start today","headline":"One launch workspace for the first serious offer.","monthlyAmountCents":9700,"billingInterval":"month","status":"self_serve","productId":"product-bumpgrade-experiment","priceId":"price-bumpgrade-experiment-monthly-usd","cta":"Start Experiment","description":"For publishers validating a funnel, checkout, product, and audience loop without stitching together five tools.","bestFor":"Solo publishers and small teams launching one offer at a time.","included":["1 Bumpgrade publisher workspace","Landing pages, funnel steps, checkout handoff, products, and audience capture","Bumpgrade subdomain reservation after payment","Basic launch analytics and AI-ready launch context","AI coach context for launch planning and review"]},{"slug":"grow","name":"Grow","label":"Most complete","headline":"More launch surface for publishers ready to scale.","monthlyAmountCents":19700,"billingInterval":"month","status":"self_serve","productId":"product-bumpgrade-grow","priceId":"price-bumpgrade-grow-monthly-usd","cta":"Start Grow","description":"For publishers who need richer automation, custom domain setup, affiliate tracking, and optimization reports.","bestFor":"Operators growing multiple offers, partners, or repeated launches.","included":["Everything in Experiment","Custom-domain onboarding for domains you already own","Affiliate/referral tracking and partner reporting","Advanced analytics, experiments, and launch alerts","Higher plan limits through configurable plan access"]},{"slug":"enterprise","name":"Enterprise","label":"Custom","headline":"SSO, custom development, and launch systems for teams.","monthlyAmountCents":null,"billingInterval":"contact","status":"contact","productId":null,"priceId":null,"cta":"Contact us","description":"For teams that need SSO, custom development, dedicated implementation help, or unusual billing and data boundaries.","bestFor":"Agencies, publishers with internal teams, and operators with special requirements.","included":["Everything in Grow","SSO planning","Custom development and integration support","Dedicated launch architecture review","Team-specific security, data, and workflow requirements"]}],"setupAddon":{"slug":"white-glove-setup","name":"White glove","label":"Optional setup","description":"Paired with humans to help you set up and scale with confidence.","unitAmountCents":100000,"currency":"usd","productId":"product-bumpgrade-white-glove-setup","priceId":"price-bumpgrade-white-glove-setup-usd"}},"sandboxCheckout":{"offer":{"id":"sandbox-launch-pass","productId":"product-bumpgrade-sandbox-launch-pass","priceId":"price-bumpgrade-sandbox-launch-pass-usd","name":"Bumpgrade launch pass","summary":"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.","currency":"usd","unitAmountCents":900,"billingInterval":"one_time","mode":"sandbox","issue":34,"status":"sandbox-live"},"orderBumps":[{"id":"offer-bump-launch-checklist","priceId":"price-launch-checklist-bump-usd","productId":"product-launch-checklist-bump","unitAmountCents":1900,"currency":"usd"}],"supportsOrderBumps":true,"supportsReferralAttributionEvidence":true,"routes":{"start":"/api/commerce/checkout","webhook":"/api/stripe/webhook","redirect":"/api/commerce/checkout/redirect","success":"/commerce/checkout/success","cancel":"/commerce/checkout/cancel"},"postPurchaseDecisionRoute":"/api/commerce/post-purchase-decisions","postPurchaseRoutePrefix":"/commerce/post-purchase","confirmation":{"required":true,"text":"Create checkout for Bumpgrade launch pass at 9.00 USD"},"rawStripeIdsIncluded":false},"postPurchaseDecisions":{"contract":{"id":"post-purchase-decision-contract","status":"non-billing-decision-ready","issue":117,"parentIssue":15,"relatedIssues":[34,81,99,101,111,113,115],"apiRoute":"/api/commerce/post-purchase-decisions","routePrefix":"/commerce/post-purchase","confirmationText":"Record non-billing post-purchase decision for Bumpgrade checkout","eligibleCheckoutStatuses":["paid","completed"],"allowedDecisions":[{"decisionKind":"accept_upsell_follow_up","presentedOfferId":"offer-upsell-launch-accelerator","billingMutationCreated":false},{"decisionKind":"decline_upsell","presentedOfferId":"offer-upsell-launch-accelerator","billingMutationCreated":false},{"decisionKind":"accept_downsell_follow_up","presentedOfferId":"offer-downsell-launch-review","billingMutationCreated":false},{"decisionKind":"decline_downsell","presentedOfferId":"offer-downsell-launch-review","billingMutationCreated":false}],"publicSafeFields":["decisionId","checkoutIntentId","offerStackId","presentedOfferId","decisionKind","checkoutStatus","checkoutUpdatedAt","aggregateDecisionCounts"],"serverPrivateFields":["idempotency_key","audit_correlation_id","raw Stripe identifiers","buyer email","payment method","private checkout metadata"],"writeBoundary":"Issue #117 can record non-billing post-purchase upsell/downsell decisions for trusted checkout intents. It cannot create Stripe charges, PaymentIntents, subscriptions, fulfillment, entitlement grants, payable commissions, payout state, tax records, partner notifications, or direct agent billing writes."},"summary":{"status":"available","aggregateCounts":[{"offer_stack_id":"checkout-stack-indie-launch-sandbox","presented_offer_id":"offer-upsell-launch-accelerator","decision_kind":"accept_upsell_follow_up","total_decisions":1,"last_created_at":1779177215}],"rawRowsIncluded":false,"privateDataIncluded":false,"billingMutationsIncluded":false,"fulfillmentRowsIncluded":false,"entitlementRowsIncluded":false}},"referralAttribution":{"contract":{"id":"checkout-referral-attribution-contract","status":"checkout-attribution-evidence-ready","issue":111,"parentIssue":19,"relatedIssues":[15,109],"checkoutApiRoute":"/api/commerce/checkout","sourceDataRoutes":["/commerce/source-data","/affiliates/source-data"],"tables":["checkout_referral_attributions"],"publicSafeFields":["checkoutIntentId","referralClickId","referralLinkId","referralCode","partnerId","destinationRoute","attributionStatus"],"serverPrivateFields":["audit_correlation_id","metadata_json","raw click rows","raw cookies","buyer identifiers","raw Stripe identifiers","payout or tax data"],"writeBoundary":"Issue #111 can attach a validated seeded referral click to a sandbox checkout intent as public-safe attribution evidence. Cookie assignment, buyer attribution finalization, commission writes, fraud enforcement, payout mutation, tax handling, partner notification, and direct agent affiliate writes require future confirmed-write APIs."},"summary":{"status":"available","aggregateCounts":[{"referral_link_id":"ref-link-launch-circle-waitlist","referral_code":"LAUNCHCIRCLE","partner_id":"affiliate-partner-launch-circle","destination_route":"/funnels/indie-launch-sandbox","attribution_status":"checkout_intent_attached","total_checkouts":3,"last_attached_at":1779174659}],"rawRowsIncluded":false,"privateDataIncluded":false,"commissionRowsIncluded":false}},"affiliateCommissionLedger":{"contract":{"id":"affiliate-commission-ledger-contract","status":"owner-review-actions-ready","issue":115,"parentIssue":19,"relatedIssues":[15,101,109,111,113],"apiRoute":"/api/affiliates/commission-ledger","confirmationText":"Create review-only commission evidence for Bumpgrade sandbox checkout","sourceDataRoutes":["/affiliates/source-data","/commerce/source-data"],"tables":["affiliate_commission_ledger_entries","affiliate_commission_ledger_actions"],"publicSafeFields":["commissionLedgerId","checkoutIntentId","referralAttributionId","referralClickId","referralLinkId","partnerId","grossSaleCents","commissionCents","ledgerStatus","reviewStatus","payoutStatus","reviewActionCounts"],"serverPrivateFields":["idempotency_key","audit_correlation_id","metadata_json","actor_user_id","actor_email","private action reason","buyer identifiers","raw Stripe identifiers","partner payout accounts","tax forms","private review notes"],"writeBoundary":"Issue #113 can create one review-only, non-payable commission ledger evidence row from a confirmed sandbox checkout intent that already has referral attribution. Issue #115 lets an owner-gated admin session apply idempotent review, hold, or reversal actions with exact confirmation and stale-state checks. Payable commission state, payout mutation, tax collection, fraud enforcement, partner notification, partner payout accounts, buyer attribution finalization, and direct agent affiliate writes require future confirmed-write APIs."},"ownerReviewActions":{"id":"affiliate-commission-review-actions-contract","status":"owner-review-actions-ready","issue":115,"parentIssue":19,"relatedIssues":[15,111,113],"apiRoute":"/api/admin/affiliates/commission-ledger/actions","auth":"Better Auth owner session required","confirmationText":"Apply owner review action to Bumpgrade commission ledger evidence","allowedActions":[{"actionKind":"mark_reviewed","nextLedgerStatus":"review_only","nextReviewStatus":"owner_reviewed","nextPayoutStatus":"not_payable"},{"actionKind":"hold_for_review","nextLedgerStatus":"review_only","nextReviewStatus":"owner_hold","nextPayoutStatus":"not_payable"},{"actionKind":"reverse_evidence","nextLedgerStatus":"reversed","nextReviewStatus":"owner_reversed","nextPayoutStatus":"not_payable"}],"writeSafety":["owner session","exact confirmation text","idempotency key","expectedUpdatedAt stale-state check","audit correlation","public-safe redaction"],"writeBoundary":"Owner review actions may update only review-only commission ledger evidence status. They cannot create payable commission state, payout batches, Stripe payouts, tax records, partner notifications, fraud decisions, buyer attribution finalization, or direct agent writes."},"summary":{"status":"available","aggregateCounts":[{"referral_link_id":"ref-link-launch-circle-waitlist","referral_code":"LAUNCHCIRCLE","partner_id":"affiliate-partner-launch-circle","ledger_status":"review_only","review_status":"refund_window_open","payout_status":"not_payable","total_ledgers":2,"total_source_checkout_amount_cents":5600,"total_commission_cents":920,"last_created_at":1779174660}],"reviewActionCounts":[],"rawRowsIncluded":false,"privateDataIncluded":false,"payableRowsIncluded":false,"payoutRowsIncluded":false,"taxRowsIncluded":false,"partnerNotificationsIncluded":false}},"agentWriteRules":["Agents may read public-safe commerce source-data without a private session.","Agents must not create, expire, refund, cancel, upgrade, downgrade, or publish a billing object without explicit confirmation text.","Billing-impacting writes require actor identity, client attribution, idempotency key, audit correlation id, stale-state check, and redacted output.","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.","Referral attribution evidence may link a seeded referral click to a checkout intent, review-only commission ledger evidence may calculate draft commission amounts, owner review actions may review, hold, or reverse that evidence, post-purchase decisions may record non-billing follow-up intent, and owner product revocation intents may record non-destructive access-removal intent, but none may create payable commissions, payout state, fraud decisions, tax records, partner notifications, fulfillment, entitlements, access removal, refunds, or one-click charges.","If an event or provider response is ambiguous, record the blocked state and continue with non-billing work instead of guessing."]}