Skip to main content

Market Creation & Management

7 API calls in this section.

Create Market​

Storefront & Commerce / Market Creation & Management
POST/storefront/market/create

Creates 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 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

Headers

ParameterTypeDescription
Authorizationstring

JWT token for authenticated requests

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
store_namestring—
directory_categorystring—
taglineobject—
tagline.enstring—
tagline.arstring—
tagline.kustring—
settingsobject—
settings.auto_create_deliveryboolean—
logo_urlstring—
theme_settingsobject—
theme_settings.primary_colorstring—
theme_settings.secondary_colorstring—
Show 15 more body fields

Additional body parameters

ParameterTypeDescription
theme_settings.accent_colorstring—
theme_settings.theme_stylestring—
bannersarray<object>—
banners.urlstring—
banners.titleobject—
banners.title.enstring—
banners.title.arstring—
banners.title.kustring—
banners.subtitleobject—
banners.subtitle.enstring—
banners.subtitle.arstring—
banners.subtitle.kustring—
banners.link_urlstring—
banners.is_activeboolean—
banners.sort_ordernumber—
Staging
Request
curl
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

201Created
Response body
json
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 & Commerce / Market Creation & Management
GET/storefront/market

Retrieves 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

Headers

ParameterTypeDescription
Authorizationstring

JWT token for authenticated requests

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/storefront/market" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

200OK
Response body
json
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 & Commerce / Market Creation & Management
GET/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

ParameterTypeDescription
market_idRequiredstring

Variable used inside the request path.

Headers

ParameterTypeDescription
Authorizationstring

JWT token for authenticated requests

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/storefront/market/${MARKET_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

200Success - Market Found
Response body
json
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 & Commerce / Market Creation & Management
PUT/storefront/market

Updates the market configuration for the authenticated tenant. All fields are optional for partial updates.

  • 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

Headers

ParameterTypeDescription
Authorizationstring

JWT token for authenticated requests

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
directory_categorystring—
taglineobject—
tagline.enstring—
tagline.arstring—
tagline.kustring—
settingsobject—
settings.auto_create_deliveryboolean—
logo_urlstring—
theme_settingsobject—
theme_settings.primary_colorstring—
theme_settings.secondary_colorstring—
theme_settings.accent_colorstring—
Show 14 more body fields

Additional body parameters

ParameterTypeDescription
theme_settings.theme_stylestring—
bannersarray<object>—
banners.urlstring—
banners.titleobject—
banners.title.enstring—
banners.title.arstring—
banners.title.kustring—
banners.subtitleobject—
banners.subtitle.enstring—
banners.subtitle.arstring—
banners.subtitle.kustring—
banners.link_urlstring—
banners.is_activeboolean—
banners.sort_ordernumber—
Staging
Request
curl
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

200OK
Response body
json
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 & Commerce / Market Creation & Management
POST/storefront/market/submit-for-approval

Submits 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_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

Headers

ParameterTypeDescription
Authorizationstring

JWT token for authenticated requests

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
notesstring—
Staging
Request
curl
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

200OK
Response body
json
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 & Commerce / Market Creation & Management
POST/storefront/market/publish

Toggles 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

ParameterTypeDescription
Authorizationstring

JWT token for authenticated requests

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
is_publishedboolean—
Staging
Request
curl
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

200OK
Response body
json
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 & Commerce / Market Creation & Management
GET/storefront/market/check-name

Checks 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

ParameterTypeDescription
store_namestring

Store name to check for availability

Example: my-new-store

Headers

ParameterTypeDescription
Authorizationstring

JWT token for authenticated requests

Example: Bearer {{access_token}}

Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "data": {4    "store_name": "my-unique-store",5    "available": true,6    "message": "Store name is available"7  }8}