---
title: "Start checkout for a workspace"
method: POST
path: "/v2/workspaces/{id}/billing/checkout"
tags: ["Billing"]
---

# Start checkout for a workspace

`POST /v2/workspaces/{id}/billing/checkout`

## Request

- Base URL: `https://api.infolang.ai`
- URL: `https://api.infolang.ai/v2/workspaces/{id}/billing/checkout`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Returns a Stripe Checkout URL.

The billing subject is always the workspace's OWNER, on every lane. A plan belongs to the billing ACCOUNT (`profiles.plan`) and quota pools there, so a subscription bought against any other principal would pay for an entitlement no workspace receives. Nothing workspace-shaped is sent to Stripe.

Consequently a session-lane caller who is NOT the owner is refused `403` even with `billing:write`: the owner holds the subscription and the payment method. `il_*` lanes have no principal to compare and act for the owner.

Requires the `billing:write` scope. Accepts all three lanes: a session JWT (bounded by the caller's role on this workspace) or an `il_*` machine credential whose own scope set, workspace set and validity window cover it — both ceilings apply and neither can raise the other, so a credential carrying `billing:write` is still refused where the role does not permit it.

A credential with no scope record resolves to `LEGACY_DEFAULT`, which does NOT include `billing:write` — mint a key with it explicitly (`POST /v2/workspaces/{id}/keys`).

## Path parameters

- `id` string, required

## Request body

- object
  - `plan` string

## Response `200`

Checkout URL

- object
  - `url` string, required

## Other responses

- `401`: Missing/invalid credential, or `credential_expired` — the credential is outside its `[not_before, expires_at)` window and must be replaced
- `403`: `insufficient_scope` — the credential's own scope set, or the caller's role on this workspace, does not cover the scope this route requires (the missing scope is named in the message). Or `forbidden` — the credential is not scoped to this workspace, or holds no grant on it
- `409`: already_subscribed — this account already holds a live Stripe subscription. Returned by CHECKOUT, which would otherwise create a SECOND subscription against the same customer and bill both (it did, in production, to anyone who upgraded). Switch plans with the plan route instead.
- `500`: internal_error — unexpected failure (e.g. billing backend misconfigured or unreachable)
- `503`: not_configured — self-serve billing is not available on this deployment: either no payment processor is wired, or its prices do not reconcile with the published catalog. Returned INSTEAD of a checkout URL, because the alternatives were a link to a domain that does not resolve and a checkout that charges an amount the page never showed. Mirrors `self_serve_checkout` on both summaries exactly — same evaluation, same cache.

---

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