# Open recurring plan or one-time prepaid Checkout; payment never approves or posts

`POST` `/api/v1/workspaces/{workspace}/billing/checkout`

`startCheckout`

Every card and Link Checkout goes through Stripe Managed Payments once listPlans.managed_payments_checkout.enabled is true; managed_payments stays accepted and changes nothing. A person's recurring plan then answers 202 with consent_required and consent_url, a Flaghand page where the person ticks the renewal box themselves; relay for_person and that link, never tick it and never send a Stripe URL. mode:payment buys one prepaid month/year for any billing country. It does not renew and needs no renewal-consent box; save payment_id and recover this same Checkout after an unclear outcome. Stripe shows final tax before payment: billing is one price worldwide, tax on top in the US and Canada and included elsewhere. payment_method:crypto instead buys a prepaid period only for eligible countries when enabled. Omission keeps recurring card Checkout. Relay for_person and the short Flaghand checkout_url verbatim, including the entire # fragment; never unwrap, shorten or substitute a raw Stripe URL. The link restores Stripe's complete URL, including its required fragment; completed or expired Checkouts return to this workspace's approval or Billing page to review current terms and start again. It quotes the saved terms and actual first-charge date, automatic renewal and how to cancel. Reuses a compatible still-open Checkout instead of invalidating card entry in progress. If that prepared recurring Checkout's short payment link is unavailable, returns 409 conflict with error.checkout_session_id and error.next_step: continue in the already-open Checkout or retry startCheckout with the same arguments, including plan and return_to, to recover it; never start a second subscription. This also applies during its card authentication. A completed Checkout is synced and returns conflict: read getSetup again; no second Checkout is created. For an incomplete, unpaid or paused subscription, checkout_url instead continues its original card authentication or pays/manages that existing subscription; relay its recovery-specific for_person and next_step. Paused recovery prepares its resumption invoice without paying it. No second subscription is started. While prepaid access extends beyond Stripe's 730-day maximum deferral, returns checkout_url:null and recurring_available_from: no Checkout, subscription or charge starts; relay for_person and return on or after that date. An agent may pay only with a Link-issued credential its person approved, never a card supplied in chat. Read listPlans for amount, currency, recurring interval and link_checkout_enabled; founding needs a per-year authorization covering amount, not just first_amount. Use pay_with=agent_card for a delegated recurring virtual card, or pay_with=link to also enable Link for this session. For recurring subscriptions both require the person's own passkey renewal consent before Checkout exists: relay consent_url and for_person from the 202 response, then retry when they return. The agent must never tick a renewal box, including on an ordinary card Checkout. Omission keeps the person's existing card-only form. See /docs/billing.md#paying-as-an-agent for wallet approval, recurring-card validity, the separate renewal consent and Link Pay Token test-mode limitations. Who can call it: An API token with the "billing" scope, or an owner of this workspace, signed in.

**Scopes:** `billing`

Synthetic test-mode session, not a working checkout. The person enters card details on Stripe's own page, never in this API request.

**Parameters**

| Name | In | Required | Type and constraints | Description / example |
| --- | --- | --- | --- | --- |
| `workspace` | path | Yes | `string`; pattern: `"^ws_[a-z0-9]{16}$"` |  Example: `"ws_aaaaaaaaaaaaaaaa"` |

**JSON body**

| Field | Required | Type and constraints | Description |
| --- | --- | --- | --- |
| `plan` | No | `string`; enum: `["monthly","yearly","founding"]` |  |
| `mode` | No | `string`; enum: `["subscription","payment"]`; default: `"subscription"` | subscription renews after the person's consent. payment buys a one-time prepaid period, without automatic renewal or renewal consent. |
| `managed_payments` | No | `boolean`; const: `true` | Optional and redundant: every card and Link Checkout uses Stripe Managed Payments once the server's switch is on. Before that, refused in live mode. |
| `billing` | No | `object` |  |
| `payment_method` | No | `string`; enum: `["card","crypto"]` | Default card starts a recurring plan; crypto buys a one-time prepaid period when enabled, never automatically renewing. |
| `pay_with` | No | `string`; enum: `["card","agent_card","link"]`; default: `"card"` | card is the person's own card: under Managed Payments it answers with a Flaghand link where they tick the renewal box. agent_card accepts a person-approved recurring virtual card; link also enables Link for this session when listPlans.link_checkout_enabled is true. For recurring subscriptions, both agent modes return consent_url (202) until the owner signs exact renewal terms with a passkey on Flaghand; then retry. One-time mode:payment never needs renewal consent. No credential is accepted in this API request. |
| `return_to` | No | `string` | Optional relative /approve link for this workspace. Checkout returns there for the owner's separate passkey approval; cancel returns there too. |

**Request example**

```http
POST https://app.flaghand.com/api/v1/workspaces/ws_aaaaaaaaaaaaaaaa/billing/checkout
Authorization: Bearer tok_<your workspace token>
Content-Type: application/json

{
  "plan": "monthly"
}
```

**Response example**

```json
{
  "checkout_url": "https://app.flaghand.com/pay#SYNTHETIC_DO_NOT_USE_00000000000",
  "for_person": "Open this Stripe Checkout link to enter your card for Flaghand; the plan costs $19 a month, renewing automatically until you cancel. Your first charge is $19 on the date shown in Checkout; Cancel plan at https://app.flaghand.com/billing before the first charge to pay nothing, or later to stop the next renewal; adding a card never approves or posts. Open https://app.flaghand.com/pay#SYNTHETIC_DO_NOT_USE_00000000000 and enter card details only in Stripe, never in chat.",
  "checkout_session_id": "cs_test_SYNTHETIC_DO_NOT_USE",
  "plan": "monthly",
  "trial_days": 7,
  "expires_at": "2026-10-25T17:00:00Z"
}
```

Success: HTTP 200. Content-Type: application/json.

**Errors:** `invalid_request` (400), `internal` (500), `unauthorized` (401), `invalid_token` (401), `session_expired` (401), `bad_origin` (403), `scope_missing` (403), `owner_session_required` (403), `invalid_json` (400), `not_found` (404). See the [error codes](https://app.flaghand.com/docs/errors.md) for meanings and the shared default error response. Other domain errors from that catalog may apply; the response's code and message are authoritative.

**CLI:** `flaghand billing start-checkout`

```sh
flaghand billing start-checkout --workspace ws_aaaaaaaaaaaaaaaa -d '{"plan":"monthly"}' --json
```

**MCP tool:** `startCheckout` (also reachable through `callWriteOperation`; use `getOperation` to load its full schema).

```json
{
  "name": "callWriteOperation",
  "arguments": {
    "operation_id": "startCheckout",
    "arguments": {
      "workspace": "ws_aaaaaaaaaaaaaaaa",
      "plan": "monthly"
    }
  }
}
```

Base URL: `https://app.flaghand.com/api/v1`. Part of the [API reference](https://app.flaghand.com/docs/api.md); every error code is in [errors](https://app.flaghand.com/docs/errors.md).
