v2
latestOpenAPI 3.1.02026-08-05267431678.1 KBSetup Team Payment Method
Attach a payment method to a team's Stripe customer.
Requires: MANAGE_BILLING permission (owner, admin, or billing role)
This endpoint:
- Creates a Stripe customer for the team if one doesn't exist
- Attaches the payment method to the team's customer
- Sets it as the default payment method
Rate-limited to 5 attempts per user per hour. Each attempt captures a $1 PaymentIntent (real settled charge) for Stripe Radar fraud scoring, so unbounded retries from a single owner/admin let a bot incinerate the Stripe fee budget and burn Radar reputation. The cap leaves room for legitimate retries on declined cards or SCA hiccups while denying bots unlimited attempts on the same compromised owner account.
Args: request: FastAPI request (required by SlowAPI rate limiter). team_id: Team UUID. body: Payment method ID from Stripe.js. auth: Authenticated user context.
Returns: Success status and customer ID.
Path parameters
Request body
Response
Successful Response