Wallet & Stripe Endpoints
Wallet top-up, auto top-up, withdrawal, and Connect API endpoints.
These endpoints handle wallet management, payment methods, and Connect payouts.
Wallet top-up
POST /api/wallet/topupCreates a Stripe Checkout session to add funds to your wallet.
Request body:
{
"amount_cents": 1000
}Minimum: 500 ($5.00).
Response (200):
{
"url": "https://checkout.stripe.com/..."
}Redirect the user to the returned URL to complete payment.
Wallet balance
GET /api/wallet/balanceReturns the user's current balance and transaction ledger.
Response (200):
{
"balance_cents": 5000,
"ledger": [
{ "id": "...", "delta": 1000, "reason": "topup:cs_...", "created_at": "..." }
]
}Save payment method
POST /api/wallet/setup-payment-methodCreates a Stripe SetupIntent for saving a card (needed for auto top-up).
Response (200):
{
"client_secret": "seti_...secret..."
}Auto top-up settings
POST /api/wallet/auto-topupConfigure automatic wallet top-ups.
Request body:
{
"enabled": true,
"amount_cents": 1000,
"threshold_cents": 500
}Withdraw earnings
POST /api/wallet/withdrawWithdraw funds from your internal balance to your bank via Stripe Connect.
Request body:
{
"amount_cents": 1000
}Minimum: 500 ($5.00). Requires an active Stripe Connect account.
Webhook
POST /api/stripe/webhookReceives Stripe webhook events. Requires a valid stripe-signature header.
Handled events:
| Event | Action |
|---|---|
checkout.session.completed | Adds funds to user's wallet (for wallet_topup sessions) |
setup_intent.succeeded | Marks user as having a saved payment method |
payment_intent.succeeded | Records auto top-up balance addition |
Connect onboarding
POST /api/stripe/connectCreates or retrieves a Stripe Connect Express account for the authenticated user and returns an onboarding link.
Response (200):
{
"url": "https://connect.stripe.com/..."
}Connect status
GET /api/stripe/connect/statusReturns the Stripe Connect onboarding status.
Response (200):
{
"status": "active"
}Possible values: not_connected, pending, active.
