Get All Products

Endpoint: GET /api/v1/store/products

Description: Retrieve a paginated list of all products available in the store.

Headers:

  • No special headers required (Public endpoint)

Query Parameters:

  • page (optional): Page number for pagination (default: 0, min: 0)

  • limit (optional): Number of products per page (default: 20, min: 1, max: 100)

Success Response (200):

{
  "success": true,
  "message": "Products retrieved successfully",
  "data": {
    "products": [
      {
        "_id": "6854298f028e9678dd8f9bbe",
        "product_name": "Tall Narrow Bathroom Storage Cabinet With 3 Drawers And 2 Shelves, Free Standing Kitchen Pantry Organizer With Open Compartment, Water-Resistant Finish",
        "description": "Free Returns ✓ Free Shipping✓. Tall Narrow Bathroom Storage Cabinet With 3 Drawers And 2 Shelves, Free Standing Kitchen Pantry Organizer With Open Compartment, Water-Resistant Finish- Storage Cabinets at SHEIN.",
        "initial_price": 120.99,
        "final_price": 120.99,
        "currency": "USD",
        "in_stock": true,
        "color": "Grey",
        "size": "one-size",
        "main_image": "https://img.ltwebstatic.com/images3_spmp/2024/08/09/e4/17231883609d35f827fa9cc1016466bcd0d72748bd_square.png",
        "category_tree": [
          "Tools & Home Improvement",
          "Furniture",
          "Accent Furniture",
          "Storage Cabinets"
        ],
        "image_count": 8,
        "image_urls": [
          "https://img.ltwebstatic.com/images3_spmp/2024/08/09/e4/17231883609d35f827fa9cc1016466bcd0d72748bd_square.png",
          "https://img.ltwebstatic.com/images3_spmp/2024/08/09/e8/17231883595b2bf13a8cd40bd8eaf0d01bac0ea8ae_square.png",
          "https://img.ltwebstatic.com/images3_spmp/2024/08/09/e8/1723188359e751e010d76e843c58d20eafb63b698c_square.png",
          "https://img.ltwebstatic.com/images3_spmp/2024/08/09/e8/1723188359fe45d88555308442379166d74380c837_square.png",
          "https://img.ltwebstatic.com/images3_spmp/2024/08/09/24/172318835752c2b6acbfe9a1ae23633b443b146c87_square.png",
          "https://img.ltwebstatic.com/images3_spmp/2024/08/09/e8/17231883594a5a941da7aef8da9f5eff05e1bc16b9_square.png",
          "https://img.ltwebstatic.com/images3_spmp/2024/08/09/e8/1723188359baa5d09ddbd42fab7a418d750674a84b_square.png",
          "https://img.ltwebstatic.com/images3_spmp/2024/08/09/42/1723188363771c934b47f76b5e1c0d606e5d2ba22c_square.png"
        ],
        "other_attributes": [
          {
            "name": "Color",
            "value": "Grey"
          },
          {
            "name": "Material",
            "value": "Wood"
          }
        ],
        "rating": 0,
        "root_category": "Tools & Home Improvement",
        "category": "Storage Cabinets",
        "all_available_sizes": [
          "one-size"
        ],
        "discount_amount": 0,
        "discount_percentage": 0
      }
    ],
    "pagination": {
      "currentPage": 0,
      "totalPages": 5,
      "totalProducts": 100,
      "hasNextPage": true,
      "hasPrevPage": false
    }
  }
}

Error Responses:

400 Bad Request:

{
  "success": false,
  "message": "Page number must be non-negative"
}
{
  "success": false,
  "message": "Limit must be between 1 and 100"
}
Updated on