---
title: "A link into the Stripe billing portal"
method: POST
path: "/api/v1/billing/portal"
tags: ["Billing"]
---

# A link into the Stripe billing portal

`POST /api/v1/billing/portal`

## Request

- Base URL: `http://localhost:5180`
- URL: `http://localhost:5180/api/v1/billing/portal`
- Auth: API key in cookie `better-auth.session_token`

Where an owner changes their card, their billing details, or cancels. None of those happen here: this hands back a one-time URL and the browser goes there. A cancel made there ends the team’s bank connections with the plan, so only an owner of the team, signed in on screen.

## Request body

- object
  - `returnTo` string

## Response `200`

The URL to send the browser to.

- object
  - `ok` unknown, required
  - `data` object, required
    - `url` string, required: Where to send the browser. Stripe finishes the job.
  - `meta` object, required
    - `requestId` string, required: Echoed in the x-request-id header. Quote it in a bug report.

## Other responses

- `403`: A caller who is not an owner of the team (`details.reason` `owner_only`), or one using an access token rather than a signed-in session (`on_screen`).
- `422`: Billing is not set up on this deployment.

---

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