Product
Get all product
You can access the list of more then 200 products by using the /products endpoint
Request:
 [Get] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/products
Response:
{
  "status": "success",
  "count": 50,
  "Data": [
    {
      "_id": "64c9dab8e1ffe09097e0b844",
      "name": "Angelfish Silk Potali Potli",
      "category": [
        "bags, wallets & belts",
        "bags",
        "pouches and potlis",
        "angelfish pouches and potlis",
        "angelfish silk potali potli (multicolor)"
      ],
      "price": 999,
      "discounted_price": 399,
      "images": [
        "http://img6a.flixcart.com/image/pouch-potli/u/x/v/aelkabj01224-a-angelfish-potli-silk-potali-original-imaeeprygdj223es.jpeg",
        "http://img5a.flixcart.com/image/pouch-potli/u/x/v/aelkabj01224-a-angelfish-potli-silk-potali-original-imaeepryxh8xez64.jpeg",
        "http://img6a.flixcart.com/image/pouch-potli/u/x/v/aelkabj01224-a-angelfish-potli-silk-potali-original-imaeeprypmwscfp9.jpeg"
      ],
      "description": "Angelfish Silk Potali Potli (Multicolor) Price: Rs. 399 Made by silk Fabric with fancy lace adnored and stylish handle also.(set of 2 piece),Specifications of Angelfish Silk Potali Potli (Multicolor) General Closure Velcro Type Potli Material Fabric Style Code AELKABJ01224-A Ideal For Girls Bag Size Small Occasion Party Color Code Multicolor Dimensions Weight 200 g Body Features Number of Compartments 1",
      "product_rating": 4.5,
      "brand": "Angelfish",
      "product_specifications": [
        {
          "key": "Closure",
          "value": "Velcro"
        },
        {
          "key": "Type",
          "value": "Potli"
        },
        {
          "key": "Material",
          "value": "Fabric"
        },
        {
          "key": "Style Code",
          "value": "AELKABJ01224-A"
        },
        {
          "key": "Ideal For",
          "value": "Girls"
        },
        {
          "key": "Bag Size",
          "value": "Small"
        },
        {
          "key": "Occasion",
          "value": "Party"
        },
        {
          "key": "Color Code",
          "value": "Multicolor"
        },
        {
          "key": "Weight",
          "value": "200 g"
        },
        {
          "key": "Number of Compartments",
          "value": "1"
        }
      ]
    },
    {
      "_id": "64c9dab8e1ffe09097e0b854",
      "name": "Vishudh Printed Women's Anarkali Kurta",
      "category": [
        "vishudh printed women's anarkali kurta"
      ],
      "price": 2099,
      "discounted_price": 1049,
      "images": [
        "http://img5a.flixcart.com/image/kurta/f/c/4/vnku004389-beige-pink-vishudh-xl-original-imaehdjtwsnkgzvy.jpeg",
        "http://img6a.flixcart.com/image/kurta/f/c/4/vnku004389-beige-pink-vishudh-xl-original-imaehdjtwsnkgzvy.jpeg",
        "http://img6a.flixcart.com/image/kurta/r/s/c/vnku004389-beige-pink-vishudh-m-original-imaehdjtsg2ukrpe.jpeg",
        "http://img5a.flixcart.com/image/kurta/h/a/b/vnku004389-beige-pink-vishudh-s-original-imaehdjtpyzb4ze7.jpeg",
        "http://img5a.flixcart.com/image/kurta/4/s/4/vnku004389-beige-pink-vishudh-s-original-imaehdjtzxjghfxt.jpeg",
        "http://img6a.flixcart.com/image/kurta/h/y/a/vnku004389-beige-pink-vishudh-l-original-imaehdjttyfjwezt.jpeg"
      ],
      "description": "Specifications of Vishudh Printed Women's Anarkali Kurta Kurta Details Sleeve Half Sleeve Number of Contents in Sales Package Pack of 1 Fabric 100% Cotton Type Anarkali Neck ROUND NECK General Details Pattern Printed Occasion Festive Ideal For Women's In the Box Kurta Additional Details Style Code VNKU004389 BEIGE::PINK Fabric Care Gentle Machine Wash in Lukewarm Water, Do Not Bleach",
      "product_rating": 4.5,
      "brand": "Vishudh",
      "product_specifications": [
        {
          "key": "Sleeve",
          "value": "Half Sleeve"
        },
        {
          "key": "Number of Contents in Sales Package",
          "value": "Pack of 1"
        },
        {
          "key": "Fabric",
          "value": "100% Cotton"
        },
        {
          "key": "Type",
          "value": "Anarkali"
        },
        {
          "key": "Neck",
          "value": "ROUND NECK"
        },
        {
          "key": "Pattern",
          "value": "Printed"
        },
        {
          "key": "Occasion",
          "value": "Festive"
        },
        {
          "key": "Ideal For",
          "value": "Women's"
        },
        {
          "value": "Kurta"
        },
        {
          "key": "Style Code",
          "value": "VNKU004389 BEIGE::PINK"
        },
        {
          "value": "Gentle Machine Wash in Lukewarm Water, Do Not Bleach"
        }
      ]
    }
  ]
}
Get one product
You can get a single product by adding the id as a parameter: /products/:id
Request:
 [Get] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/products/64c9dab8e1ffe09097e0b844
