---
title: "Create a Stripe billing portal session for a user"
method: POST
path: "/v1/user/{userId}/subscriptions/billingPortalSession/"
tags: ["/v1/user"]
---

# Create a Stripe billing portal session for a user

`POST /v1/user/{userId}/subscriptions/billingPortalSession/`

## Request

- Base URL: `https://api.counselhealth.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.counselhealth.com/v1/user/{userId}/subscriptions/billingPortalSession/`
- Auth: HTTP bearer

Mints a short-lived (~5 min) Stripe-hosted billing portal URL the user can visit to manage their subscription (update payment method, view invoices, cancel). The session is bound to the user's Stripe customer and uses the appropriate billing portal configuration for their organization and plan. After the user finishes, Stripe redirects them to the supplied `return_url`

## Path parameters

- `userId` string, required

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `return_url` string, uri, required

## Response `200`

Default Response

- object
  - `url` string, uri, required
  - `expires_at` string, date-time, required: datetime in ISO 8601 format

## Other responses

- `400`: 400 error with a machine-readable `code` for client branching.
- `401`: Standard error body returned for non-2xx responses.
- `403`: Standard error body returned for non-2xx responses.
- `404`: Standard error body returned for non-2xx responses.
- `409`: Standard error body returned for non-2xx responses.
- `413`: Standard error body returned for non-2xx responses.
- `429`: Standard error body returned for non-2xx responses.
- `500`: Standard error body returned for non-2xx responses.
- `502`: Default Response
- `503`: Default Response
- `504`: Default Response

---

[API](https://skmtc.dev/counselhealth/apis/counsel-api.md) - [All operations](https://skmtc.dev/counselhealth/apis/counsel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/counselhealth/apis/counsel-api/revisions/4110a89127e8?raw)
