---
title: "Open the organization's Stripe customer portal for a customer"
method: POST
path: "/projects/v1/{project_id}/stripe/portal-sessions"
tags: ["Projects"]
---

# Open the organization's Stripe customer portal for a customer

`POST /projects/v1/{project_id}/stripe/portal-sessions`

## Request

- Base URL: `https://api.run402.com`
- URL: `https://api.run402.com/projects/v1/{project_id}/stripe/portal-sessions`
- Auth: one of:
  - HTTP bearer
  - API key in header `SIGN-IN-WITH-X`
  - HTTP bearer
  - HTTP bearer

Creates a Stripe customer-portal session on the connected account for customer (a cus_ id from a completed session) with return_url on the project's own hosts (the onboarding-link URL rule). The portal's configuration and branding are the organization's own, edited in its Stripe dashboard; Run402 creates none. Same account-state refusals as Checkout Sessions. Behind the lifecycle gate.

## Path parameters

- `project_id` string, required: Run402 project ID. Public IDs are not UUIDs.

## Headers

- `SIGN-IN-WITH-X` string, required

## Request body

- StripePortalSessionCreateRequest
  - `customer` string, required
  - `return_url` string, uri, required: HTTPS on one of the project's own hosts or the console.

## Response `201`

The portal session.

- StripePortalSession
  - `url` string, uri, required

## Other responses

- `403`: STRIPE_ACCOUNT_REQUIRED, STRIPE_ACCOUNT_ONBOARDING_INCOMPLETE, STRIPE_ACCOUNT_RESTRICTED, not authorized, or the lifecycle gate.
- `422`: VALIDATION_FAILED (customer) or STRIPE_RETURN_URL_NOT_ALLOWED.
- `502`: STRIPE_UPSTREAM_ERROR.
- `503`: STRIPE_CONNECT_UNAVAILABLE.

---

[API](https://skmtc.dev/run402/apis/run402-api.md) · [All operations](https://skmtc.dev/run402/apis/run402-api/llms.txt) · [OpenAPI document](https://skmtc.dev/run402/apis/run402-api/revisions/893607557f50?raw)