Response:
{
  "status": "success",
  "data": {
    "_id": "64c9dab8e1ffe09097e0b844",
    "name": "Angelfish Silk Potali Potli",
    "category": [
      "bags, wallets & belts",
      "bags",
      "pouches and potlis",
      "angelfish pouches and potlis",
      "angelfish silk potali potli (multicolor)"
    ],
    "price": 999,
    "discounted_price": 399,
    "images": [
      "http://img6a.flixcart.com/image/pouch-potli/u/x/v/aelkabj01224-a-angelfish-potli-silk-potali-original-imaeeprygdj223es.jpeg",
      "http://img5a.flixcart.com/image/pouch-potli/u/x/v/aelkabj01224-a-angelfish-potli-silk-potali-original-imaeepryxh8xez64.jpeg",
      "http://img6a.flixcart.com/image/pouch-potli/u/x/v/aelkabj01224-a-angelfish-potli-silk-potali-original-imaeeprypmwscfp9.jpeg"
    ],
    "description": "Angelfish Silk Potali Potli (Multicolor) Price: Rs. 399 Made by silk Fabric with fancy lace adnored and stylish handle also.(set of 2 piece),Specifications of Angelfish Silk Potali Potli (Multicolor) General Closure Velcro Type Potli Material Fabric Style Code AELKABJ01224-A Ideal For Girls Bag Size Small Occasion Party Color Code Multicolor Dimensions Weight 200 g Body Features Number of Compartments 1",
    "product_rating": 4.5,
    "brand": "Angelfish",
    "product_specifications": [
      {
        "key": "Closure",
        "value": "Velcro"
      },
      {
        "key": "Type",
        "value": "Potli"
      },
      {
        "key": "Material",
        "value": "Fabric"
      },
      {
        "key": "Style Code",
        "value": "AELKABJ01224-A"
      },
      {
        "key": "Ideal For",
        "value": "Girls"
      },
      {
        "key": "Bag Size",
        "value": "Small"
      },
      {
        "key": "Occasion",
        "value": "Party"
      },
      {
        "key": "Color Code",
        "value": "Multicolor"
      },
      {
        "key": "Weight",
        "value": "200 g"
      },
      {
        "key": "Number of Compartments",
        "value": "1"
      }
    ],
    "__v": 0
  }
}
Add product
You can create a new product by sending an object like the following to /products. And sen data as JSON in body
Request:
 [Post] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/products
