Market Creation & Management
7 API calls in this section.
Create Market
/storefront/market/createCreates a new market/storefront for the authenticated tenant. Implements Shopify-like market creation with initial configuration. Request Body Fields: - store_name (required): Unique store identifier (alphanumeric, hyphens, underscores only) - directory_category (optional): Normalized directory category key. Defaults to general - tagline (optional): Multi-language store tagline/slogan - settings (optional): Market settings object - auto_create_delivery (optional, boolean): If true, approving an order group will auto-create a delivery - logo_url (optional): URL to store logo image - theme_settings (optional): Visual theme configuration - banners (optional): Array of banner configurations for the storefront Banner Object Fields: - url (required): Image URL for the banner - title (required): Multi-language banner title - subtitle (optional): Multi-language banner subtitle - link_url (optional): URL to navigate when banner is clicked - is_active (optional): Boolean to control banner visibility - sort_order (optional): Number to control banner display order Features: - Unique store name validation - Multi-language support - Theme customization - Banner management with multi-language support - Automatic default category creation - Draft status by default (requires approval) Business Rules: - Store name must be globally unique - directory_category must match one of the configured directory category keys - Store name format: alphanumeric with hyphens/underscores - Market created in 'draft' status - Banner URL and title are required if banners are provided - Default categories auto-created - Requires system admin approval before going live Authentication Required: Tenant-level access
1curl --request POST "$ONDI_BASE_URL/storefront/market/create" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "store_name": "my-awesome-store",7 "directory_category": "fashion_apparel",8 "tagline": {9 "en": "Quality products for everyone",10 "ar": "منتجات عالية الجودة للجميع",11 "ku": "بەرهەمی کوالیتی بۆ هەمووان"12 },13 "settings": {14 "auto_create_delivery": true15 },16 "logo_url": "https://example.com/my-store-logo.png",17 "theme_settings": {18 "primary_color": "#007AFF",19 "secondary_color": "#FFFFFF",20 "accent_color": "#FF9500",21 "theme_style": "modern"22 },23 "banners": [24 {25 "url": "https://example.com/banner1.jpg",26 "title": {27 "en": "Summer Sale",28 "ar": "تخفيضات الصيف",29 "ku": "فرۆشتنی هاوین"30 },31 "subtitle": {32 "en": "Up to 50% off",33 "ar": "خصم يصل إلى 50%",34 "ku": "تا 50% داشکاندن"35 },36 "link_url": "/categories/electronics",37 "is_active": true,38 "sort_order": 139 },40 {41 "url": "https://example.com/banner2.jpg",42 "title": {43 "en": "New Arrivals",44 "ar": "وصل حديثاً",45 "ku": "گەیشتنی نوێ"46 },47 "subtitle": {48 "en": "Check out our latest products",49 "ar": "تحقق من أحدث منتجاتنا",50 "ku": "بەرهەمە نوێیەکانمان ببینە"51 },52 "link_url": "/products/new",53 "is_active": true,54 "sort_order": 255 }56 ]57}'1{2 "store_name": "my-awesome-store",3 "directory_category": "fashion_apparel",4 "tagline": {5 "en": "Quality products for everyone",6 "ar": "منتجات عالية الجودة للجميع",7 "ku": "بەرهەمی کوالیتی بۆ هەمووان"8 },9 "settings": {10 "auto_create_delivery": true11 },12 "logo_url": "https://example.com/my-store-logo.png",13 "theme_settings": {14 "primary_color": "#007AFF",15 "secondary_color": "#FFFFFF",16 "accent_color": "#FF9500",17 "theme_style": "modern"18 },19 "banners": [20 {21 "url": "https://example.com/banner1.jpg",22 "title": {23 "en": "Summer Sale",24 "ar": "تخفيضات الصيف",25 "ku": "فرۆشتنی هاوین"26 },27 "subtitle": {28 "en": "Up to 50% off",29 "ar": "خصم يصل إلى 50%",30 "ku": "تا 50% داشکاندن"31 },32 "link_url": "/categories/electronics",33 "is_active": true,34 "sort_order": 135 },36 {37 "url": "https://example.com/banner2.jpg",38 "title": {39 "en": "New Arrivals",40 "ar": "وصل حديثاً",41 "ku": "گەیشتنی نوێ"42 },43 "subtitle": {44 "en": "Check out our latest products",45 "ar": "تحقق من أحدث منتجاتنا",46 "ku": "بەرهەمە نوێیەکانمان ببینە"47 },48 "link_url": "/products/new",49 "is_active": true,50 "sort_order": 251 }52 ]53}Request body fields
store_nameExampleExample field from the request body.
directory_categoryExampleExample field from the request body.
taglineExampleExample field from the request body.
tagline.enExampleExample field from the request body.
tagline.arExampleExample field from the request body.
tagline.kuExampleExample field from the request body.
settingsExampleExample field from the request body.
settings.auto_create_deliveryExampleExample field from the request body.
logo_urlExampleExample field from the request body.
theme_settingsExampleExample field from the request body.
theme_settings.primary_colorExampleExample field from the request body.
theme_settings.secondary_colorExampleExample field from the request body.
theme_settings.accent_colorExampleExample field from the request body.
theme_settings.theme_styleExampleExample field from the request body.
bannersExampleExample field from the request body.
banners.urlExampleExample field from the request body.
banners.titleExampleExample field from the request body.
banners.title.enExampleExample field from the request body.
banners.title.arExampleExample field from the request body.
banners.title.kuExampleExample field from the request body.
banners.subtitleExampleExample field from the request body.
banners.subtitle.enExampleExample field from the request body.
banners.subtitle.arExampleExample field from the request body.
banners.subtitle.kuExampleExample field from the request body.
banners.link_urlExampleExample field from the request body.
banners.is_activeExampleExample field from the request body.
banners.sort_orderExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
JWT token for authenticated requests
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "data": {4 "market": {5 "id": "market-uuid-new",6 "tenant_id": "tenant-uuid",7 "code": 1000,8 "directory_category": "fashion_apparel",9 "store_name": "my-awesome-store",10 "status": "draft",11 "publish_status": "unpublished",12 "tagline": {13 "en": "Quality products for everyone",14 "ar": "منتجات عالية الجودة للجميع",15 "ku": "بەرهەمی کوالیتی بۆ هەمووان"16 },17 "logo_url": "https://example.com/my-store-logo.png",18 "theme_settings": {19 "primary_color": "#007AFF",20 "secondary_color": "#FFFFFF",21 "accent_color": "#FF9500",22 "theme_style": "modern"23 },24 "banners": [],25 "approved_by": null,26 "approved_at": null,27 "admin_notes": null,28 "created_at": "2023-12-01T14:00:00Z",29 "updated_at": "2023-12-01T14:00:00Z"30 },31 "message": "Market created successfully. Your store is now in draft status and pending approval."32 }33}1{2 "success": false,3 "message": "Store name already exists. Please choose a different name."4}1{2 "success": false,3 "message": "Validation failed",4 "errors": [5 {6 "field": "store_name",7 "message": "Store name must contain only letters, numbers, hyphens, and underscores"8 }9 ]10}Get Market Details
/storefront/marketRetrieves the market details for the authenticated tenant. Returns comprehensive market information including configuration, status, and metadata. Features: - Complete market configuration - Status and approval information - Theme and branding settings - Banner configurations - Timestamp information - Storefront Command Center extras: readiness, summary, recent_activity Returns: - market — full market object (id, status, publish_status, settings, theme_settings, banners, etc.) - readiness — 7 setup checklist booleans (warehouse_created, store_live, payments_enabled, delivery_configured, products_added, categories_added, domain_connected). domain_connected is optional in UI; the other 6 must all be true for 100% readiness. - summary — KPI counts (total_products active, total_categories, total_customers (market users), total_orders). - recent_activity — up to 5 most recent activity items, mixed types (order | product | review), sorted by timestamp desc. Empty [] when no activity. Authentication Required: Tenant-level access
1curl --request GET "$ONDI_BASE_URL/storefront/market" \2 --header "Authorization: Bearer {{access_token}}"Headers
AuthorizationOptionalBearer {{access_token}}
JWT token for authenticated requests
Responses
1{2 "success": true,3 "market": {4 "id": "market-uuid",5 "tenant_id": "tenant-uuid",6 "code": 1000,7 "store_name": "my-awesome-store",8 "status": "approved",9 "publish_status": "published",10 "tagline": {11 "en": "Quality products for everyone",12 "ar": "منتجات عالية الجودة للجميع",13 "ku": "بەرهەمی کوالیتی بۆ هەمووان"14 },15 "logo_url": "https://example.com/my-store-logo.png",16 "settings": {17 "currency": "USD",18 "payment_methods": [19 "cod",20 "card"21 ],22 "auto_create_delivery": true23 },24 "theme_settings": {25 "primary_color": "#007AFF",26 "secondary_color": "#FFFFFF",27 "accent_color": "#FF9500",28 "theme_style": "modern"29 },30 "banners": [],31 "approved_by": "admin-uuid",32 "approved_at": "2026-04-13T15:00:00Z",33 "admin_notes": "Approved",34 "created_by": "user-uuid",35 "updated_by": "user-uuid",36 "created_at": "2026-04-13T14:00:00Z",37 "updated_at": "2026-04-13T15:30:00Z",38 "is_live": true,39 "is_active": true40 },41 "readiness": {42 "warehouse_created": true,43 "store_live": true,44 "payments_enabled": true,45 "delivery_configured": true,46 "products_added": true,47 "categories_added": true,48 "domain_connected": false49 },50 "summary": {51 "total_products": 12,52 "total_categories": 4,53 "total_customers": 7,54 "total_orders": 2555 },56 "recent_activity": [57 {58 "type": "order",59 "title": "New order #1234",60 "subtitle": "USD 45.00",61 "timestamp": "2026-04-13T10:30:00Z"62 },63 {64 "type": "product",65 "title": "New product: Wireless Mouse",66 "subtitle": "Stock: 50",67 "timestamp": "2026-04-12T18:10:00Z"68 },69 {70 "type": "review",71 "title": "New 5★ review",72 "subtitle": "On Wireless Mouse",73 "timestamp": "2026-04-12T09:00:00Z"74 }75 ]76}1{2 "success": false,3 "message": "Market not found for this tenant"4}Get Market by ID
/storefront/market/{{market_id}}Retrieves market details by specific market ID. Useful for admin operations or when accessing market data from external systems. Path Parameters: - market_id (required): UUID of the market to retrieve Features: - Direct market access by ID - Complete market configuration - Status and approval information - Theme and branding settings - Banner configurations - Timestamp information Returns: - Market ID and basic info - Status (draft, pending_approval, approved, rejected, inactive) - Publish status (published, unpublished) - Theme settings and branding - Banner configurations - Approval workflow data - Tenant information Use Cases: - Admin panel market management - External system integrations - Cross-tenant market lookups - Public market display Authentication Required: Valid authentication token
1curl --request GET "$ONDI_BASE_URL/storefront/market/{{market_id}}" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
market_idRequiredVariable used inside the request path.
Headers
AuthorizationOptionalBearer {{access_token}}
JWT token for authenticated requests
Responses
1{2 "success": true,3 "market": {4 "id": "123e4567-e89b-12d3-a456-426614174000",5 "tenant_id": "tenant-uuid",6 "code": 1000,7 "store_name": "my-awesome-store",8 "status": "approved",9 "publish_status": "published",10 "tagline": {11 "en": "Quality products for everyone",12 "ar": "منتجات عالية الجودة للجميع",13 "ku": "بەرهەمی کوالیتی بۆ هەمووان"14 },15 "logo_url": "https://example.com/my-store-logo.png",16 "theme_settings": {17 "primary_color": "#007AFF",18 "secondary_color": "#FFFFFF",19 "accent_color": "#FF9500",20 "theme_style": "modern"21 },22 "banners": [23 {24 "id": "banner-uuid-1",25 "url": "https://example.com/banner1.jpg",26 "title": {27 "en": "Summer Sale",28 "ar": "تخفيضات الصيف",29 "ku": "فرۆشتنی هاوین"30 },31 "subtitle": {32 "en": "Up to 50% off",33 "ar": "خصم يصل إلى 50%",34 "ku": "تا 50% داشکاندن"35 },36 "link_url": "/categories/electronics",37 "is_active": true,38 "sort_order": 139 }40 ],41 "approved_by": "admin-uuid",42 "approved_at": "2023-12-01T15:00:00Z",43 "admin_notes": "Approved after review. Great store concept!",44 "created_by": "user-uuid",45 "updated_by": "user-uuid",46 "created_at": "2023-12-01T14:00:00Z",47 "updated_at": "2023-12-01T15:30:00Z",48 "is_live": true,49 "is_active": true50 }51}1{2 "success": false,3 "message": "Market not found"4}1{2 "success": false,3 "message": "Market ID required"4}Update Market
/storefront/marketUpdates the market configuration for the authenticated tenant. All fields are optional for partial updates. Request Body Fields (all optional): - directory_category: Normalized directory category key - tagline: Multi-language store tagline/slogan - settings: Market settings object - auto_create_delivery (optional, boolean): If true, approving an order group will auto-create a delivery - logo_url: Updated URL to store logo image - theme_settings: Updated visual theme configuration - banners: Updated banner configurations array Banner Object Fields: - url (required): Image URL for the banner - title (required): Multi-language banner title - subtitle (optional): Multi-language banner subtitle - link_url (optional): URL to navigate when banner is clicked - is_active (optional): Boolean to control banner visibility - sort_order (optional): Number to control banner display order Features: - Partial updates (only provided fields updated) - Multi-language content updates - Theme customization - Banner management with multi-language support - Preserves existing data Business Rules: - Cannot update store_name (requires admin approval) - directory_category must match one of the configured directory category keys - Cannot change status directly (use workflow endpoints) - Banner URL and title are required if banners are provided - Updates reset approval if market was previously approved - Changes require re-approval for going live Authentication Required: Tenant-level access
1curl --request PUT "$ONDI_BASE_URL/storefront/market" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "directory_category": "home_furniture",7 "tagline": {8 "en": "Premium quality, exceptional service",9 "ar": "جودة ممتازة، خدمة استثنائية",10 "ku": "کوالیتی باڵا، خزمەتگوزاری تایبەت"11 },12 "settings": {13 "auto_create_delivery": true14 },15 "logo_url": "https://example.com/updated-logo.png",16 "theme_settings": {17 "primary_color": "#34C759",18 "secondary_color": "#FFFFFF",19 "accent_color": "#30D158",20 "theme_style": "modern"21 },22 "banners": [23 {24 "url": "https://example.com/updated-banner.jpg",25 "title": {26 "en": "Winter Collection",27 "ar": "مجموعة الشتاء",28 "ku": "کۆکراوەی زستان"29 },30 "subtitle": {31 "en": "Warm and cozy items",32 "ar": "عناصر دافئة ومريحة",33 "ku": "بەرگی گەرم و ئارام"34 },35 "link_url": "/categories/winter",36 "is_active": true,37 "sort_order": 138 }39 ]40}'1{2 "directory_category": "home_furniture",3 "tagline": {4 "en": "Premium quality, exceptional service",5 "ar": "جودة ممتازة، خدمة استثنائية",6 "ku": "کوالیتی باڵا، خزمەتگوزاری تایبەت"7 },8 "settings": {9 "auto_create_delivery": true10 },11 "logo_url": "https://example.com/updated-logo.png",12 "theme_settings": {13 "primary_color": "#34C759",14 "secondary_color": "#FFFFFF",15 "accent_color": "#30D158",16 "theme_style": "modern"17 },18 "banners": [19 {20 "url": "https://example.com/updated-banner.jpg",21 "title": {22 "en": "Winter Collection",23 "ar": "مجموعة الشتاء",24 "ku": "کۆکراوەی زستان"25 },26 "subtitle": {27 "en": "Warm and cozy items",28 "ar": "عناصر دافئة ومريحة",29 "ku": "بەرگی گەرم و ئارام"30 },31 "link_url": "/categories/winter",32 "is_active": true,33 "sort_order": 134 }35 ]36}Request body fields
directory_categoryExampleExample field from the request body.
taglineExampleExample field from the request body.
tagline.enExampleExample field from the request body.
tagline.arExampleExample field from the request body.
tagline.kuExampleExample field from the request body.
settingsExampleExample field from the request body.
settings.auto_create_deliveryExampleExample field from the request body.
logo_urlExampleExample field from the request body.
theme_settingsExampleExample field from the request body.
theme_settings.primary_colorExampleExample field from the request body.
theme_settings.secondary_colorExampleExample field from the request body.
theme_settings.accent_colorExampleExample field from the request body.
theme_settings.theme_styleExampleExample field from the request body.
bannersExampleExample field from the request body.
banners.urlExampleExample field from the request body.
banners.titleExampleExample field from the request body.
banners.title.enExampleExample field from the request body.
banners.title.arExampleExample field from the request body.
banners.title.kuExampleExample field from the request body.
banners.subtitleExampleExample field from the request body.
banners.subtitle.enExampleExample field from the request body.
banners.subtitle.arExampleExample field from the request body.
banners.subtitle.kuExampleExample field from the request body.
banners.link_urlExampleExample field from the request body.
banners.is_activeExampleExample field from the request body.
banners.sort_orderExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
JWT token for authenticated requests
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "data": {4 "market": {5 "id": "market-uuid",6 "tenant_id": "tenant-uuid",7 "code": 1000,8 "directory_category": "home_furniture",9 "store_name": "my-awesome-store",10 "status": "approved",11 "publish_status": "published",12 "tagline": {13 "en": "Premium quality, exceptional service",14 "ar": "جودة ممتازة، خدمة استثنائية",15 "ku": "کوالیتی باڵا، خزمەتگوزاری تایبەت"16 },17 "logo_url": "https://example.com/updated-logo.png",18 "theme_settings": {19 "primary_color": "#34C759",20 "secondary_color": "#FFFFFF",21 "accent_color": "#30D158",22 "theme_style": "modern"23 },24 "banners": [],25 "updated_at": "2023-12-01T16:00:00Z"26 },27 "message": "Market updated successfully"28 }29}Submit Market for Approval
/storefront/market/submit-for-approvalSubmits the market for system admin approval. Changes status from 'draft' to 'pending_approval'. Request Body Fields: - notes (optional): Message to admin reviewers explaining the submission Features: - Status transition to pending_approval - Optional notes for admin review - Validates market completeness - Triggers admin notification Business Rules: - Market must be in 'draft' status - Market must have basic information completed - Market must have at least one product category - Cannot resubmit if already pending or approved Workflow: 1. Validates market readiness 2. Changes status to 'pending_approval' 3. Notifies system administrators 4. Market enters approval queue Authentication Required: Tenant-level access
1curl --request POST "$ONDI_BASE_URL/storefront/market/submit-for-approval" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "notes": "Ready for review. All products are properly categorized and store information is complete."7}'1{2 "notes": "Ready for review. All products are properly categorized and store information is complete."3}Request body fields
notesExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
JWT token for authenticated requests
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "data": {4 "market": {5 "id": "market-uuid",6 "status": "pending_approval",7 "updated_at": "2023-12-01T16:30:00Z"8 },9 "message": "Market submitted for approval successfully. You will be notified once reviewed."10 }11}1{2 "success": false,3 "message": "Market is not in draft status and cannot be submitted for approval"4}Toggle Market Publishing
/storefront/market/publishToggles the publishing status of an approved market. Controls whether the market is publicly accessible. Request Body Fields: - is_published (required): Boolean - true to publish, false to unpublish Features: - Publish/unpublish approved markets - Instant public visibility control - Maintains approval status - Reversible action Business Rules: - Market must be in 'approved' status - Only approved markets can be published - Published markets are publicly accessible - Unpublished markets are hidden from public Values: - true: Makes approved market publicly accessible - false: Hides market from public while keeping approval Authentication Required: Tenant-level access
1curl --request POST "$ONDI_BASE_URL/storefront/market/publish" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "is_published": true7}'1{2 "is_published": true3}Request body fields
is_publishedExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
JWT token for authenticated requests
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "data": {4 "market": {5 "id": "market-uuid",6 "tenant_id": "tenant-uuid",7 "code": 1000,8 "store_name": "my-awesome-store",9 "status": "approved",10 "publish_status": "published",11 "tagline": {12 "en": "Quality products for everyone",13 "ar": "منتجات عالية الجودة للجميع",14 "ku": "بەرهەمی کوالیتی بۆ هەمووان"15 },16 "logo_url": "https://example.com/my-store-logo.png",17 "theme_settings": {18 "primary_color": "#007AFF",19 "secondary_color": "#FFFFFF",20 "accent_color": "#FF9500",21 "theme_style": "modern"22 },23 "banners": [],24 "approved_by": "admin-uuid",25 "approved_at": "2023-12-01T15:00:00Z",26 "admin_notes": "Approved after review",27 "created_by": "user-uuid",28 "updated_by": "user-uuid",29 "created_at": "2023-12-01T14:00:00Z",30 "updated_at": "2023-12-01T17:00:00Z",31 "is_live": true,32 "is_active": true33 },34 "message": "Market published successfully. Your store is now live!"35 }36}1{2 "success": true,3 "data": {4 "market": {5 "id": "market-uuid",6 "tenant_id": "tenant-uuid",7 "code": 1000,8 "store_name": "my-awesome-store",9 "status": "approved",10 "publish_status": "unpublished",11 "tagline": {12 "en": "Quality products for everyone",13 "ar": "منتجات عالية الجودة للجميع",14 "ku": "بەرهەمی کوالیتی بۆ هەمووان"15 },16 "logo_url": "https://example.com/my-store-logo.png",17 "theme_settings": {18 "primary_color": "#007AFF",19 "secondary_color": "#FFFFFF",20 "accent_color": "#FF9500",21 "theme_style": "modern"22 },23 "banners": [],24 "approved_by": "admin-uuid",25 "approved_at": "2023-12-01T15:00:00Z",26 "admin_notes": "Approved after review",27 "created_by": "user-uuid",28 "updated_by": "user-uuid",29 "created_at": "2023-12-01T14:00:00Z",30 "updated_at": "2023-12-01T17:30:00Z",31 "is_live": false,32 "is_active": true33 },34 "message": "Market unpublished successfully. Your store is now hidden from public."35 }36}1{2 "success": false,3 "message": "Market must be approved before it can be published"4}Check Store Name Availability
/storefront/market/check-name?store_name=my-new-storeChecks if a store name is available for use. Validates both availability and format. Query Parameters: - store_name (required): Store name to check for availability Features: - Real-time availability checking - Format validation - Global uniqueness verification - Instant feedback for UI Validation Rules: - Must be 2-100 characters long - Alphanumeric characters only - Hyphens and underscores allowed - No spaces or special characters - Globally unique across all markets Use Cases: - Form validation during market creation - Real-time feedback in store setup - Preventing duplicate store names Authentication Required: Tenant-level access
1curl --request GET "$ONDI_BASE_URL/storefront/market/check-name?store_name=my-new-store" \2 --header "Authorization: Bearer {{access_token}}"Query parameters
store_nameOptionalmy-new-store
Store name to check for availability
Headers
AuthorizationOptionalBearer {{access_token}}
JWT token for authenticated requests
Responses
1{2 "success": true,3 "data": {4 "store_name": "my-unique-store",5 "available": true,6 "message": "Store name is available"7 }8}1{2 "success": true,3 "data": {4 "store_name": "existing-store",5 "available": false,6 "message": "Store name is already taken"7 }8}1{2 "success": false,3 "message": "Store name must contain only letters, numbers, hyphens, and underscores"4}