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.Store name for public display
Primary business category ID
Store logo image storage ID
Store cover/banner image storage ID
Trade license document storage ID
Update Store
Update store information for the authenticated store owner.Updated store name
Updated primary category
Updated store logo
Updated cover image
Updated trade license
Store status (admin only)
Status reason or notes
Store operational settings including delivery, pickup, and live status
Bank account details for payouts
Store physical address and location details
Update Store Address
Update only the address information for the authenticated store owner.Complete formatted address string
City ID reference
Area/district ID reference
Flat or villa number
Building name or number
Nearby landmark for easier location
GPS latitude coordinate
GPS longitude coordinate
Approve Store (Admin)
Admin function to approve a store application and initialize its wallet.Store ID to approve
Reason for approval (optional)
Reject Store (Admin)
Admin function to reject a store application.Store ID to reject
Detailed reason for rejection
Initialize Store Wallet
Initialize wallet for an existing approved store.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.
