Skip to main content
POST
/
v1
/
billing
/
checkout
curl -X POST https://gpuoutlet.ai/v1/billing/checkout \
  -H "Content-Type: application/json" \
  --cookie "sid=$SID" \
  -d '{"amountCents":2500}'
{
  "checkoutUrl": "https://checkout.stripe.com/c/pay/cs_live_a1b2...",
  "sessionId": "cs_live_a1b2..."
}
amountCents
number
required
Top-up amount in cents. Range: 100 (1)to500000(1) to `500000` (5,000).
checkoutUrl
string
Redirect the user’s browser here. They’ll come back to /app/billing?session=success after completing or ?session=cancel on cancellation.
sessionId
string
Stripe session id (cs_test_… or cs_live_…). Mostly for debugging.
curl -X POST https://gpuoutlet.ai/v1/billing/checkout \
  -H "Content-Type: application/json" \
  --cookie "sid=$SID" \
  -d '{"amountCents":2500}'
{
  "checkoutUrl": "https://checkout.stripe.com/c/pay/cs_live_a1b2...",
  "sessionId": "cs_live_a1b2..."
}

Webhook flow

Stripe sends checkout.session.completed to our webhook endpoint (POST /v1/billing/stripe/webhook) when the user completes payment. The webhook handler:
  1. Verifies the Stripe signature
  2. Reads the user_id from session metadata
  3. Inserts a stripe_topup ledger entry
  4. Sends a confirmation email
The wallet balance updates as soon as the webhook is processed (typically <2 seconds after the user clicks “Pay”).

Returning to the dashboard

The Stripe Checkout success_url and cancel_url are set server-side to:
https://gpuoutlet.ai/app/billing?session=success
https://gpuoutlet.ai/app/billing?session=cancel
The Billing page reads ?session= and shows a success toast or cancellation nudge. Override these URLs via dashboard env vars at the deployment level.