v2

latestOpenAPI 3.1.02026-08-05267431678.1 KB
billing

Setup Payment Method

Attach a payment method to the user's Stripe customer.

This endpoint:

  1. Creates a Stripe customer if one doesn't exist
  2. Attaches the payment method to the customer
  3. Sets it as the default payment method
  4. Checks card fingerprint for abuse (same card on too many teams)
  5. Stores the fingerprint and marks team as card-verified

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 let a single bot account incinerate Pioneer's Stripe fee budget and Radar reputation. The cap leaves plenty of headroom for legitimate users to retry on declined cards or SCA hiccups while denying bot farms unlimited attempts on the same compromised account.

Args: request: FastAPI request (required by SlowAPI rate limiter). body: Payment method ID from Stripe.js. auth: Authenticated user context.

Returns: Success status and customer ID.

post/billing/setup-payment-method

Request body

payment_method_idstring required

Stripe payment method ID from Stripe.js

payment_intent_idstring nullable

Set only on the post-3DS retry to finalize the existing verification PaymentIntent. Must match the payment_intent_id returned in the previous requires_action response.

Response

Successful Response

successboolean required
messagestring required
customer_idstring nullable
requires_actionboolean
client_secretstring nullable
payment_intent_idstring nullable