---
title: "Create Stripe Customer Portal Session"
method: POST
path: "/api/payments/stripe/{environment}/customer-portal-sessions"
tags: ["Stripe Payments"]
---

# Create Stripe Customer Portal Session

`POST /api/payments/stripe/{environment}/customer-portal-sessions`

Create a Stripe Billing Portal Session for an authenticated user's mapped billing subject.

## Path parameters

- `environment` 'test' | 'live', required

## Request body

- CreateCustomerPortalSessionBody
  - `subject` BillingSubject, required
    - `type` string, required
    - `id` string, required
  - `returnUrl` string, uri
  - `configuration` string

## Response `201`

Customer Portal Session created

- CreateCustomerPortalSessionResponse
  - `customerPortalSession` CustomerPortalSession, required
    - `id` string, uuid, required
    - `environment` 'test' | 'live', required
    - `status` 'initialized' | 'created' | 'failed', required
    - `subjectType` string, required
    - `subjectId` string, required
    - `customerId` string, nullable, required
    - `returnUrl` string, nullable, required
    - `configuration` string, nullable, required
    - `url` string, nullable, required
    - `lastError` string, nullable, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `400` — Invalid request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Resource not found
- `500` — Internal server error

---

[API](https://skmtc.dev/insforge/apis/insforge-authentication-api.md) · [All operations](https://skmtc.dev/insforge/apis/insforge-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/insforge/insforge-authentication-api/revisions/a935bb49f932/schema)
