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.
store_name(required): Unique store identifier (alphanumeric, hyphens, underscores only)directory_category(optional): Normalized directory category key. Defaults togeneraltagline (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 imagetheme_settings(optional): Visual theme configurationbanners (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 clickedis_active(optional): Boolean to control banner visibilitysort_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_categorymust match one of the configured directory category keysStore 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
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | JWT token for authenticated requests Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
store_name | string | — |
directory_category | string | — |
tagline | object | — |
tagline.en | string | — |
tagline.ar | string | — |
tagline.ku | string | — |
settings | object | — |
settings.auto_create_delivery | boolean | — |
logo_url | string | — |
theme_settings | object | — |
theme_settings.primary_color | string | — |
theme_settings.secondary_color | string | — |
Show 15 more body fields
Additional body parameters
| Parameter | Type | Description |
|---|---|---|
theme_settings.accent_color | string | — |
theme_settings.theme_style | string | — |
banners | array<object> | — |
banners.url | string | — |
banners.title | object | — |
banners.title.en | string | — |
banners.title.ar | string | — |
banners.title.ku | string | — |
banners.subtitle | object | — |
banners.subtitle.en | string | — |
banners.subtitle.ar | string | — |
banners.subtitle.ku | string | — |
banners.link_url | string | — |
banners.is_active | boolean | — |
banners.sort_order | number | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/storefront/market/create" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "store_name": "my-awesome-store",6 "directory_category": "fashion_apparel",7 "tagline": {8 "en": "Quality products for everyone",9 "ar": "منتجات عالية الجودة للجميع",10 "ku": "بەرهەمی کوالیتی بۆ هەمووان"11 },12 "settings": {13 "auto_create_delivery": true14 },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 "url": "https://example.com/banner1.jpg",25 "title": {26 "en": "Summer Sale",27 "ar": "تخفيضات الصيف",28 "ku": "فرۆشتنی هاوین"29 },30 "subtitle": {31 "en": "Up to 50% off",32 "ar": "خصم يصل إلى 50%",33 "ku": "تا 50% داشکاندن"34 },35 "link_url": "/categories/electronics",36 "is_active": true,37 "sort_order": 138 },39 {40 "url": "https://example.com/banner2.jpg",41 "title": {42 "en": "New Arrivals",43 "ar": "وصل حديثاً",44 "ku": "گەیشتنی نوێ"45 },46 "subtitle": {47 "en": "Check out our latest products",48 "ar": "تحقق من أحدث منتجاتنا",49 "ku": "بەرهەمە نوێیەکانمان ببینە"50 },51 "link_url": "/products/new",52 "is_active": true,53 "sort_order": 254 }55 ]56}'Response examples
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}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_connectedis optional in UI; the other 6 must all be true for 100% readiness.summary— KPI counts (total_productsactive,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
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | JWT token for authenticated requests Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/storefront/market" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
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}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.
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
Path parameters
| Parameter | Type | Description |
|---|---|---|
market_idRequired | string | Variable used inside the request path. |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | JWT token for authenticated requests Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/storefront/market/${MARKET_ID}" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
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}Update Market
/storefront/marketUpdates the market configuration for the authenticated tenant. All fields are optional for partial updates.
directory_category: Normalized directory category keytagline: 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 imagetheme_settings: Updated visual theme configurationbanners: 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 clickedis_active(optional): Boolean to control banner visibilitysort_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_categorymust match one of the configured directory category keysCannot 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
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | JWT token for authenticated requests Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
directory_category | string | — |
tagline | object | — |
tagline.en | string | — |
tagline.ar | string | — |
tagline.ku | string | — |
settings | object | — |
settings.auto_create_delivery | boolean | — |
logo_url | string | — |
theme_settings | object | — |
theme_settings.primary_color | string | — |
theme_settings.secondary_color | string | — |
theme_settings.accent_color | string | — |
Show 14 more body fields
Additional body parameters
| Parameter | Type | Description |
|---|---|---|
theme_settings.theme_style | string | — |
banners | array<object> | — |
banners.url | string | — |
banners.title | object | — |
banners.title.en | string | — |
banners.title.ar | string | — |
banners.title.ku | string | — |
banners.subtitle | object | — |
banners.subtitle.en | string | — |
banners.subtitle.ar | string | — |
banners.subtitle.ku | string | — |
banners.link_url | string | — |
banners.is_active | boolean | — |
banners.sort_order | number | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/storefront/market" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "directory_category": "home_furniture",6 "tagline": {7 "en": "Premium quality, exceptional service",8 "ar": "جودة ممتازة، خدمة استثنائية",9 "ku": "کوالیتی باڵا، خزمەتگوزاری تایبەت"10 },11 "settings": {12 "auto_create_delivery": true13 },14 "logo_url": "https://example.com/updated-logo.png",15 "theme_settings": {16 "primary_color": "#34C759",17 "secondary_color": "#FFFFFF",18 "accent_color": "#30D158",19 "theme_style": "modern"20 },21 "banners": [22 {23 "url": "https://example.com/updated-banner.jpg",24 "title": {25 "en": "Winter Collection",26 "ar": "مجموعة الشتاء",27 "ku": "کۆکراوەی زستان"28 },29 "subtitle": {30 "en": "Warm and cozy items",31 "ar": "عناصر دافئة ومريحة",32 "ku": "بەرگی گەرم و ئارام"33 },34 "link_url": "/categories/winter",35 "is_active": true,36 "sort_order": 137 }38 ]39}'Response examples
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'.
notes (optional): Message to admin reviewers explaining the submission
Features
Status transition to
pending_approvalOptional 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
Validates market readiness
Changes status to '
pending_approval'Notifies system administrators
Market enters approval queue
Authentication Required
Tenant-level access
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | JWT token for authenticated requests Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
notes | string | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/storefront/market/submit-for-approval" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "notes": "Ready for review. All products are properly categorized and store information is complete."6}'Response examples
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}Toggle Market Publishing
/storefront/market/publishToggles the publishing status of an approved market. Controls whether the market is publicly accessible.
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
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | JWT token for authenticated requests Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
is_published | boolean | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/storefront/market/publish" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "is_published": true6}'Response examples
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}Check Store Name Availability
/storefront/market/check-nameChecks if a store name is available for use. Validates both availability and format.
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
Query parameters
| Parameter | Type | Description |
|---|---|---|
store_name | string | Store name to check for availability Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | JWT token for authenticated requests Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/storefront/market/check-name?store_name=my-new-store" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "data": {4 "store_name": "my-unique-store",5 "available": true,6 "message": "Store name is available"7 }8}