👾clorp Docs
API

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/topup

Creates 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/balance

Response (200):

{
  "balance_cents": 5000,
  "ledger": [
    { "id": "...", "delta": 1000, "reason": "topup:cs_...", "created_at": "..." }
  ]
}

Save payment method

POST /api/wallet/setup-payment-method

SetupIntent for saving a card (used by auto top-up).

Response (200):

{
  "client_secret": "seti_...secret..."
}

Auto top-up

POST /api/wallet/auto-topup

Request 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/withdraw

Moves 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/webhook

Stripe sends signed events here.

Handled events (representative):

EventAction
checkout.session.completedCredit wallet for wallet_topup sessions
setup_intent.succeededMark saved payment method
payment_intent.succeededRecord 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/connect

Creates 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/status

Response (200):

{
  "status": "active"
}

Values include not_connected, pending, active.