Products
Product management operations
Retrieves a list of all products.
The number of products to return.
10
The number of products to skip.
0
A list of products.
Unauthorized.
GET /api/v1/products HTTP/1.1
Host: localhost:3000
Accept: */*
{
"limit": 1,
"offset": 1,
"total": 1,
"products": [
{
"_id": "text",
"name": "text",
"description": "text",
"slug": "text",
"price": 1,
"discountedPrice": 1,
"stock": 1,
"category": "text",
"brand": "text",
"images": [
{
"publicId": "text",
"url": "text",
"width": 1,
"height": 1
}
],
"ratings": {
"average": 1,
"count": 1
},
"isFeatured": true,
"retailer": "text",
"likesCount": 1,
"commentsCount": 1,
"createdAt": "2025-10-21T06:01:19.680Z",
"updatedAt": "2025-10-21T06:01:19.680Z"
}
]
}
Creates a new product (retailer only).
Product created successfully.
Bad request (e.g., invalid input).
Unauthorized.
Forbidden.
POST /api/v1/products HTTP/1.1
Host: localhost:3000
Content-Type: multipart/form-data
Accept: */*
Content-Length: 157
{
"name": "text",
"description": "text",
"price": 1,
"discountedPrice": 1,
"stock": 1,
"categoryId": "text",
"brand": "text",
"isFeatured": true,
"product_images": [
"binary"
]
}
{
"_id": "text",
"name": "text",
"description": "text",
"slug": "text",
"price": 1,
"discountedPrice": 1,
"stock": 1,
"category": "text",
"brand": "text",
"images": [
{
"publicId": "text",
"url": "text",
"width": 1,
"height": 1
}
],
"ratings": {
"average": 1,
"count": 1
},
"isFeatured": true,
"retailer": "text",
"likesCount": 1,
"commentsCount": 1,
"createdAt": "2025-10-21T06:01:19.680Z",
"updatedAt": "2025-10-21T06:01:19.680Z"
}
Retrieves a product by its slug.
The slug of the product to retrieve.
The product's information.
Unauthorized.
Not found.
GET /api/v1/products/{slug} HTTP/1.1
Host: localhost:3000
Accept: */*
{
"_id": "text",
"name": "text",
"description": "text",
"slug": "text",
"price": 1,
"discountedPrice": 1,
"stock": 1,
"category": "text",
"brand": "text",
"images": [
{
"publicId": "text",
"url": "text",
"width": 1,
"height": 1
}
],
"ratings": {
"average": 1,
"count": 1
},
"isFeatured": true,
"retailer": "text",
"likesCount": 1,
"commentsCount": 1,
"createdAt": "2025-10-21T06:01:19.680Z",
"updatedAt": "2025-10-21T06:01:19.680Z"
}
Updates a product by its ID (retailer only).
The ID of the product to update.
Product updated successfully.
Bad request (e.g., invalid input).
Unauthorized.
Forbidden.
Not found.
PUT /api/v1/products/{productId} HTTP/1.1
Host: localhost:3000
Content-Type: multipart/form-data
Accept: */*
Content-Length: 157
{
"name": "text",
"description": "text",
"price": 1,
"discountedPrice": 1,
"stock": 1,
"categoryId": "text",
"brand": "text",
"isFeatured": true,
"product_images": [
"binary"
]
}
{
"_id": "text",
"name": "text",
"description": "text",
"slug": "text",
"price": 1,
"discountedPrice": 1,
"stock": 1,
"category": "text",
"brand": "text",
"images": [
{
"publicId": "text",
"url": "text",
"width": 1,
"height": 1
}
],
"ratings": {
"average": 1,
"count": 1
},
"isFeatured": true,
"retailer": "text",
"likesCount": 1,
"commentsCount": 1,
"createdAt": "2025-10-21T06:01:19.680Z",
"updatedAt": "2025-10-21T06:01:19.680Z"
}
Deletes a product by its ID (retailer or admin only).
The ID of the product to delete.
Product deleted successfully.
No content
Unauthorized.
Forbidden.
Not found.
DELETE /api/v1/products/{productId} HTTP/1.1
Host: localhost:3000
Accept: */*
No content
Retrieves a list of products for a specific retailer.
The ID of the retailer.
The number of products to return.
10
The number of products to skip.
0
A list of products.
Unauthorized.
Not found.
GET /api/v1/products/retailer/{retailerId} HTTP/1.1
Host: localhost:3000
Accept: */*
{
"limit": 1,
"offset": 1,
"total": 1,
"products": [
{
"_id": "text",
"name": "text",
"description": "text",
"slug": "text",
"price": 1,
"discountedPrice": 1,
"stock": 1,
"category": "text",
"brand": "text",
"images": [
{
"publicId": "text",
"url": "text",
"width": 1,
"height": 1
}
],
"ratings": {
"average": 1,
"count": 1
},
"isFeatured": true,
"retailer": "text",
"likesCount": 1,
"commentsCount": 1,
"createdAt": "2025-10-21T06:01:19.680Z",
"updatedAt": "2025-10-21T06:01:19.680Z"
}
]
}