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.
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.
Admin Create Product
Creates a product for a store. Validates that the product category is a child of the store’s primary category.Admin Update Product
Updates an existing product. Only provided fields are modified.Admin Delete Product
Permanently deletes a product from the database.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.Admin Update Store Category
Updates a store-level category. Cannot update global (platform-level) categories.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.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).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
If 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".