Skip to main content

Overview

Sellers can create, update, and delete their own product listings. All product management endpoints require Seller authentication.
For detailed product API documentation including creation, updates, and general product operations, see the Products API section.

Get Seller Products by Category (Seller)

Retrieves paginated products for a specific seller and category.

Path Parameters

sellerId
string (uuid)
required
Seller identifier (must match authenticated seller)
categoryId
string (uuid)
required
Category identifier
page
integer
required
Page number (starts at 1)

Query Parameters

pageSize
integer
default:"20"
Number of products per page

Response

items
array
Array of product objects
totalCount
integer
Total products in this category
currentPage
integer
Current page number
totalPages
integer
Total number of pages

Response Codes

  • 200 OK - Products retrieved
  • 404 Not Found - Seller or category not found

Example

cURL
curl -X GET "https://your-server.com/api/products/seller/seller-uuid/category/category-uuid/page/1?pageSize=20" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Success Response

{
  "items": [
    {
      "id": "product-uuid-1",
      "name": "Premium Wireless Headphones",
      "price": 249.99,
      "discountPrice": 199.99,
      "mainPhotoUrl": "https://cdn.example.com/products/headphones.jpg",
      "inStock": true,
      "quantity": 15,
      "averageRating": 4.5,
      "reviewCount": 128
    },
    {
      "id": "product-uuid-2",
      "name": "Noise Cancelling Earbuds",
      "price": 129.99,
      "discountPrice": null,
      "mainPhotoUrl": "https://cdn.example.com/products/earbuds.jpg",
      "inStock": true,
      "quantity": 42,
      "averageRating": 4.7,
      "reviewCount": 89
    }
  ],
  "totalCount": 45,
  "currentPage": 1,
  "totalPages": 3
}

Create Product (Seller)

See Products API - Create Product for detailed documentation. Quick Reference:
cURL
curl -X POST "https://your-server.com/api/products" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -F "name=Premium Headphones" \
  -F "description=High-quality audio" \
  -F "price=249.99" \
  -F "quantity=50" \
  -F "categoryId=category-uuid" \
  -F "sellerId=seller-uuid" \
  -F "mainPhoto=@/path/to/image.jpg"

Update Product General Info (Seller)

See Products API - Update General Info.

Request Body

name
string
Updated product name
description
string
Updated product description
quantity
integer
Updated stock quantity

Example

cURL
curl -X PATCH "https://your-server.com/api/products/product/product-uuid/general-info" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Product Name",
    "description": "Updated description with more details",
    "quantity": 100
  }'

Update Product Price (Seller)

See Products API - Update Price.

Example

cURL
curl -X PATCH "https://your-server.com/api/products/product/product-uuid/price" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"newPrice": 229.99}'

Add Product Discount (Seller)

See Discounts API - Add Discount.

Example

cURL
curl -X POST "https://your-server.com/api/products/product/product-uuid/discount" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "discountPercentage": 20,
    "startDate": "2024-01-20T00:00:00Z",
    "endDate": "2024-01-31T23:59:59Z"
  }'

Change Product Main Photo (Seller)

Changes the main display photo for a product.

Path Parameters

productId
string (uuid)
required
Product identifier
newMainPhotoId
string (uuid)
required
ID of the media item to set as main photo (must be an existing product photo)

Response Codes

  • 204 No Content - Main photo updated
  • 400 Bad Request - Invalid photo ID or photo doesn’t belong to product
  • 404 Not Found - Product or photo not found

Example

cURL
curl -X PATCH "https://your-server.com/api/products/product/product-uuid/new-main-photo/photo-uuid" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Add Product Media (Seller)

Adds additional images or videos to a product.

Request Body (multipart/form-data)

productId
string (uuid)
required
Product identifier
media
file[]
required
Media files to add (images or videos)

Response Codes

  • 204 No Content - Media added
  • 400 Bad Request - Invalid file format or size
  • 404 Not Found - Product not found

Example

cURL
curl -X PATCH "https://your-server.com/api/products/add-product-media" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -F "productId=product-uuid" \
  -F "media=@/path/to/photo1.jpg" \
  -F "media=@/path/to/photo2.jpg"

Delete Product Media (Seller)

Removes a media file from a product.

Path Parameters

productId
string (uuid)
required
Product identifier
mediaId
string (uuid)
required
Media item identifier to delete

Response Codes

  • 204 No Content - Media deleted
  • 400 Bad Request - Cannot delete main photo or invalid media
  • 404 Not Found - Product or media not found

Example

cURL
curl -X DELETE "https://your-server.com/api/products/product/product-uuid/media/media-uuid" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Cannot delete the main product photo. Set a different photo as main before deleting.

Delete Product (Seller)

See Products API - Delete Product.

Example

cURL
curl -X DELETE "https://your-server.com/api/products/product-uuid" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Product Management Tips

Product Creation Checklist

1

Choose Category

Select the appropriate category for your product
2

Get Category Attributes

Fetch required attributes for the category using /api/categories/child/{childId}/attributes
3

Prepare Product Data

Gather product information, pricing, and stock quantity
4

Prepare Images

Prepare high-quality product images (recommended: 1200x1200px)
5

Create Product

Submit product creation request with all required data
6

Add Additional Media

Optionally add more images or videos

Image Guidelines

Recommended Image Specifications:
  • Format: JPEG or PNG
  • Resolution: 1200x1200px or higher
  • Aspect Ratio: Square (1:1) preferred
  • File Size: Under 2MB per image
  • Background: Clean white or neutral background

Inventory Management

// Track low stock products
async function checkLowStock(sellerId) {
  const products = await fetchSellerProducts(sellerId);
  
  const lowStock = products.filter(p => p.quantity < 10 && p.quantity > 0);
  const outOfStock = products.filter(p => p.quantity === 0);
  
  if (lowStock.length > 0) {
    notifySeller('Low Stock Alert', `${lowStock.length} products running low`);
  }
  
  if (outOfStock.length > 0) {
    notifySeller('Out of Stock', `${outOfStock.length} products out of stock`);
  }
}

Pricing Strategies

Competitive Pricing: Research similar products to price competitively
Seasonal Discounts: Use discount features for seasonal promotions
Bundle Pricing: Consider creating product bundles for better value

Build docs developers (and LLMs) love