Skip to main content
POST
/
v1
/
billing
/
setup-intent
curl -X POST https://gpuoutlet.ai/v1/billing/setup-intent --cookie "sid=$SID"
{
  "clientSecret": "seti_3Q...secret_…",
  "publishableKey": "pk_live_…"
}
Used to enable Add credit (saved card) and auto-topup. Distinct from Stripe Checkout — Checkout charges immediately; SetupIntent just saves the card for future charges.
clientSecret
string
Pass this to Stripe Elements / stripe.confirmSetup() on the client. The user enters their card details directly into Stripe’s iframe; we never see the PAN.
publishableKey
string
Stripe publishable key (pk_test_… or pk_live_…). Use it to initialize Stripe.js if you don’t already have it.
curl -X POST https://gpuoutlet.ai/v1/billing/setup-intent --cookie "sid=$SID"
{
  "clientSecret": "seti_3Q...secret_…",
  "publishableKey": "pk_live_…"
}

After confirmation

When the user completes the Stripe Elements flow, Stripe fires a setup_intent.succeeded webhook to our endpoint. The handler saves the payment_method ID against the user’s row. From that point:
  • POST /v1/billing/checkout with a saved card no longer redirects to Stripe Checkout — it charges the saved card directly via PaymentIntent
  • Auto-topup is enabled in the dashboard UI
  • GET /v1/billing/card returns the brand and last 4 digits for display