---
title: "A link into Stripe checkout, to start a plan"
method: POST
path: "/api/v1/billing/checkout"
tags: ["Billing"]
---

# A link into Stripe checkout, to start a plan

`POST /api/v1/billing/checkout`

## Request

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

The quantity is the portfolio’s unit count, because every plan is priced per unit per month. Stripe collects the card, the billing address and the VAT number, so none of them are typed here. A team has one plan: while it holds one in trial, active or past due this answers 409, and the plan is changed with `/billing/plan` or kept with `/billing/resume` instead. Only a first plan starts with a free trial, where no team the caller owns has had one before, and it runs for the offer’s `trialDays` instead where the caller holds an `offer` on the plan being started. Where the plan price carries several currencies, Checkout bills in the one Stripe already bills this customer in, or else the one the team’s country is priced in, which is the one the plan was shown in. Only an owner of the team, signed in on screen.

## Request body

- object
  - `plan` 'owner' | 'pro' | 'agency', required

## 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

- `400`: That plan is not sold here, the portfolio has no unit to price, or the plan’s range does not cover the portfolio’s units (`details.reason` `units`). Nothing was started.
- `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`).
- `409`: The team already has a plan in trial, active or past due, with `details.reason` `has_plan`. Nothing was opened.

---

[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)
