{"info":{"_postman_id":"89c1d533-d859-4232-8959-ea705be107bb","name":"Assignment-2","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"50839333","collectionId":"89c1d533-d859-4232-8959-ea705be107bb","publishedId":"2sBXcGEzpp","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2026-02-25T17:20:26.000Z"},"item":[{"name":"Returns all products.","id":"6d9ec5e4-acc5-4427-bf71-aca92b6dbbc3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://node-assignmentt.onrender.com/products","description":"<h2 id=\"get-all-products\">Get All Products</h2>\n<p>Retrieves a list of all available products from the store inventory.</p>\n<p><strong>Method:</strong> <code>GET</code><br /><strong>URL:</strong> <code>https://node-assignmentt.onrender.com/products</code></p>\n<hr />\n<h3 id=\"request-parameters\">Request Parameters</h3>\n<p>No query parameters, path variables, or request body are required. Simply send the request as-is.</p>\n<hr />\n<h3 id=\"response\">Response</h3>\n<p><strong>Status Code:</strong> <code>200 OK</code></p>\n<p>Returns a JSON array of product objects. Each object contains the following fields:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>integer</td>\n<td>Unique identifier for the product</td>\n</tr>\n<tr>\n<td><code>name</code></td>\n<td>string</td>\n<td>Name of the product</td>\n</tr>\n<tr>\n<td><code>category</code></td>\n<td>string</td>\n<td>Category the product belongs to (e.g., Electronics, Footwear)</td>\n</tr>\n<tr>\n<td><code>price</code></td>\n<td>number</td>\n<td>Price of the product (in INR)</td>\n</tr>\n<tr>\n<td><code>stock</code></td>\n<td>integer</td>\n<td>Number of units currently available in stock</td>\n</tr>\n<tr>\n<td><code>rating</code></td>\n<td>number</td>\n<td>Average customer rating (out of 5)</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"example-response\">Example Response</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n  {\"id\": 1, \"name\": \"Wireless Mouse\", \"category\": \"Electronics\", \"price\": 799, \"stock\": 25, \"rating\": 4.3},\n  {\"id\": 2, \"name\": \"Running Shoes\", \"category\": \"Footwear\", \"price\": 2499, \"stock\": 40, \"rating\": 4.5},\n  {\"id\": 3, \"name\": \"Laptop Stand\", \"category\": \"Accessories\", \"price\": 999, \"stock\": 30, \"rating\": 4.2},\n  {\"id\": 4, \"name\": \"Smart Watch\", \"category\": \"Electronics\", \"price\": 4999, \"stock\": 12, \"rating\": 4.4},\n  {\"id\": 5, \"name\": \"Backpack\", \"category\": \"Fashion\", \"price\": 1599, \"stock\": 50, \"rating\": 4.1}\n]\n</code></pre>\n","urlObject":{"protocol":"https","path":["products"],"host":["node-assignmentt","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"6d9ec5e4-acc5-4427-bf71-aca92b6dbbc3"},{"name":"Returns product details by ID","id":"69eea09a-eced-4879-9b8d-44374641b5a3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://node-assignmentt.onrender.com/products/:id","description":"<h2 id=\"get-product-by-id\">Get Product by ID</h2>\n<p>Retrieves the details of a single product using its unique identifier. This endpoint returns product information including name, category, price, stock availability, and rating.</p>\n<hr />\n<h3 id=\"path-variable\">Path Variable</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Variable</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>integer</td>\n<td>✅ Yes</td>\n<td>The unique ID of the product to retrieve</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"example-request\">Example Request</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET https://node-assignmentt.onrender.com/products/2\n</code></pre><hr />\n<h3 id=\"example-response\">Example Response</h3>\n<p><strong>Status:</strong> <code>200 OK</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": 2,\n  \"name\": \"Running Shoes\",\n  \"category\": \"Footwear\",\n  \"price\": 2499,\n  \"stock\": 40,\n  \"rating\": 4.5\n}\n</code></pre>\n<hr />\n<h3 id=\"response-fields\">Response Fields</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>integer</td>\n<td>Unique identifier of the product</td>\n</tr>\n<tr>\n<td><code>name</code></td>\n<td>string</td>\n<td>Name of the product</td>\n</tr>\n<tr>\n<td><code>category</code></td>\n<td>string</td>\n<td>Category the product belongs to</td>\n</tr>\n<tr>\n<td><code>price</code></td>\n<td>number</td>\n<td>Price of the product (in currency units)</td>\n</tr>\n<tr>\n<td><code>stock</code></td>\n<td>integer</td>\n<td>Number of units currently available in stock</td>\n</tr>\n<tr>\n<td><code>rating</code></td>\n<td>number</td>\n<td>Average customer rating (out of 5)</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"notes\">Notes</h3>\n<ul>\n<li>Replace <code>:id</code> in the URL with the actual numeric product ID.</li>\n<li>Returns <code>404 Not Found</code> if no product exists with the given ID.</li>\n<li>No authentication or request body is required for this endpoint.</li>\n</ul>\n","urlObject":{"protocol":"https","path":["products",":id"],"host":["node-assignmentt","onrender","com"],"query":[],"variable":[{"type":"any","value":"2","key":"id"}]}},"response":[],"_postman_id":"69eea09a-eced-4879-9b8d-44374641b5a3"},{"name":"Get Products by Category","id":"d549c099-2b0b-4fa7-8dc7-931cd04e9cf8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://node-assignmentt.onrender.com/products/category/:categoryName","description":"<h2 id=\"get-products-by-category\">Get Products by Category</h2>\n<p>Retrieves all products belonging to a specific category. Returns an array of product objects that match the given category name.</p>\n<hr />\n<h3 id=\"endpoint\">Endpoint</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /products/category/:categoryName\n</code></pre><hr />\n<h3 id=\"path-variable\">Path Variable</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Variable</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>categoryName</code></td>\n<td>string</td>\n<td>✅ Yes</td>\n<td>The name of the category to filter products by. Example: <code>Electronics</code></td>\n</tr>\n</tbody>\n</table>\n</div><p>Replace <code>:categoryName</code> in the URL with the desired category name. For example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /products/category/Electronics\n</code></pre><hr />\n<h3 id=\"response-format\">Response Format</h3>\n<p>Returns a <strong>JSON array</strong> of product objects. Each object contains the following fields:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>number</td>\n<td>Unique identifier for the product</td>\n</tr>\n<tr>\n<td><code>name</code></td>\n<td>string</td>\n<td>Name of the product</td>\n</tr>\n<tr>\n<td><code>category</code></td>\n<td>string</td>\n<td>Category the product belongs to</td>\n</tr>\n<tr>\n<td><code>price</code></td>\n<td>number</td>\n<td>Price of the product (in currency units)</td>\n</tr>\n<tr>\n<td><code>stock</code></td>\n<td>number</td>\n<td>Number of units currently in stock</td>\n</tr>\n<tr>\n<td><code>rating</code></td>\n<td>number</td>\n<td>Average customer rating (out of 5)</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"example-response\">Example Response</h3>\n<p><strong>Request:</strong> <code>GET /products/category/Electronics</code></p>\n<p><strong>Status:</strong> <code>200 OK</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n  {\n    \"id\": 1,\n    \"name\": \"Wireless Mouse\",\n    \"category\": \"Electronics\",\n    \"price\": 799,\n    \"stock\": 25,\n    \"rating\": 4.3\n  },\n  {\n    \"id\": 2,\n    \"name\": \"Bluetooth Speaker\",\n    \"category\": \"Electronics\",\n    \"price\": 2999,\n    \"stock\": 20,\n    \"rating\": 4.6\n  },\n  {\n    \"id\": 4,\n    \"name\": \"Smart Watch\",\n    \"category\": \"Electronics\",\n    \"price\": 4999,\n    \"stock\": 12,\n    \"rating\": 4.4\n  },\n  {\n    \"id\": 6,\n    \"name\": \"Bluetooth Speaker\",\n    \"category\": \"Electronics\",\n    \"price\": 2999,\n    \"stock\": 20,\n    \"rating\": 4.6\n  }\n]\n</code></pre>\n","urlObject":{"protocol":"https","path":["products","category",":categoryName"],"host":["node-assignmentt","onrender","com"],"query":[],"variable":[{"type":"any","value":"Electronics","key":"categoryName"}]}},"response":[],"_postman_id":"d549c099-2b0b-4fa7-8dc7-931cd04e9cf8"},{"name":"Creates a new product.","id":"b70bf851-647e-4baf-8e7e-1e8258c3ce54","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://node-assignmentt.onrender.com/products","description":"<h2 id=\"create-product\">Create Product</h2>\n<p>Creates a new product entry in the system.</p>\n<hr />\n<h3 id=\"method--url\">Method &amp; URL</h3>\n<p><strong>POST</strong> <code>https://node-assignmentt.onrender.com/products</code></p>\n<hr />\n<h3 id=\"request-body\">Request Body</h3>\n<p>The request body must be sent as <strong>raw JSON</strong> with the following fields:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>name</code></td>\n<td><code>string</code></td>\n<td>The name of the product</td>\n</tr>\n<tr>\n<td><code>category</code></td>\n<td><code>string</code></td>\n<td>The category the product belongs to</td>\n</tr>\n<tr>\n<td><code>price</code></td>\n<td><code>number</code></td>\n<td>The price of the product (in currency units)</td>\n</tr>\n<tr>\n<td><code>stock</code></td>\n<td><code>number</code></td>\n<td>The available stock quantity for the product</td>\n</tr>\n<tr>\n<td><code>rating</code></td>\n<td><code>number</code></td>\n<td>The product rating (typically on a scale of 1–5)</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Example Request Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"name\": \"Bluetooth Speaker\",\n  \"category\": \"Electronics\",\n  \"price\": 2999,\n  \"stock\": 20,\n  \"rating\": 4.6\n}\n\n</code></pre>\n<hr />\n<h3 id=\"response\">Response</h3>\n<p><strong>Status Code:</strong> <code>201 Created</code></p>\n<p>Returns a confirmation message along with the full details of the newly created product, including its auto-generated <code>id</code>.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>message</code></td>\n<td><code>string</code></td>\n<td>Confirmation message for the operation</td>\n</tr>\n<tr>\n<td><code>products.id</code></td>\n<td><code>number</code></td>\n<td>Auto-generated unique ID of the product</td>\n</tr>\n<tr>\n<td><code>products.name</code></td>\n<td><code>string</code></td>\n<td>Name of the created product</td>\n</tr>\n<tr>\n<td><code>products.category</code></td>\n<td><code>string</code></td>\n<td>Category of the created product</td>\n</tr>\n<tr>\n<td><code>products.price</code></td>\n<td><code>number</code></td>\n<td>Price of the created product</td>\n</tr>\n<tr>\n<td><code>products.stock</code></td>\n<td><code>number</code></td>\n<td>Stock quantity of the created product</td>\n</tr>\n<tr>\n<td><code>products.rating</code></td>\n<td><code>number</code></td>\n<td>Rating of the created product</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Example Response Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"message\": \"Products created\",\n  \"products\": {\n    \"id\": 6,\n    \"name\": \"Bluetooth Speaker\",\n    \"category\": \"Electronics\",\n    \"price\": 2999,\n    \"stock\": 20,\n    \"rating\": 4.6\n  }\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["products"],"host":["node-assignmentt","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"b70bf851-647e-4baf-8e7e-1e8258c3ce54"},{"name":"Replaces a product completely by ID.","id":"cf497a8c-0e25-4c90-936c-8b9f6acbb669","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n  \"name\": \"Bluetooth Speaker\",\r\n  \"category\": \"Electronics\",\r\n  \"price\": 2999,\r\n  \"stock\": 20,\r\n  \"rating\": 4.6\r\n}","options":{"raw":{"language":"json"}}},"url":"https://node-assignmentt.onrender.com/products/:id","urlObject":{"protocol":"https","path":["products",":id"],"host":["node-assignmentt","onrender","com"],"query":[],"variable":[{"type":"any","value":"2","key":"id"}]}},"response":[],"_postman_id":"cf497a8c-0e25-4c90-936c-8b9f6acbb669"},{"name":"Updates stock of a specific product.","id":"42c8bcdf-f1c1-4b65-a3e0-a4e6e502d745","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n  \"stock\": 150\r\n}"},"url":"https://node-assignmentt.onrender.com/products/:id/stock","urlObject":{"protocol":"https","path":["products",":id","stock"],"host":["node-assignmentt","onrender","com"],"query":[],"variable":[{"type":"any","value":"1","key":"id"}]}},"response":[],"_postman_id":"42c8bcdf-f1c1-4b65-a3e0-a4e6e502d745"},{"name":"Updates price of a specific product.","id":"7b9b3336-6e60-43b8-8884-926803d16f8c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n  \"price\": 150\r\n}","options":{"raw":{"language":"json"}}},"url":"https://node-assignmentt.onrender.com/products/:id/price","urlObject":{"protocol":"https","path":["products",":id","price"],"host":["node-assignmentt","onrender","com"],"query":[],"variable":[{"type":"any","value":"1","key":"id"}]}},"response":[],"_postman_id":"7b9b3336-6e60-43b8-8884-926803d16f8c"}]}