Signature Collection APIs
This section provides the API endpoints related to collections and products. It includes endpoints for listing collections, retrieving products by collection, and filtering products based on various criteria.
1. List Collections
Endpoint
- URL:
/api/v1/catalog/product/collections/ - Method:
GET - Permission Required:
AllowAny
Description
Retrieve all active collections. The response includes details like the collection's name, description, and other relevant data.
Response Examples
Success
{
"pageSize": 10,
"count": 3,
"active_page": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"name": "Elegance Woven in Threads",
"slug": "elegance-woven-in-threads",
"image": "https://api.kurtasari.com/media/signature/collection/Elegance_in_woven.png",
"description": "Timeless sarees crafted with grace and tradition, elevating your style for every occasion.",
"cta_url": "/api/v1/catalog/products/collection/elegance-woven-in-threads/",
"is_active": true,
"product_count": 2
},
{
"id": 2,
"name": "Royal Weaves",
"slug": "royal-weaves",
"image": "https://api.kurtasari.com/media/signature/collection/Royal_weaves.png",
"description": "A curated collection of regal sarees/Kurtis blending heritage and luxury, designed to make a statement.",
"cta_url": "/api/v1/catalog/products/collection/royal-weaves/",
"is_active": true,
"product_count": 3
},
{
"id": 3,
"name": "The Silk Saga",
"slug": "the-silk-saga",
"image": "https://api.kurtasari.com/media/signature/collection/The_Silk_Saga.png",
"description": "Exquisite silk sarees that narrate tales of craftsmanship, perfect for the modern woman with a traditional touch",
"cta_url": "/api/v1/catalog/products/collection/the-silk-saga/",
"is_active": true,
"product_count": 2
}
]
}
2. Get Products by Collection ID
Endpoint
- URL:
/api/v1/catalog/product/by_collection/ - Method:
GET - Permission Required:
AllowAny
Description
Retrieve all products in a specific collection. Supports filtering, sorting, and searching by various product attributes like size, color, brand, price, and rating.
Query Parameter
collection_id(Required): The ID of the collection.
Request Payload
This API does not require request payload.
Example Query(sorting and filtering)
GET /api/v1/products/by_collection/?collection_id=1&color=red,blue&brand=BrandX&min_price=50&max_price=200&ordering=-price&page=1&page_size=10
Response Examples
Success
{
"pageSize": 10,
"count": 5,
"active_page": 1,
"next": null,
"previous": null,
"results": [
{
"id": 5,
"name": "Product 2",
"slug": "product-2",
"vendor": 3,
"shop": null,
"price": "2287.00",
"discount_percent": "14.00",
"description": "Description for product 2",
"is_featured": false,
"is_active": true,
"images": [],
"video": null,
"color_variants": [
{
"color": "Blue",
"value": "Variant 2 Blue",
"min_price": 2287.0,
"max_price": 2287.0,
"sizes": [
{
"id": 5,
"size": {
"id": 1,
"size": "Medium",
"value": "M"
},
"variant_price": 2287.0,
"stock_quantity": 8,
"is_available": true,
"is_active": true
}
],
"total_stock": 8,
"is_available": true,
"variant_images": []
},
{
"color": "Green",
"value": "Variant 2 Green",
"min_price": 2287.0,
"max_price": 2287.0,
"sizes": [
{
"id": 6,
"size": {
"id": 2,
"size": "Small",
"value": "S"
},
"variant_price": 2287.0,
"stock_quantity": 45,
"is_available": true,
"is_active": true
}
],
"total_stock": 45,
"is_available": true,
"variant_images": []
},
{
"color": "Red",
"value": "Variant 2 Red",
"min_price": 2287.0,
"max_price": 2287.0,
"sizes": [
{
"id": 4,
"size": {
"id": 2,
"size": "Small",
"value": "S"
},
"variant_price": 2287.0,
"stock_quantity": 35,
"is_available": true,
"is_active": true
}
],
"total_stock": 35,
"is_available": true,
"variant_images": []
}
],
"parent_category": {
"id": 55,
"name": "Sarees",
"slug": "sarees",
"description": "This is the Sarees category",
"banner_image": null,
"thumbnail_image": null,
"all_children": [
{
"id": 56,
"name": "Cotton Sarees",
"slug": "cotton-sarees",
"description": "This is the Cotton Sarees subcategory of Sarees",
"banner_image": null,
"thumbnail_image": null,
"created_at": "11-13-2024 06:45:58",
"updated_at": "11-13-2024 06:45:58"
},
{
"id": 58,
"name": "Georgette Sarees",
"slug": "georgette-sarees",
"description": "This is the Georgette Sarees subcategory of Sarees",
"banner_image": null,
"thumbnail_image": null,
"created_at": "11-13-2024 06:45:58",
"updated_at": "11-13-2024 06:45:58"
},
{
"id": 57,
"name": "Silk Sarees",
"slug": "silk-sarees",
"description": "This is the Silk Sarees subcategory of Sarees",
"banner_image": null,
"thumbnail_image": null,
"created_at": "11-13-2024 06:45:58",
"updated_at": "11-13-2024 06:45:58"
}
],
"specific_child": {
"id": 58,
"name": "Georgette Sarees",
"slug": "georgette-sarees",
"description": "This is the Georgette Sarees subcategory of Sarees",
"banner_image": null,
"thumbnail_image": null,
"created_at": "11-13-2024 06:45:58",
"updated_at": "11-13-2024 06:45:58"
},
"created_at": "11-13-2024 06:45:58",
"updated_at": "11-13-2024 06:45:58"
},
"average_rating": 2.6,
"total_reviews": 5,
"rating_summary": {
"1": 2,
"2": 0,
"3": 1,
"4": 2,
"5": 0
},
"brand": "Brand A",
"color": "Red",
"size": "M",
"fabric": "Cotton",
"popularity": 95,
"wishlisted": null,
"collection": {
"id": 1,
"name": "Dashain",
"slug": "dashain",
"image": "http://127.0.0.1:8000/media/signature/collection/gg.png",
"description": "dfgdfgdfg",
"cta_url": "/api/v1/catalog/products/collection/dashain/",
"is_active": true,
"product_count": 5
},
"created_at": "11-13-2024 06:45:58",
"updated_at": "11-19-2024 05:41:39",
"shop_details": null,
"discounted_price": 1966.82,
"is_product_wishlisted": false
},