{"ok":true,"product":"Dungeon Academy","endpointVersion":"membership-stripe-setup-v1","generatedAt":"2026-07-24T00:26:21.289Z","plan":{"id":"dungeon-academy-monthly","priceLabel":"$19/month","interval":"month"},"readiness":{"checkoutRedirectReady":false,"serverCheckoutSessionReady":false,"webhookActivationReady":false,"trustedManualActivationReady":false,"parentSessionReady":false,"fullStripeOpsReady":false},"endpoints":{"setupApiUrl":"/api/dungeon-academy/membership/stripe/setup/v1","membershipStatusApiUrl":"/api/dungeon-academy/membership/status/v1","checkoutApiUrl":"/api/dungeon-academy/membership/checkout/v1","entitlementApiUrl":"/api/dungeon-academy/membership/entitlement/v1","adminApiUrl":"/api/dungeon-academy/membership/admin/v1","stripeCheckoutSessionApiUrl":"/api/dungeon-academy/membership/stripe/checkout-session/v1","stripeBillingPortalApiUrl":"/api/dungeon-academy/membership/stripe/billing-portal/v1","stripeWebhookApiUrl":"/api/dungeon-academy/membership/stripe/webhook/v1","stripeWebhookDestination":"https://dungeon.games/api/dungeon-academy/membership/stripe/webhook/v1"},"setup":[{"key":"checkout-provider","label":"Checkout provider","configured":false,"env":["DUNGEON_ACADEMY_CHECKOUT_PROVIDER","DUNGEON_ACADEMY_CHECKOUT_URL"],"requiredFor":"Parent checkout handoff","detail":"Use Stripe Payment Links or Checkout Sessions, then point the membership checkout flow at the parent-safe checkout entry."},{"key":"webhook-secret","label":"Webhook signing secret","configured":false,"env":["DUNGEON_ACADEMY_STRIPE_WEBHOOK_SECRET","STRIPE_WEBHOOK_SECRET"],"requiredFor":"Trusted Stripe activation","detail":"Copy the endpoint signing secret from the Stripe webhook destination into the server environment."},{"key":"admin-secret","label":"Admin activation secret","configured":false,"env":["DUNGEON_ACADEMY_ADMIN_SECRET"],"requiredFor":"Trusted manual activation","detail":"Keep a server-only admin activation path for manual review, comped access, and support corrections."},{"key":"parent-session","label":"Parent session signing","configured":false,"env":["DUNGEON_ACADEMY_SESSION_SECRET","NEXTAUTH_SECRET"],"requiredFor":"Guardian-scoped checkout","detail":"Guardian session signing must be configured before parent-scoped checkout or entitlement reads."},{"key":"stripe-server-key","label":"Stripe server key","configured":false,"env":["STRIPE_SECRET_KEY","DUNGEON_ACADEMY_STRIPE_SECRET_KEY"],"requiredFor":"Server-created Checkout Sessions","detail":"Needed when the server creates Stripe Checkout Sessions instead of sending families to an external payment link."},{"key":"stripe-price","label":"Stripe monthly price","configured":false,"env":["DUNGEON_ACADEMY_STRIPE_PRICE_ID","STRIPE_PRICE_ID"],"requiredFor":"Server-created Checkout Sessions","detail":"Needed when the server creates Stripe Checkout Sessions for the monthly Dungeon Academy plan."},{"key":"stripe-publishable-key","label":"Stripe publishable key","configured":false,"env":["NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY","DUNGEON_ACADEMY_STRIPE_PUBLISHABLE_KEY"],"requiredFor":"Future client checkout UI","detail":"Needed only if a future parent checkout screen uses Stripe client components."}],"acceptedStripeEventTypes":["checkout.session.completed","invoice.payment_succeeded","customer.subscription.updated","customer.subscription.deleted"],"requiredMetadataFields":["parentAccountId","childProfileId","guardianEmail","checkoutIntentId","planId","priceLabel","currentPeriodEnd"],"operatorSteps":[{"title":"Create the monthly Stripe product and price","detail":"Use the Dungeon Academy monthly plan and keep the displayed school price aligned with the Stripe price."},{"title":"Configure checkout handoff","detail":"Set the external checkout URL now, or later wire server-created Checkout Sessions with the Stripe secret key and price ID."},{"title":"Use the Checkout Sessions API","detail":"Parent-authenticated checkout can post to /api/dungeon-academy/membership/stripe/checkout-session/v1; it creates a Stripe subscription Checkout Session without granting membership."},{"title":"Use the Billing Portal API","detail":"Active signed-in members can post to /api/dungeon-academy/membership/stripe/billing-portal/v1; it opens Stripe's customer portal only for the customer ID saved by trusted activation."},{"title":"Backfill older Stripe customers","detail":"For memberships created before customer IDs were stored, post action=attach-stripe-customer to /api/dungeon-academy/membership/admin/v1. It attaches Stripe billing IDs to an existing record only; it does not grant access."},{"title":"Add the webhook destination","detail":"Use https://dungeon.games/api/dungeon-academy/membership/stripe/webhook/v1 and subscribe to the accepted event types listed on this packet."},{"title":"Attach parent metadata","detail":"Checkout events must include parentAccountId, childProfileId, guardianEmail, checkoutIntentId, planId, priceLabel, and currentPeriodEnd where available."},{"title":"Verify activation before opening billing","detail":"Run a live checkout or Stripe CLI event and confirm the parent dashboard shows an active trusted membership record."}],"rules":{"noSecretValuesExposed":true,"checkoutIntentCanGrantAccess":false,"paidAccessRequiresTrustedWebhookOrAdmin":true,"webhookRequiresStripeSignature":true,"webhookUsesRawBody":true,"webhookIdempotentByStripeEventId":true}}