🏪 Marketplace API

Complete API documentation for the Kurdish Marketplace platform

🟢 API Status: Online 📍 Base URL: https://lunax-marketplace.dmsystem.dpdns.org/api
🇮🇶 Kurdish (Sorani) ckb
🇬🇧 English en
✨ All endpoints support bilingual content - Just send both Kurdish and English versions!

🏪 Store Management

GET

/stores

Get all stores with their products, reels, and discounts

fetch('https://lunax-marketplace.dmsystem.dpdnsorg//api/stores', {
  headers: {
    'Accept': 'application/json'
  }
})
[
  {
    "id": "65f8a1b2c3d4e5f6a7b8c9d0",
    "logo": "https://example.com/logo.jpg",
    "name": {
      "kurdish": "فرۆشگای ئەلیکترۆنی",
      "english": "Electronic Store"
    },
    "address": "Sulaymaniyah, Kurdistan",
    "phone_number": "+9647701234567",
    "products": [...],
    "reels": [...],
    "discounts": [...]
  }
]
POST

/stores

Create a new store (requires bilingual name)

{
  "logo": "https://example.com/logo.jpg",
  "coverImage": "https://example.com/cover.jpg",
  "name": {
    "kurdish": "ناوی فرۆشگا بە کوردی",
    "english": "Store Name in English"
  },
  "address": "Full address here",
  "phone_number": "+9647701234567",
  "description": "Store description",
  "category": "electronics"
}
{
  "id": "65f8a1b2c3d4e5f6a7b8c9d0",
  "logo": "https://example.com/logo.jpg",
  "name": {
    "kurdish": "ناوی فرۆشگا بە کوردی",
    "english": "Store Name in English"
  },
  "createdAt": "2024-03-19T10:30:00.000Z"
}

📦 Product Management

GET

/products/store/:storeId

Get all products for a specific store

fetch('https://lunax-marketplace.dmsystem.dpdns.org//api/products/stor/65f8a1b2c3d4e5f6a7b8c9d0')
[
  {
    "id": "65f8a1b2c3d4e5f6a7b8c9d1",
    "name": {
      "kurdish": "مۆبایل",
      "english": "Smartphone"
    },
    "price": 899.99,
    "discount_price": 809.99,
    "category": "electronics",
    "specifications": [
      {"key": "RAM", "value": "8GB"},
      {"key": "Storage", "value": "256GB"}
    ]
  }
]
GET

/products/search?q=:query&category=:category

Search products by name or category

fetch('https://lunax-marketplace.dmsystem.dpdns.org//api/products/search?q=smartphone&categor=electronics')
[
  {
    "id": "65f8a1b2c3d4e5f6a7b8c9d1",
    "name": {
      "kurdish": "مۆبایل",
      "english": "Smartphone"
    },
    "store": {
      "id": "65f8a1b2c3d4e5f6a7b8c9d0",
      "name": "Electronic Store"
    }
  }
]

🎥 Reel/Video Management

⚠️ Important Rules:
  • 📏 Max duration: 5 minutes (300 seconds)
  • 📊 Daily limit: 5 videos per store
  • 🎯 Supported formats: MP4, MOV, AVI
  • 📁 Max file size: 300MB
GET

/reels/limit/:storeId

Check daily upload limit for a store

POST

/reels/upload

Upload a new reel (multipart/form-data)

GET

/reels/feed?page=1&limit=20

Get paginated reel feed

💰 Discount Management

POST

/discounts

Create a new discount (percentage 0-100%)

{
  "store_id": "65f8a1b2c3d4e5f6a7b8c9d0",
  "product_id": "65f8a1b2c3d4e5f6a7b8c9d1",
  "amount": 15,
  "startDate": "2024-03-20T00:00:00.000Z",
  "endDate": "2024-04-20T00:00:00.000Z"
}
GET

/discounts/active

Get all active discounts

☁️ Openinary Video Test

✅ Openinary is working! Use this tool to test video uploads directly.

📋 Quick Reference

Endpoint Method Description
/stores GET Get all stores
/stores POST Create store
/stores/:id GET Get store by ID
/products/store/:storeId GET Get store products
/products/search GET Search products
/reels/upload POST Upload video (multipart)
/reels/limit/:storeId GET Check upload limit
/reels/feed GET Get video feed