Process for upgrading and switching to pay by Loop
- Fetch the subscription details from Stripe
- You will need to retrieve the subscription ID from the customer who is on the free tier.
- Subscription IDs start with a prefix
sub_
(example: sub_1RUTXtD7oqbPtWsfxDBWTsMJ)
- Construct the request to generate a checkout session in Loop
- Use the Create Checkout Session endpoint.
-
At a minimum, you need to update the following body parameters in the request.
- externalPriceId - this is the price ID from Stripe of the new product tier that you want to upgrade the customer to
- externalSubscriptionId - this is the subscription ID you retrieved from Stripe in step 1
- upgradeSubscription - set the boolean value as True Here is an example request:
- Generate the checkout link from the configured session.
- User visits the checkout link and completes payment.
- The subscription record will be updated in Stripe.
- You will see the relevant invoice marked as paid in Stripe as well.