Skip to main content
POST
Create Customer Portal Session
Create a Stripe Customer Portal session that lets users manage their subscriptions, payment methods, and billing details directly in Stripe’s hosted interface.

Authentication

This endpoint requires end user authentication via HTTP Bearer Token with project scope.

Query Parameters

test_mode
boolean
default:"true"
Use test mode credentials. Set to false for production.

Request Body

return_url
string
required
URL to redirect user after they exit the portal

Response

portal_url
string
URL to redirect user to the Stripe Customer Portal

Example Request

Example Response

Portal Flow

Portal Capabilities

The Customer Portal allows users to:
Configure portal features in Stripe Dashboard > Settings > Customer Portal.

Integration Example

Portal Configuration

Configure allowed actions in Stripe Dashboard: (((REPLACE_THIS_WITH_IMAGE: stripe-customer-portal-settings.png: Stripe Dashboard Customer Portal configuration page showing subscription and invoice settings)))

Prerequisites

The user must have an existing Stripe Customer ID from a previous checkout. If the user has never subscribed, this endpoint will return an error.

Error Responses

Get My Subscription

Check subscription status

Cancel Subscription

Cancel programmatically

Update Subscription

Change plans via API

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

test_mode
boolean
default:true

Use test mode

Body

application/json

Request to create a customer portal session.

return_url
string
required
Minimum string length: 1

Response

Successful Response

Customer portal session response.

portal_url
string
required