---
title: "Create a Stripe portal session as JSON"
method: POST
path: "/api/v1/billing/portal"
tags: ["Billing", "User"]
---

# Create a Stripe portal session as JSON

`POST /api/v1/billing/portal`

## Request

- Base URL: `https://openmercantil.es`
- URL: `https://openmercantil.es/api/v1/billing/portal`
- Auth: API key in cookie `ob_sess`
- TypeScript: <https://skmtc.dev/openmercantil/apis/openmercantil-public-api/docs/api/v1/billing/portal/post.ts> (a function with typed inputs; its response is checked against the schema)

## Headers

- `X-CSRF-Token` string, required

## Response `200`

Stripe Customer Portal URL

- StripeSessionResponse
  - `url` string, uri, required
  - `session_id` string, required

## Other responses

- `400`: Invalid request
- `401`: Authentication required (no active session)
- `403`: Invalid CSRF token
- `429`: Rate limit exceeded
- `503`: Action budget or Stripe unavailable

## Changes

- **2026-07-26** `996f96a11758`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openmercantil/apis/openmercantil-public-api/changes/api/v1/billing/portal/post.md)

---

[API](https://skmtc.dev/openmercantil/apis/openmercantil-public-api.md) - [All operations](https://skmtc.dev/openmercantil/apis/openmercantil-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openmercantil/apis/openmercantil-public-api/revisions/601ff6123c86?raw)
