v5

latestOpenAPI 3.1.02026-08-025631,1012.8 MB
Organization Billing

Setup Payment Method

Initialize payment method setup flow.

Creates a Stripe SetupIntent for collecting payment method without charging. The client_secret should be used with Stripe Elements on the frontend.

Flow:

  1. Frontend calls this endpoint
  2. Backend creates Stripe Customer (if needed) and SetupIntent
  3. Frontend uses client_secret with Stripe Elements
  4. User enters card details
  5. Frontend calls confirm-payment-method endpoint

Requirements:

  • Admin permission (only org admins can set up payment methods)

Example:

response = await client.post("/v1/organizations/billing/setup-payment-method")
client_secret = response["client_secret"]
# Use client_secret with Stripe Elements
post/v1/organizations/billing/setup-payment-method

Response

Successful Response

setup_intent_idstring required

Stripe SetupIntent ID

client_secretstring required

Client secret for Stripe Elements

customer_idstring required

Stripe Customer ID

Example response

{
  "setup_intent_id": "seti_1ABC2DEF3GHI",
  "client_secret": "seti_1ABC2DEF3GHI_secret_XYZ",
  "customer_id": "cus_ABC123DEF456"
}