Manage subscription tutorial using the Stripe Shell or CLI
Learn how to create a customer portal that allows customers to manage an existing subscription using the Stripe Shell or CLI.
This tutorial shows you the steps and APIs to create a customer portal that allows customers to manage an existing subscription using the Stripe Shell or the Stripe CLI.
Before you begin
- You need a customer identifier which you can get from the Subscription checkout tutorial using the Stripe Shell or CLI.
APIs used
- Uses Create a portal session where a customer can manage their subscription.
Create a customer portal Prebuilt
- Call Create a portal session to create a customer portal.
Command Line
stripe billing_portal sessions create \ --return-url="https://example.com/account" \ --customer=
{{CUSTOMER_ID}}
- Look for the URL (in
url
) in the response. Open the URL in your browser.
{ "id": "bps_0KoLXR589O8KAxCGHaXfKhNu", "object": "billing_portal.session", "configuration": "bpc_0IGZMD589O8KAxCGs2aHWVmz", "created": 1649915297,
If you’re using the Stripe Shell, click the URL to open the page in a new browser tab.
Watch a video recap
This animated gif shows the customer portal flow in this tutorial using the Stripe Shell.
Wrap up
This is where we wrap up our tutorial. Here are a few places you could turn next:
- Learn more about how to change existing subscriptions.
- Start your integration with the Prebuilt subscription page with Stripe Checkout.