Skip to main content

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.
storeId
Id<'stores'>
required
Store ID to get wallet information for

Request Payout

Request a payout from the store wallet to the registered bank account.
storeId
Id<'stores'>
required
Store ID requesting the payout
amount
number
required
Payout amount (must be within available balance and limits)

Get Payout History

Retrieve payout-related transactions by filtering wallet transactions.
storeId
Id<'stores'>
required
Store ID
limit
number
Maximum number of payout records to return

Get Wallet Transaction History

Retrieve detailed transaction history for a store wallet.
storeId
Id<'stores'>
required
Store ID
limit
number
Maximum number of transaction records
type
string
Filter by transaction type: order_funding, commission_deduction, payout, payout_fee, refund, adjustment, penalty, bonus

Wallet 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: order_funding
Description: Earnings from completed orders
Effect: Increases wallet balance

Commission Deduction

Type: commission_deduction
Description: Platform commission on orders
Effect: Decreases wallet balance

Payout

Type: payout
Description: Funds transferred to bank account
Effect: Decreases wallet balance

Payout Fee

Type: payout_fee
Description: Processing fee for payouts
Effect: Decreases wallet balance

Refund

Type: refund
Description: Order refunds processed
Effect: Decreases wallet balance

Adjustment

Type: adjustment
Description: Manual balance adjustments
Effect: Can increase or decrease balance

Error Handling

Status Code: 400
Status Code: 400
Status Code: 400
Status Code: 404
Wallet balances are updated in real-time as orders are processed. Pending balances are held for a security period before becoming available for payout.
Set up bank account details before requesting payouts. Processing typically takes 1-3 business days depending on the bank and amount.