Wallet & Earnings
The wallet section manages financial activity on the platform, including account balance, transaction history, earnings from sales, and the affiliate referral program.
Route map
Section titled “Route map”| Route | File | Description |
|---|---|---|
/wallet | (app)/wallet/+page.svelte | Wallet overview — balance, transactions, earnings |
/affiliates | (app)/affiliates/+page.svelte | Affiliate program dashboard |
/affiliates/referrals | (app)/affiliates/referrals/+page.svelte | Referral tracking and details |
All routes are protected (authentication + onboarding required).
Wallet (/wallet)
Section titled “Wallet (/wallet)”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.
Stripe integration
Section titled “Stripe integration”Wallet operations integrate with Stripe for payment processing. The Stripe-related API endpoints include:
| API route | Purpose |
|---|---|
(app)/api/stripe/ | Stripe checkout and payment intent creation |
/api/stripe/webhook | Stripe webhook handler (fully public, no auth) |
Affiliates (/affiliates)
Section titled “Affiliates (/affiliates)”The affiliate dashboard shows the user’s referral performance:
- Total referrals and conversion count
- Commission earned
- Referral link management
- Payout status
Referrals (/affiliates/referrals)
Section titled “Referrals (/affiliates/referrals)”Detailed view of individual referral records:
- Referred user information
- Referral date and status (pending, converted, expired)
- Commission amount per referral
Related routes
Section titled “Related routes”| User route | Business management route |
|---|---|
/affiliates | /business/apps/affiliates |
/affiliates/referrals | /business/apps/affiliates/payouts |
/wallet | /business/upgrade (plan purchases) |