Skip to content
Community forum

Starting a subscription with Stripe Checkout

SolvedSupero SupportSupero team asked

Common question, written up by the Supero team.

We have tiers in Stripe and a member_plan schema extending recurring_plan:base_plan. How do we get from "Subscribe" to an active plan?

Link

1 answer

Accepted answer
Accepted answer

Create the subscriber's records first: the member_plan (it starts inactive) and, if you gate access, a membership record (starts pending). Then create a checkout session in subscription mode. Pass a Stripe Price ID, so the price comes from Stripe rather than from your page, and pass the plan's uuid as client_reference_id:

json
{"service_id": "stripe_checkout", "operation": "create_checkout_session",
 "input": {"mode": "subscription", "price_id": "price_pro_monthly", "interval": "month",
           "success_url": "https://acme-corp.supero.live/welcome?session_id={CHECKOUT_SESSION_ID}",
           "cancel_url": "https://acme-corp.supero.live/pricing",
           "customer_email": "jamie@example.com", "client_reference_id": "<member_plan uuid>"}}

Redirect the customer to output.checkout_url. When the Stripe webhook (verified with stripe_webhook_secret) reports the completed session, look up the plan by client_reference_id and call start_plan and enroll_member together, so billing and access start at the same moment. Do the activation in the webhook handler; the success page is only for showing the customer a confirmation.

Supero Integrations teamSupero team answered
Link

Your answer

Starting a subscription with Stripe Checkout | Supero Community