Skip to content

Wallet & Earnings

The wallet section manages financial activity on the platform, including account balance, transaction history, earnings from sales, and the affiliate referral program.

RouteFileDescription
/wallet(app)/wallet/+page.svelteWallet overview — balance, transactions, earnings
/affiliates(app)/affiliates/+page.svelteAffiliate program dashboard
/affiliates/referrals(app)/affiliates/referrals/+page.svelteReferral tracking and details

All routes are protected (authentication + onboarding required).

The wallet page provides a single view of the user’s financial activity:

  • Balance — Current available balance and pending amounts.
  • Transactions — History of all credits and debits (purchases, sales, payouts, refunds).
  • Earnings — Revenue from product sales, subscription payments, and other income sources.

The +page.server.ts loads wallet data for the authenticated user. Financial operations are handled through the (app)/api/wallet/ and (app)/api/stripe/ API routes.

Wallet operations integrate with Stripe for payment processing. The Stripe-related API endpoints include:

API routePurpose
(app)/api/stripe/Stripe checkout and payment intent creation
/api/stripe/webhookStripe webhook handler (fully public, no auth)

The affiliate dashboard shows the user’s referral performance:

  • Total referrals and conversion count
  • Commission earned
  • Referral link management
  • Payout status

Detailed view of individual referral records:

  • Referred user information
  • Referral date and status (pending, converted, expired)
  • Commission amount per referral
User routeBusiness management route
/affiliates/business/apps/affiliates
/affiliates/referrals/business/apps/affiliates/payouts
/wallet/business/upgrade (plan purchases)