Body:
{
  "name": "Test",
  "category": [
    "clothing"
  ],
  "retail_price": 999,
  "discounted_price": 379,
  "images": [
    "http://img5a.flixcart.com/image/short/u/4/a/altht-3p-21-alisha-38-original-imaeh2d5vm5zbtgg.jpeg"
  ],
  "description": "Key Features of Alisha Solid Women's Cycling Shorts Cotton Lycra Navy, Red, Navy,Specifications of Alisha Solid Women's Cycling Shorts Shorts ",
  "product_rating": 4.5,
  "brand": "Alisha",
  "product_specifications": [
    {
      "key": "Number of Contents in Sales Package",
      "value": "Pack of 3"
    }
  ]
}
Response:
{
  "status": "success",
  "data": {
    "name": "Test",
    "category": [
      "clothing"
    ],
    "price": 1000,
    "discounted_price": 379,
    "images": [
      "http://img5a.flixcart.com/image/short/u/4/a/altht-3p-21-alisha-38-original-imaeh2d5vm5zbtgg.jpeg"
    ],
    "description": "Key Features of Alisha Solid Women's Cycling Shorts Cotton Lycra Navy, Red, Navy,Specifications of Alisha Solid Women's Cycling Shorts Shorts",
    "product_rating": 4.5,
    "brand": "Alisha",
    "product_specifications": [
      {
        "key": "Number of Contents in Sales Package",
        "value": "Pack of 3"
      }
    ],
    "createdAt": "2023-08-07T21:17:57.884Z",
    "_id": "64d160a9ca0630131a60e7d7",
    "__v": 0
  }
}
Update product
You can update a product by sending an object like the following and adding the id as a parameter: /products/:id
Request:
 [Patch] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/products/64d160a9ca0630131a60e7d7
Body:
"{\n    \"name\":\"Test Updated\"\n}"
Response:
{
  "status": "success",
  "data": {
    "_id": "64d160a9ca0630131a60e7d7",
    "name": "Test Updated",
    "category": [
      "clothing"
    ],
    "price": 1000,
    "discounted_price": 379,
    "images": [
      "http://img5a.flixcart.com/image/short/u/4/a/altht-3p-21-alisha-38-original-imaeh2d5vm5zbtgg.jpeg"
    ],
    "description": "Key Features of Alisha Solid Women's Cycling Shorts Cotton Lycra Navy, Red, Navy,Specifications of Alisha Solid Women's Cycling Shorts Shorts",
    "product_rating": 4.5,
    "brand": "Alisha",
    "product_specifications": [
      {
        "key": "Number of Contents in Sales Package",
        "value": "Pack of 3"
      }
    ],
    "__v": 0
  }
}
Delete product
You can delete a product by sending an object like the following and adding the id as a parameter: /products/:id
Request:
 [Delete] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/products/64d160a9ca0630131a60e7d7
Response:
{
  "status": "success",
  "deleted": {
    "_id": "64d160a9ca0630131a60e7d7",
    "name": "Test Updated",
    "category": [
      "clothing"
    ],
    "price": 1000,
    "discounted_price": 379,
    "images": [
      "http://img5a.flixcart.com/image/short/u/4/a/altht-3p-21-alisha-38-original-imaeh2d5vm5zbtgg.jpeg"
    ],
    "description": "Key Features of Alisha Solid Women's Cycling Shorts Cotton Lycra Navy, Red, Navy,Specifications of Alisha Solid Women's Cycling Shorts Shorts",
    "product_rating": 4.5,
    "brand": "Alisha",
    "product_specifications": [
      {
        "key": "Number of Contents in Sales Package",
        "value": "Pack of 3"
      }
    ],
    "__v": 0
  }
}
Product Filters
Filter By Category
By using the /products endpoint and passing category as a query parameter, you can filter for products by category
Request:
 [Get] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/products?category=computers
Filter By Price
By using the /products endpoint and passing price as a query parameter, you can filter for products by price. You can also add price[ gt]=995for price greater then, or you can use "gte", "lt", "lte" for greater then equal, les then, les then and equal respectively
Request:
 [Get] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/products?price=995
Get Selected Fields
By using the /products endpoint and passing fields as a query parameter, you can filter for products by fields. You can add multiple field , by adding field separated by ,
Request:
 [Get] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/products?fields=name,price
Response:
{
  "status": "success",
  "count": 3,
  "Data": [
    {
      "_id": "64c9dab8e1ffe09097e0b844",
      "name": "Angelfish Silk Potali Potli",
      "price": 999
    },
    {
      "_id": "64c9dab8e1ffe09097e0b854",
      "name": "Vishudh Printed Women's Anarkali Kurta",
      "price": 2099
    },
    {
      "_id": "64c9dab8e1ffe09097e0b824",
      "name": "dongli Printed Boy's Round Neck T-Shirt",
      "price": 2400
    }
  ]
}
Sort product
By using the /products endpoint and passing sort as a query parameter, you can sort for products by field you specified, such as by price, etc. + or - before fields for ascending and descending respectively.
Request:
 [Get] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/products?sort=price