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.Update Store
Update store information for the authenticated store owner.Update Store Address
Update only the address information for the authenticated store owner.Approve Store (Admin)
Admin function to approve a store application and initialize its wallet.Reject Store (Admin)
Admin function to reject a store application.Initialize Store Wallet
Initialize wallet for an existing approved store.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.
