Skip to content

Best Seller API

Best Seller API Documentation

Actions

1. List Best Selling Products

Endpoint: api/v1/products/best-seller/
Method: GET
Permissions: AllowAny


Description

This API endpoint provides a list of best-selling products based on various time periods (weekly, monthly, overall). It also allows filtering by product category and returns additional product details, including the user’s wishlist status.


Request

Headers:

  • Content-Type: application/json
  • Authorization: Optional. If the user is authenticated, their wishlist is considered.

Query Parameters:

Field Type Required Description
period string No Time period for sales ranking: week, month, all (default).
category string No The category or parent category slug for filtering.
Example Request:
  • All Time best seller
    GET api/v1/best_seller/list/
    

  • Weekly best seller
    GET api/v1/best_seller/list/?period=week
    

  • Monthly best seller
    GET api/v1/best_seller/list/?period=month
    

  • Trending best seller 3 days
    GET api/v1/best_seller/list/?period=trending
    

Response

On Success:

Body:

{
    "pageSize": 20,
    "count": 3,
    "page_count": 1,
    "active_page": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 4,
            "name": "Mens Pajama Kurta In Dark Blue",
            "slug": "mens-pajama-kurta-in-black",
            "vendor": 4,
            "shop": 2,
            "price": "5000.00",
            "discount_percent": "20.00",
            "description": "Blue color Kurta Pyjamas in Cotton fabric with Embroidered work\r\nSKU:\r\n1817743\r\nFabric:\r\nCotton\r\nWork:\r\nEmbroidered\r\nColor Family:\r\nBlack and Grey\r\nWashing Instruction:\r\nDry Wash",
            "is_featured": false,
            "is_active": true,
            "images": [
                {
                    "id": 44,
                    "image": "https://api.kurtasari.com/media/product/image/blue3_1_copy.png",
                    "variant": 4,
                    "is_primary": false,
                    "created_at": "11-26-2024 10:57:03"
                },
                {
                    "id": 54,
                    "image": "https://api.kurtasari.com/media/product/image/blue1_1_copy_6gMDdSZ.png",
                    "variant": 4,
                    "is_primary": false,
                    "created_at": "11-27-2024 07:49:25"
                }
            ],
            "video": "https://api.kurtasari.com/media/product/video/blue2_1Video.mp4",
            "color_variants": [
                {
                    "color": "Dark BLue",
                    "value": "#000080",
                    "min_price": "200.00",
                    "max_price": "200.00",
                    "sizes": [
                        {
                            "id": 4,
                            "size": {
                                "id": 1,
                                "size": "Medium",
                                "value": "M"
                            },
                            "variant_price": "200.00",
                            "stock_quantity": 15,
                            "is_available": true,
                            "is_active": true
                        }
                    ],
                    "total_stock": 15,
                    "is_available": true,
                    "variant_images": [
                        {
                            "id": 44,
                            "image": "https://api.kurtasari.com/media/product/image/blue3_1_copy.png",
                            "is_primary": false,
                            "variant_id": 4,
                            "created_at": "2024-11-26T10:57:03.109210Z"
                        },
                        {
                            "id": 54,
                            "image": "https://api.kurtasari.com/media/product/image/blue1_1_copy_6gMDdSZ.png",
                            "is_primary": false,
                            "variant_id": 4,
                            "created_at": "2024-11-27T07:49:25.780379Z"
                        }
                    ],
                    "primary_image": null
                }
            ],
            "parent_category": {
                "id": 1,
                "name": "Kurta",
                "slug": "kurta",
                "description": "The main Category of Kurta",
                "banner_image": null,
                "thumbnail_image": null,
                "all_children": [
                    {
                        "id": 4,
                        "name": "Anarkali",
                        "slug": "anarkali",
                        "description": "An Anarkali Kurti is an ethnic wear popular since the Mughal Era in India. It is the most demanding Kurti of all time. It is a Kurta with a long, flowy bottom that flares out from the waist, giving an elegant and beautiful look.",
                        "banner_image": "/media/category/banner_image/anarkali-type_ZnD0Fvc.jpg",
                        "thumbnail_image": null,
                        "created_at": "11-13-2024 05:53:42",
                        "updated_at": "11-13-2024 05:53:42"
                    },
                    {
                        "id": 3,
                        "name": "Chikankari",
                        "slug": "chikankari",
                        "description": "Chikankari is known for its intricate motifs inspired by nature, including flowers, leaves, vines, and birds. These motifs are meticulously embroidered on the fabric, often forming delicate patterns and symmetrical designs.",
                        "banner_image": "/media/category/banner_image/Type-Chikankari_d74mhS3.jpg",
                        "thumbnail_image": null,
                        "created_at": "11-13-2024 05:53:00",
                        "updated_at": "11-13-2024 05:53:00"
                    },
                    {
                        "id": 6,
                        "name": "Cotton Kurti",
                        "slug": "cotton-kurti",
                        "description": "Cotton kurti is a traditional Nepali garment that is widely popular for its comfort and versatility.",
                        "banner_image": "/media/category/banner_image/Cotton-kurti-_type_cl8xs4D.jpg",
                        "thumbnail_image": null,
                        "created_at": "11-13-2024 05:55:18",
                        "updated_at": "11-13-2024 05:55:33"
                    },
                    {
                        "id": 5,
                        "name": "Pajama",
                        "slug": "pajama",
                        "description": "The kurta pajama is traditional Indian attire, often worn for weddings and festivals. The kurta is a loose-fitting tunic, usually with long sleeves and a buttoned placket. A kurta is usually knee length, the shorter style being known as a 'kurti'. Pajamas refer to the bottoms or trousers.",
                        "banner_image": "/media/category/banner_image/pajama-type_YfbMGFg.jpg",
                        "thumbnail_image": null,
                        "created_at": "11-13-2024 05:54:28",
                        "updated_at": "11-13-2024 05:54:28"
                    }
                ],
                "specific_child": {
                    "id": 5,
                    "name": "Pajama",
                    "slug": "pajama",
                    "description": "The kurta pajama is traditional Indian attire, often worn for weddings and festivals. The kurta is a loose-fitting tunic, usually with long sleeves and a buttoned placket. A kurta is usually knee length, the shorter style being known as a 'kurti'. Pajamas refer to the bottoms or trousers.",
                    "banner_image": "/media/category/banner_image/pajama-type_YfbMGFg.jpg",
                    "thumbnail_image": null,
                    "created_at": "11-13-2024 05:54:28",
                    "updated_at": "11-13-2024 05:54:28"
                },
                "created_at": "11-13-2024 05:51:45",
                "updated_at": "12-11-2024 05:30:55"
            },
            "average_rating": 0.0,
            "total_reviews": 0,
            "rating_summary": {
                "1": 0,
                "2": 0,
                "3": 0,
                "4": 0,
                "5": 0
            },
            "brand": "No Brand",
            "color": null,
            "size": null,
            "fabric": "No Fabric",
            "popularity": 0,
            "wishlisted": [],
            "collection": {
                "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
            },
            "created_at": "11-13-2024 06:41:25",
            "updated_at": "11-27-2024 10:14:46",
            "is_product_wishlisted": false,
            "shop_details": {
                "id": 2,
                "name": "JPT Shop",
                "description": "THis is new shop at koteshwor running by JPT group",
                "location": "Koteshwor, Kathmandu",
                "image": "/media/shop/images/JPT_photo.jpg",
                "cover_image": "/media/shop/images/jpt_banner.jpg",
                "follower_count": 1,
                "average_rating": 0
            },
            "rank": 1,
            "sales": 5,
            "discounted_price": 4000.0
        },
        {
            "id": 1,
            "name": "Floral Embroidered Chikankari Kurta",
            "slug": "floral-embroidered-chikankari-kurta",
            "vendor": 2,
            "shop": 1,
            "price": "3197.00",
            "discount_percent": "10.00",
            "description": "Floral embroidered, Notch neck Three-quarter, regular sleeves\r\nStraight shape with regular style.\r\n\r\nCalf length with straight hem\r\nMachine weave regular viscose rayon",
            "is_featured": false,
            "is_active": true,
            "images": [
                {
                    "id": 1,
                    "image": "https://api.kurtasari.com/media/product/image/Puple1_nXMWPDz.jpg",
                    "variant": null,
                    "is_primary": false,
                    "created_at": "11-13-2024 06:03:02"
                },
                {
                    "id": 2,
                    "image": "https://api.kurtasari.com/media/product/image/purple2_jiGXDrh.jpg",
                    "variant": null,
                    "is_primary": false,
                    "created_at": "11-13-2024 06:03:02"
                },
                {
                    "id": 3,
                    "image": "https://api.kurtasari.com/media/product/image/purple3_DCxCaTq.jpg",
                    "variant": null,
                    "is_primary": false,
                    "created_at": "11-13-2024 06:03:02"
                },
                {
                    "id": 4,
                    "image": "https://api.kurtasari.com/media/product/image/purple5_tW4Ou7P.jpg",
                    "variant": null,
                    "is_primary": false,
                    "created_at": "11-13-2024 06:03:02"
                },
                {
                    "id": 5,
                    "image": "https://api.kurtasari.com/media/product/image/purple4_AZzY98y.jpg",
                    "variant": null,
                    "is_primary": false,
                    "created_at": "11-13-2024 06:03:02"
                }
            ],
            "video": null,
            "color_variants": [
                {
                    "color": "Pink",
                    "value": "#FFC0CB",
                    "min_price": "400.00",
                    "max_price": "400.00",
                    "sizes": [
                        {
                            "id": 1,
                            "size": {
                                "id": 1,
                                "size": "Medium",
                                "value": "M"
                            },
                            "variant_price": "400.00",
                            "stock_quantity": 100,
                            "is_available": true,
                            "is_active": true
                        }
                    ],
                    "total_stock": 100,
                    "is_available": true,
                    "variant_images": [],
                    "primary_image": null
                }
            ],
            "parent_category": {
                "id": 1,
                "name": "Kurta",
                "slug": "kurta",
                "description": "The main Category of Kurta",
                "banner_image": null,
                "thumbnail_image": null,
                "all_children": [
                    {
                        "id": 4,
                        "name": "Anarkali",
                        "slug": "anarkali",
                        "description": "An Anarkali Kurti is an ethnic wear popular since the Mughal Era in India. It is the most demanding Kurti of all time. It is a Kurta with a long, flowy bottom that flares out from the waist, giving an elegant and beautiful look.",
                        "banner_image": "/media/category/banner_image/anarkali-type_ZnD0Fvc.jpg",
                        "thumbnail_image": null,
                        "created_at": "11-13-2024 05:53:42",
                        "updated_at": "11-13-2024 05:53:42"
                    },
                    {
                        "id": 3,
                        "name": "Chikankari",
                        "slug": "chikankari",
                        "description": "Chikankari is known for its intricate motifs inspired by nature, including flowers, leaves, vines, and birds. These motifs are meticulously embroidered on the fabric, often forming delicate patterns and symmetrical designs.",
                        "banner_image": "/media/category/banner_image/Type-Chikankari_d74mhS3.jpg",
                        "thumbnail_image": null,
                        "created_at": "11-13-2024 05:53:00",
                        "updated_at": "11-13-2024 05:53:00"
                    },
                    {
                        "id": 6,
                        "name": "Cotton Kurti",
                        "slug": "cotton-kurti",
                        "description": "Cotton kurti is a traditional Nepali garment that is widely popular for its comfort and versatility.",
                        "banner_image": "/media/category/banner_image/Cotton-kurti-_type_cl8xs4D.jpg",
                        "thumbnail_image": null,
                        "created_at": "11-13-2024 05:55:18",
                        "updated_at": "11-13-2024 05:55:33"
                    },
                    {
                        "id": 5,
                        "name": "Pajama",
                        "slug": "pajama",
                        "description": "The kurta pajama is traditional Indian attire, often worn for weddings and festivals. The kurta is a loose-fitting tunic, usually with long sleeves and a buttoned placket. A kurta is usually knee length, the shorter style being known as a 'kurti'. Pajamas refer to the bottoms or trousers.",
                        "banner_image": "/media/category/banner_image/pajama-type_YfbMGFg.jpg",
                        "thumbnail_image": null,
                        "created_at": "11-13-2024 05:54:28",
                        "updated_at": "11-13-2024 05:54:28"
                    }
                ],
                "specific_child": {
                    "id": 6,
                    "name": "Cotton Kurti",
                    "slug": "cotton-kurti",
                    "description": "Cotton kurti is a traditional Nepali garment that is widely popular for its comfort and versatility.",
                    "banner_image": "/media/category/banner_image/Cotton-kurti-_type_cl8xs4D.jpg",
                    "thumbnail_image": null,
                    "created_at": "11-13-2024 05:55:18",
                    "updated_at": "11-13-2024 05:55:33"
                },
                "created_at": "11-13-2024 05:51:45",
                "updated_at": "12-11-2024 05:30:55"
            },
            "average_rating": 0.0,
            "total_reviews": 0,
            "rating_summary": {
                "1": 0,
                "2": 0,
                "3": 0,
                "4": 0,
                "5": 0
            },
            "brand": "No Brand",
            "color": null,
            "size": null,
            "fabric": "No Fabric",
            "popularity": 0,
            "wishlisted": [],
            "collection": {
                "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
            },
            "created_at": "11-13-2024 06:03:02",
            "updated_at": "12-09-2024 06:50:15",
            "is_product_wishlisted": false,
            "shop_details": {
                "id": 1,
                "name": "Le Lord",
                "description": "Dari Raja's Shop",
                "location": "Radhe Radhe, Bhaktapur",
                "image": "/media/shop/images/Le_Lord_-_photo.jpg",
                "cover_image": "/media/shop/images/LeLord_cover.jpg",
                "follower_count": 1,
                "average_rating": 0
            },
            "rank": 1,
            "sales": 55,
            "discounted_price": 2877.3
        },

On Failure:

Status Code: 400 BAD REQUEST

Body (Example):

{
    "detail": "Invalid parameters."
}


Error Responses

Status Code Reason Example Body
400 Bad Request {"detail": "Invalid parameters."}
500 Server Error {"error": "An unexpected error occurred."}