Overview
Store Onboarding API provides administrative functions for creating and managing stores, products, store categories, and delivery zones on behalf of store owners. These are admin-only mutations used during the onboarding flow or for ongoing store management. Location:convex/admins/storeOnboarding.ts
Admin Create Store
Creates a new store with optional auto-approval. When auto-approved, the store is immediately set to active and a wallet is initialized. Increments thestoreCount on the assigned primary category.
Store name
Store name in Arabic
Store description
Primary category ID for the store
Owner’s Clerk user ID. Defaults to
"admin_managed" if not provided.Store owner’s full name
Store owner’s phone number
Store contact email
Storage ID for the store logo image
Storage ID for the store cover/banner image
Storage ID for the trade license document
If true, store is created with
approved status, isActive: true, and a wallet is initialized automaticallyStore settings:
deliveryEnabled— Whether delivery is enabledpickupEnabled— Whether pickup is enabledallowsReturns— Whether returns are acceptedreturnWindowDays— Return window in days
Bank account details:
IBAN— Bank IBAN numberbankName— Bank namebankId— Bank ID referenceaccountHolderName— Account holder name
Store address:
fullAddress— Full address stringcity— City IDarea— Area IDflatVilaNumber— Flat/villa numberbuildingNameNumber— Building name or numberlandmark— Nearby landmarklatitude— Latitude coordinatelongitude— Longitude coordinate
Admin Update Store
Updates an existing store’s fields. Only provided fields are updated. IfprimaryCategory changes, the denormalized storeCount on both old and new categories is updated.
Store ID to update
Updated store name
Updated store name in Arabic
Updated description
Updated primary category (triggers counter updates)
Updated owner user ID
Updated owner name
Updated phone number
Updated email
Updated logo storage ID
Updated cover image storage ID
Updated trade license storage ID
Updated store settings (same structure as create)
Updated bank account details (same structure as create)
Updated store address (same structure as create)
Admin Create Product
Creates a product for a store. Validates that the product category is a child of the store’s primary category.Store ID to add the product to
Product name
Product description
Product category ID (must be a child of the store’s primary category)
Product price in AED
Product cost (for profit tracking)
Available stock quantity
Low stock alert threshold
Preparation time value
Preparation time unit:
minutes, hours, or daysWhether the product is active and visible
Storage ID for the primary product image
Additional product image storage IDs
Whether the product can be returned
Whether delivery is available for this product
Whether pickup is available for this product
Admin Update Product
Updates an existing product. Only provided fields are modified.Product ID to update
Updated product name
Updated description
Updated category
Updated price
Updated cost
Updated stock quantity
Updated stock alert threshold
Updated preparation time
Updated preparation time unit:
minutes, hours, or daysUpdated active status
Updated primary image storage ID
Updated additional images
Updated returnable flag
Updated delivery flag
Updated pickup flag
Admin Delete Product
Permanently deletes a product from the database.Product ID to delete
Admin Create Store Category
Creates a store-level category under the store’s primary category. Store categories are used to organize products within a store.Store ID to create the category for
Category name in English
Category name in Arabic
Whether the category is active (default: true)
Admin Update Store Category
Updates a store-level category. Cannot update global (platform-level) categories.Category ID to update
Updated category name
Updated Arabic category name
Updated active status
This mutation only works on store-level categories (those with a
storeId field). Attempting to update a global category will throw an error.Admin Delete Store Category
Permanently deletes a store-level category. Cannot delete global categories.Category ID to delete
This mutation only works on store-level categories. Products assigned to this category will retain their category reference, but the category will no longer exist.
Admin Create Delivery Zone
Creates or updates a delivery zone for a store. If a zone already exists for the same store and city combination, it is updated (upsert behavior).Store ID to create the delivery zone for
City ID for the delivery zone
Array of area configurations, each containing:
area(Id<‘areas’>, required) — Area IDdeliveryFee(number) — Delivery fee for this area in AEDdeliveryTime(number) — Estimated delivery timedeliveryTimeUnit(string) — Time unit:minutes,hours, ordays
Default delivery fee for the zone in AED
Default delivery time for the zone
Default delivery time unit:
minutes, hours, or daysIf a delivery zone for the same store + city combination already exists, the zone is updated instead of creating a duplicate. The response
action field indicates whether the zone was "created" or "updated".Admin Delete Delivery Zone
Permanently deletes a delivery zone.Delivery zone ID to delete
