Skip to content

Best Seller Product Serializer Documentation


Description

This API serializer is used for retrieving the best-selling products with details like rank, sales, product images, color variants, ratings, and wishlist status. It also provides additional details such as parent category and shop information.


Request

Headers:

  • Content-Type: application/json
  • Authorization: Not required (publicly accessible).

Body Parameters:

None (This is typically used in GET requests to fetch the data).


Response

On Success:

Status Code: 200 OK

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
        },

On Failure:

Status Code: 400 BAD REQUEST

Body (Example):

{
    "detail": "Bad Request"
}


Error Responses:

Status Code Reason Example Body
400 Validation Error {"detail": "Bad Request"}
404 Not Found {"detail": "Not found"}
500 Server Error {"error": "An unexpected error occurred."}

Permissions:

This endpoint does not require authentication, but it is recommended for users to be logged in to receive personalized wishlist data.


Functionality:

  • Retrieves the best-selling product details including rank, sales, and product images.
  • Provides information about the product’s variants, including color, size, stock, and pricing.
  • Includes product ratings and a summary of customer reviews.
  • Returns real-time information about whether the product is wishlisted by the authenticated user.
  • Includes detailed information about the shop, including its average rating and follower count.
  • Returns discounted prices based on the discount percentage.
  • Allows the inclusion of products within a collection (if applicable).

Fields:

Field Description
id Product identifier.
name Name of the product.
slug Slug for the product URL.
vendor Vendor name.
shop Shop ID that sells the product.
price Original price of the product.
discount_percent Discount percentage on the product.
discounted_price Final price after discount.
description Product description.
is_featured Indicates if the product is featured.
is_active Indicates if the product is active.
images Product images.
color_variants Available color variants for the product.
parent_category Parent category information.
average_rating Average rating of the product.
total_reviews Total number of reviews for the product.
rating_summary Summary of ratings (count of 1-5 stars).
wishlisted List of users who have wishlisted the product.
collection Collection to which the product belongs (if any).
collection_id ID of the collection the product is associated with.
rank Rank of the product based on sales.
sales Total number of sales for the product.
shop_details Information about the shop selling the product, including follower count and average rating.