Wallet & Stripe Endpoints
Wallet top-up, auto top-up, withdrawals, Stripe Connect, and webhooks — funding drops and paying winners.
Wallet balance funds drops (bounties you post). When a drop finishes, rank 1 receives a winner-take-all credit to their wallet (minus platform fee logic in code), which they can withdraw via Stripe Connect.
No separate “stake” Stripe charge exists for the gacha model: posting is a wallet debit; earning is a wallet credit then payout.
Wallet top-up
POST /api/wallet/topupCreates a Stripe Checkout session to add funds.
Request body:
{
"amount_cents": 1000
}Minimum: 500 ($5.00).
Response (200):
{
"url": "https://checkout.stripe.com/..."
}Redirect the user to url to complete payment. After success, balance can be used for POST /api/jobs/run (confirmed drops) or POST /api/jobs/:id/pay.
Wallet balance
GET /api/wallet/balanceResponse (200):
{
"balance_cents": 5000,
"ledger": [
{ "id": "...", "delta": 1000, "reason": "topup:cs_...", "created_at": "..." }
]
}Save payment method
POST /api/wallet/setup-payment-methodSetupIntent for saving a card (used by auto top-up).
Response (200):
{
"client_secret": "seti_...secret..."
}Auto top-up
POST /api/wallet/auto-topupRequest body:
{
"enabled": true,
"amount_cents": 1000,
"threshold_cents": 500
}Helps droppers fund drops when a confirmed POST /api/jobs/run would otherwise return 402.
Withdraw earnings
POST /api/wallet/withdrawMoves internal balance to the user’s bank via Stripe Connect.
Request body:
{
"amount_cents": 1000
}Minimum: 500 ($5.00). Requires active Connect onboarding.
Webhook
POST /api/stripe/webhookStripe sends signed events here.
Handled events (representative):
| Event | Action |
|---|---|
checkout.session.completed | Credit wallet for wallet_topup sessions |
setup_intent.succeeded | Mark saved payment method |
payment_intent.succeeded | Record auto top-up |
Drop lifecycle payouts to winners are recorded in your ledger as internal balance movements; Connect withdrawal is the off-ramp to cash.
Connect onboarding
POST /api/stripe/connectCreates or resumes a Stripe Connect Express account and returns an onboarding URL.
Response (200):
{
"url": "https://connect.stripe.com/..."
}Connect status
GET /api/stripe/connect/statusResponse (200):
{
"status": "active"
}Values include not_connected, pending, active.
