Overview
The Store Wallet API manages financial operations for store owners including balance tracking, payout requests, transaction history, and earnings management. This system automatically processes order earnings and handles marketplace commission deductions. Location:convex/stores/wallet.ts
Wallet Structure
Available Balance
Funds available for immediate payout requests
Pending Balance
Earnings from recent orders (held for security period)
Total Earnings
Lifetime earnings from all completed orders
Payout History
Complete record of all payout transactions
Get Store Wallet Balance
Retrieve comprehensive wallet information and statistics for a store.Store ID to get wallet information for
Request Payout
Request a payout from the store wallet to the registered bank account.Store ID requesting the payout
Payout amount (must be within available balance and limits)
Get Payout History
Retrieve payout-related transactions by filtering wallet transactions.Store ID
Maximum number of payout records to return
Get Wallet Transaction History
Retrieve detailed transaction history for a store wallet.Store ID
Maximum number of transaction records
Filter by transaction type:
order_funding, commission_deduction, payout, payout_fee, refund, adjustment, penalty, bonusWallet Dashboard Component
Complete wallet management interface:Payout Processing Timeline
1
Request Submitted
Store owner submits payout request through dashboard
2
Admin Review
Platform admin reviews request and bank account details
3
Processing
Payment is initiated to store’s registered bank account
4
Completed
Funds transferred successfully, confirmation sent to store
Transaction Types
Order Funding
Type:
Description: Earnings from completed orders
Effect: Increases wallet balance
order_fundingDescription: Earnings from completed orders
Effect: Increases wallet balance
Commission Deduction
Type:
Description: Platform commission on orders
Effect: Decreases wallet balance
commission_deductionDescription: Platform commission on orders
Effect: Decreases wallet balance
Payout
Type:
Description: Funds transferred to bank account
Effect: Decreases wallet balance
payoutDescription: Funds transferred to bank account
Effect: Decreases wallet balance
Payout Fee
Type:
Description: Processing fee for payouts
Effect: Decreases wallet balance
payout_feeDescription: Processing fee for payouts
Effect: Decreases wallet balance
Refund
Type:
Description: Order refunds processed
Effect: Decreases wallet balance
refundDescription: Order refunds processed
Effect: Decreases wallet balance
Adjustment
Type:
Description: Manual balance adjustments
Effect: Can increase or decrease balance
adjustmentDescription: Manual balance adjustments
Effect: Can increase or decrease balance
Error Handling
Insufficient balance
Insufficient balance
Status Code:
400Below minimum payout
Below minimum payout
Status Code:
400Missing bank details
Missing bank details
Status Code:
400Wallet not found
Wallet not found
Status Code:
404Wallet balances are updated in real-time as orders are processed. Pending balances are held for a security period before becoming available for payout.
