Overview
The Store Operations API handles the complete store lifecycle including registration, updates, approval workflows, and wallet initialization. This system manages the onboarding process for new merchants and provides administrative tools for store management. Location:convex/stores/operations.ts
Store Lifecycle
1
Store Registration
Merchant registers their store with basic information and documents
2
Document Review
Admin reviews trade license and store information
3
Approval/Rejection
Admin approves or rejects the store application
4
Wallet Initialization
Approved stores get a wallet for payment processing
5
Store Goes Live
Store can start selling products to customers
Register Store
Register a new store for the authenticated user.string
required
Store name for public display
Id<'categories'>
required
Primary business category ID
Id<'_storage'>
Store logo image storage ID
Id<'_storage'>
Store cover/banner image storage ID
Id<'_storage'>
required
Trade license document storage ID
Update Store
Update store information for the authenticated store owner.string
Updated store name
Id<'categories'>
Updated primary category
Id<'_storage'>
Updated store logo
Id<'_storage'>
Updated cover image
Id<'_storage'>
Updated trade license
'pending' | 'approved' | 'rejected'
Store status (admin only)
string
Status reason or notes
object
Store operational settings including delivery, pickup, and live status
object
Bank account details for payouts
object
Store physical address and location details
Update Store Address
Update only the address information for the authenticated store owner.string
Complete formatted address string
Id<'cities'>
City ID reference
Id<'areas'>
Area/district ID reference
string
Flat or villa number
string
Building name or number
string
Nearby landmark for easier location
string
GPS latitude coordinate
string
GPS longitude coordinate
Approve Store (Admin)
Admin function to approve a store application and initialize its wallet.Id<'stores'>
required
Store ID to approve
string
Reason for approval (optional)
Reject Store (Admin)
Admin function to reject a store application.Id<'stores'>
required
Store ID to reject
string
required
Detailed reason for rejection
Initialize Store Wallet
Initialize wallet for an existing approved store.Id<'stores'>
required
Store ID to initialize wallet for
Bulk Initialize Wallets (Admin)
Admin function to bulk initialize wallets for all approved stores without wallets.Store Registration Form
Complete store registration component:Store Status Management
Store applications go through several status states:Pending
Initial status when store is registered. Awaiting admin review.
Under Review
Admin is actively reviewing documents and store information.
Approved
Store is approved and can start selling. Wallet is automatically initialized.
Rejected
Store application rejected. Reason provided for resubmission.
Admin Review Process
For administrators reviewing store applications:Error Handling
Store already exists
Store already exists
Status Code:
400Invalid category
Invalid category
Status Code:
404Missing trade license
Missing trade license
Status Code:
400Store not found
Store not found
Status Code:
404Store registration requires a valid trade license document. The approval process typically takes 24-48 hours for document verification.
