---
title: "Start adding a payment method"
method: POST
path: "/v1/billing/payment-methods/setup-session"
tags: ["billing"]
---

# Start adding a payment method

`POST /v1/billing/payment-methods/setup-session`

## Request

- Base URL: `https://api.patricia.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.patricia.app/v1/billing/payment-methods/setup-session`
- Auth: HTTP bearer

Create a Stripe Checkout session (setup mode) to save a card; returns its URL.

## Headers

- `X-Tenant-Id` string, nullable

## Response `200`

Successful Response

- SetupSessionResponse: The hosted Stripe Checkout Session (``mode=setup``) URL for adding a card. Add-card uses a Checkout redirect (NOT client-side Stripe.js): the browser is sent to ``checkout_url``, saves the card, and returns to the Billing tab; the card is synced into ``payment_methods`` when that session's ``checkout.session.completed`` arrives.
  - `checkout_url` string, required
  - `session_id` string, required

## Other responses

- `400`: Malformed request (unknown plan, or no billing account yet).
- `401`: Unauthorized
- `403`: Forbidden. Inspect response body `code` for the specific reason (for example: PERMISSION_DENIED, EMAIL_NOT_VERIFIED, TENANT_ACCESS_REQUIRED, ROLE_UNRESOLVED)
- `409`: Conflict
- `422`: Validation error
- `502`: The payment provider call failed.
- `503`: Billing is not configured on this deployment.

---

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