{"info":{"_postman_id":"5bd950d3-8834-44e9-a9a2-c382997b8063","name":"6SenseHQ_BackEnd_API","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"50920410","collectionId":"5bd950d3-8834-44e9-a9a2-c382997b8063","publishedId":"2sBXqDt3y3","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2026-04-19T11:55:09.000Z"},"item":[{"name":"Category","item":[{"name":"Create Category","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 201\", function () {","    pm.expect(pm.response.code).to.equal(201);","});","","","pm.test(\"Response has required fields\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.all.keys('success', 'statusCode', 'message', 'requestId', 'data');","});","","","pm.test(\"Data object contains required fields\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.data).to.exist.and.to.be.an('object');","    ","    const requiredFields = ['name', 'description', '_id', 'createdAt', 'updatedAt', '__v'];","    requiredFields.forEach(field => {","        pm.expect(responseData.data).to.have.property(field);","    });","});","","","pm.test(\"Name is a non-empty string\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.data).to.exist.and.to.be.an('object');","    pm.expect(responseData.data.name).to.exist.and.to.be.a('string').and.to.have.lengthOf.at.least(1, \"Name should not be empty\");","});","","","pm.test(\"CreatedAt and updatedAt are in a valid date format\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.data).to.be.an('object');","    ","    const createdAt = new Date(responseData.data.createdAt);","    const updatedAt = new Date(responseData.data.updatedAt);","    ","    pm.expect(createdAt).to.not.be.NaN.and.to.be.instanceof(Date, \"CreatedAt should be a valid date\");","    pm.expect(updatedAt).to.not.be.NaN.and.to.be.instanceof(Date, \"UpdatedAt should be a valid date\");","});"],"type":"text/javascript"}}],"id":"9e0e6980-2b96-47bd-a874-22ed19670334","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"name\": \"Electronics\",\n  \"description\": \"Gadgets and tech items\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/category/create-category","urlObject":{"path":["category","create-category"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[{"id":"94a9f560-4b56-4ca5-b8d4-8b73558bdca9","name":"Create Category","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"name\": \"Gadgets\",\n  \"description\": \"Headphone Items\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/category/create-category"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"x-request-id","value":"bd52dcf6-c4bc-4b52-b1b2-95f57c889a98"},{"key":"Content-Security-Policy","value":"default-src 'self';script-src 'self' 'unsafe-inline' cdn.tailwindcss.com;style-src 'self' 'unsafe-inline' fonts.googleapis.com cdn.tailwindcss.com;font-src 'self' fonts.gstatic.com;img-src 'self' data: res.cloudinary.com;base-uri 'self';form-action 'self';frame-ancestors 'self';object-src 'none';script-src-attr 'none'"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=31536000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"Vary","value":"Origin, Accept-Encoding"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Access-Control-Expose-Headers","value":"x-request-id"},{"key":"RateLimit-Policy","value":"300;w=900"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"283"},{"key":"RateLimit-Reset","value":"444"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"303"},{"key":"ETag","value":"W/\"12f-hSNDQGdJBhXd59SLY+cZy5REuXQ\""},{"key":"Date","value":"Sun, 19 Apr 2026 10:38:23 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"statusCode\": 201,\n    \"message\": \"Category created successfully\",\n    \"requestId\": \"bd52dcf6-c4bc-4b52-b1b2-95f57c889a98\",\n    \"data\": {\n        \"name\": \"Gadgets\",\n        \"description\": \"Headphone Items\",\n        \"_id\": \"69e4b09f154adcb052d162e1\",\n        \"createdAt\": \"2026-04-19T10:38:23.613Z\",\n        \"updatedAt\": \"2026-04-19T10:38:23.613Z\",\n        \"__v\": 0\n    }\n}"}],"_postman_id":"9e0e6980-2b96-47bd-a874-22ed19670334"},{"name":"Get All Categories","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","    pm.expect(pm.response.code).to.eql(200);","});","","","pm.test(\"Response has the required fields\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.all.keys('success', 'statusCode', 'message', 'requestId', 'data', 'meta');","});","","","pm.test(\"Data is an array with at least one element\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.data).to.be.an('array').that.is.not.empty;","});","","","pm.test(\"Each category object has required fields\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.data).to.be.an('array').that.is.not.empty;","","    responseData.data.forEach(function(category) {","        pm.expect(category).to.have.all.keys('_id', 'name', 'description', 'createdAt', 'updatedAt', '__v');","    });","});","","","pm.test(\"Meta information contains valid pagination details\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.meta).to.exist.and.to.be.an('object');","    ","    const meta = responseData.meta;","    pm.expect(meta.page).to.be.a('number');","    pm.expect(meta.limit).to.be.a('number');","    pm.expect(meta.total).to.be.a('number');","    pm.expect(meta.totalPage).to.be.a('number');","});"],"type":"text/javascript"}}],"id":"b261395b-00dd-48cd-a309-690be777a3f7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/category/get-all-categories","urlObject":{"path":["category","get-all-categories"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[{"id":"06f4c8ae-505e-45d0-8692-66a5f72bae28","name":"Get All Categories","originalRequest":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/category/get-all-categories"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"x-request-id","value":"438430d9-e4c8-4677-814c-8e4da6809378"},{"key":"Content-Security-Policy","value":"default-src 'self';script-src 'self' 'unsafe-inline' cdn.tailwindcss.com;style-src 'self' 'unsafe-inline' fonts.googleapis.com cdn.tailwindcss.com;font-src 'self' fonts.gstatic.com;img-src 'self' data: res.cloudinary.com;base-uri 'self';form-action 'self';frame-ancestors 'self';object-src 'none';script-src-attr 'none'"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=31536000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"Vary","value":"Origin, Accept-Encoding"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Access-Control-Expose-Headers","value":"x-request-id"},{"key":"RateLimit-Policy","value":"300;w=900"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"282"},{"key":"RateLimit-Reset","value":"421"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"541"},{"key":"ETag","value":"W/\"21d-k8J/a7UrOtUgmaQ+Y3HjKAYJhRY\""},{"key":"Date","value":"Sun, 19 Apr 2026 10:38:46 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"statusCode\": 200,\n    \"message\": \"Categories fetched successfully\",\n    \"requestId\": \"438430d9-e4c8-4677-814c-8e4da6809378\",\n    \"data\": [\n        {\n            \"_id\": \"69e4b09f154adcb052d162e1\",\n            \"name\": \"Gadgets\",\n            \"description\": \"Headphone Items\",\n            \"createdAt\": \"2026-04-19T10:38:23.613Z\",\n            \"updatedAt\": \"2026-04-19T10:38:23.613Z\",\n            \"__v\": 0\n        },\n        {\n            \"_id\": \"69e4b020154adcb052d162d6\",\n            \"name\": \"Electronics\",\n            \"description\": \"Gadgets and tech items\",\n            \"createdAt\": \"2026-04-19T10:36:16.332Z\",\n            \"updatedAt\": \"2026-04-19T10:36:16.332Z\",\n            \"__v\": 0\n        }\n    ],\n    \"meta\": {\n        \"page\": 1,\n        \"limit\": 10,\n        \"total\": 2,\n        \"totalPage\": 1\n    }\n}"}],"_postman_id":"b261395b-00dd-48cd-a309-690be777a3f7"},{"name":"Get Single Category","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 400\", function () {","    pm.expect(pm.response.code).to.eql(400);","});","","","pm.test(\"Response contains a success field that is true\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.success).to.exist.and.to.be.true;","});","","","pm.test(\"ErrorSource is an array with at least one element\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.have.property('errorSource').that.is.an('array').with.lengthOf.at.least(1);","});","","","pm.test(\"The message field must be a non-empty string\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.message).to.exist.and.to.be.a('string').and.to.have.lengthOf.at.least(1, \"Value should not be empty\");","});","","","pm.test(\"The requestId must be a non-empty string\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.have.property('requestId').that.is.a('string').and.is.not.empty;","});"],"type":"text/javascript"}}],"id":"c08052fa-35f8-4f3f-8144-e221ff8a5c85","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/category/get-single-category/69e39c4b39b74da4c1aa7fa9","urlObject":{"path":["category","get-single-category","69e39c4b39b74da4c1aa7fa9"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[{"id":"85a204d4-6d45-4fd0-8b93-75ab9ece4056","name":"Get Single Category","originalRequest":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/category/get-single-category/69e39c4b39b74da4c1aa7fa9"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"x-request-id","value":"f33ecf5c-f935-47cc-9c17-594c6f5b8526"},{"key":"Content-Security-Policy","value":"default-src 'self';script-src 'self' 'unsafe-inline' cdn.tailwindcss.com;style-src 'self' 'unsafe-inline' fonts.googleapis.com cdn.tailwindcss.com;font-src 'self' fonts.gstatic.com;img-src 'self' data: res.cloudinary.com;base-uri 'self';form-action 'self';frame-ancestors 'self';object-src 'none';script-src-attr 'none'"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=31536000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"Vary","value":"Origin, Accept-Encoding"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Access-Control-Expose-Headers","value":"x-request-id"},{"key":"RateLimit-Policy","value":"300;w=900"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"275"},{"key":"RateLimit-Reset","value":"359"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"303"},{"key":"ETag","value":"W/\"12f-8JNQQQiPF04rZoNzSC+uZ/xw7Bs\""},{"key":"Date","value":"Sun, 19 Apr 2026 10:39:48 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"statusCode\": 200,\n    \"message\": \"Category fetched successfully\",\n    \"requestId\": \"f33ecf5c-f935-47cc-9c17-594c6f5b8526\",\n    \"data\": {\n        \"_id\": \"69e4b09f154adcb052d162e1\",\n        \"name\": \"Gadgets\",\n        \"description\": \"Headphone Items\",\n        \"createdAt\": \"2026-04-19T10:38:23.613Z\",\n        \"updatedAt\": \"2026-04-19T10:38:23.613Z\",\n        \"__v\": 0\n    }\n}"}],"_postman_id":"c08052fa-35f8-4f3f-8144-e221ff8a5c85"},{"name":"Update Category","event":[{"listen":"test","script":{"id":"2b0fb2a0-a40d-4564-94f9-01c597d14e97","exec":["const jsonData = pm.response.json();","","pm.test(\"Update successful despite empty name field\", () => {","    pm.response.to.have.status(200);","    // The name should NOT be an empty string; it should remain the original \"Electronics\"","    pm.expect(jsonData.data.name).to.eql(\"Electronics\");","    pm.expect(jsonData.data.description).to.eql(\"Updated Description\");","});"],"type":"text/javascript","packages":{}}}],"id":"4dce1465-a979-4c8d-930f-10e6332255a4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"formdata","formdata":[]},"url":"http://localhost:5000/api/v1/category/update-category/69e39c4b39b74da4c1aa7fa9","urlObject":{"path":["category","update-category","69e39c4b39b74da4c1aa7fa9"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"4dce1465-a979-4c8d-930f-10e6332255a4"},{"name":"Delete Category","id":"f5ae5761-f9a7-4484-8f61-28def7bdb82b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"f5ae5761-f9a7-4484-8f61-28def7bdb82b"}],"id":"a3c2a5ae-470c-432b-8360-c817a63c8f84","_postman_id":"a3c2a5ae-470c-432b-8360-c817a63c8f84","description":""},{"name":"Product","item":[{"name":"Create Product","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 422\", function () {","    pm.expect(pm.response.code).to.eql(422);","});","","","pm.test(\"Response contains the success field and it is true\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.property('success', true);","});","","","pm.test(\"Response has required fields\", function () {","    const responseData = pm.response.json();","","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.all.keys('success', 'code', 'message', 'errorSource', 'requestId', 'stack');","    ","    pm.expect(responseData.errorSource).to.be.an('array');","    responseData.errorSource.forEach(function(error) {","        pm.expect(error).to.be.an('object').that.has.all.keys('path', 'message');","    });","});","","","pm.test(\"Error source contains an array with at least one element\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.errorSource).to.be.an('array').that.is.not.empty;","});","","","pm.test(\"Each error object in errorSource has valid path and message fields\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.have.property('errorSource').that.is.an('array').and.is.not.empty;","","    responseData.errorSource.forEach(function(error) {","        pm.expect(error).to.have.all.keys('path', 'message');","        pm.expect(error.path).to.be.a('string');","        pm.expect(error.message).to.be.a('string');","    });","});"],"type":"text/javascript"}}],"id":"35a9d230-bdf6-4a40-993c-803c919529e2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"Alpha Sorter","type":"text"},{"key":"description","value":"High-speed sorting robot","type":"text"},{"key":"price","value":"1250","type":"text"},{"key":"discount","value":"15","type":"text"},{"key":"category","value":"69e35d8a1d45ebd757652e27","type":"text"},{"key":"status","value":"In Stock","type":"text"},{"key":"image","type":"file","src":"/home/nayemsarkar/Downloads/Sukuna_Domain.webp"}]},"url":"http://localhost:5000/api/v1/product/create-product","urlObject":{"path":["product","create-product"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[{"id":"6855557f-9596-4abf-bbde-9a5700741a9e","name":"Create Product","originalRequest":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"Alpha Sorter","type":"text"},{"key":"description","value":"High-speed sorting robot","type":"text"},{"key":"price","value":"1250","type":"text"},{"key":"discount","value":"15","type":"text"},{"key":"category","value":"69e4b09f154adcb052d162e1","type":"text"},{"key":"status","value":"in stock","type":"text"},{"key":"image","type":"file","fileNotInWorkingDirectoryWarning":"This file isn't in your working directory. Teammates you share this request with won't be able to use this file. To make collaboration easier you can setup your working directory in Settings.","filesNotInWorkingDirectory":["/home/nayemsarkar/Downloads/mahoraga-wallpaper.webp"],"src":"/home/nayemsarkar/Downloads/mahoraga-wallpaper.webp"}]},"url":"http://localhost:5000/api/v1/product/create-product"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"x-request-id","value":"be61fadc-eafb-479f-82ad-20054ac44966"},{"key":"Content-Security-Policy","value":"default-src 'self';script-src 'self' 'unsafe-inline' cdn.tailwindcss.com;style-src 'self' 'unsafe-inline' fonts.googleapis.com cdn.tailwindcss.com;font-src 'self' fonts.gstatic.com;img-src 'self' data: res.cloudinary.com;base-uri 'self';form-action 'self';frame-ancestors 'self';object-src 'none';script-src-attr 'none'"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=31536000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"Vary","value":"Origin, Accept-Encoding"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Access-Control-Expose-Headers","value":"x-request-id"},{"key":"RateLimit-Policy","value":"300;w=900"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"291"},{"key":"RateLimit-Reset","value":"823"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"593"},{"key":"ETag","value":"W/\"251-FAdGDE+thgZv/yN62Em6WWsG7OA\""},{"key":"Date","value":"Sun, 19 Apr 2026 10:48:36 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"statusCode\": 201,\n    \"message\": \"Product created successfully\",\n    \"requestId\": \"be61fadc-eafb-479f-82ad-20054ac44966\",\n    \"data\": {\n        \"name\": \"Alpha Sorter\",\n        \"description\": \"High-speed sorting robot\",\n        \"price\": 1250,\n        \"discount\": 15,\n        \"image\": \"https://res.cloudinary.com/dylhnozja/image/upload/v1776595716/products/ikmex17ze5cktxzafxn2.webp\",\n        \"status\": \"in stock\",\n        \"productCode\": \"0231dd7-0alport8\",\n        \"category\": \"69e4b09f154adcb052d162e1\",\n        \"_id\": \"69e4b304154adcb052d162ed\",\n        \"createdAt\": \"2026-04-19T10:48:36.585Z\",\n        \"updatedAt\": \"2026-04-19T10:48:36.585Z\",\n        \"__v\": 0,\n        \"finalPrice\": 1062.5,\n        \"id\": \"69e4b304154adcb052d162ed\"\n    }\n}"}],"_postman_id":"35a9d230-bdf6-4a40-993c-803c919529e2"},{"name":"Update Product","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 404\", function () {","    pm.expect(pm.response.code).to.equal(404);","});","","","pm.test(\"Response contains success field that is true\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.success).to.exist.and.to.be.true;","});","","","pm.test(\"Error message must be a non-empty string\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.errorSource).to.be.an('array');","    responseData.errorSource.forEach(function(error) {","        pm.expect(error.message).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Error message should not be empty\");","    });","});","","","pm.test(\"Response has the required fields\", function () {","    const responseData = pm.response.json();","","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.all.keys('success', 'code', 'message', 'errorSource', 'requestId', 'stack');","","    pm.expect(responseData.errorSource).to.be.an('array');","    responseData.errorSource.forEach(function(error) {","        pm.expect(error).to.be.an('object');","        pm.expect(error).to.have.all.keys('path', 'message');","    });","});","","","pm.test(\"ErrorSource is an array and contains at least one object with valid path and message fields\", function () {","    const responseData = pm.response.json();","","    pm.expect(responseData).to.have.property('errorSource').that.is.an('array').and.to.have.length.of.at.least(1);","    ","    responseData.errorSource.forEach(function(error) {","        pm.expect(error).to.be.an('object');","        pm.expect(error).to.have.property('path').that.is.a('string').and.to.have.lengthOf.at.least(1);","        pm.expect(error).to.have.property('message').that.is.a('string').and.to.have.lengthOf.at.least(1);","    });","});"],"type":"text/javascript"}}],"id":"309fd44a-0abd-460e-b17f-c9b5d721c938","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"formdata","formdata":[{"key":"status","value":"stock out","type":"text"}]},"url":"http://localhost:5000/api/v1/product/69e37b55a9e43f2223df7216","urlObject":{"path":["product","69e37b55a9e43f2223df7216"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"309fd44a-0abd-460e-b17f-c9b5d721c938"},{"name":"Get All Products","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","    pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Success field is true\", function () {","    const responseData = pm.response.json();","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.success).to.be.true;","});","","","pm.test(\"Meta object contains expected fields\", function () {","    const responseData = pm.response.json();","","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.meta).to.exist;","    pm.expect(responseData.meta).to.have.all.keys('page', 'limit', 'total', 'totalPage');","});","","","pm.test(\"Ensure the data array is present in the response\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.property('data').that.is.an('array');","});","","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});"],"type":"text/javascript"}}],"id":"3a1a4020-8531-4d3e-882f-0e349437b507","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/product/get-all-products","urlObject":{"path":["product","get-all-products"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[{"id":"a7b9856e-a8ad-4d10-9079-3447ed8916b4","name":"Get All Products","originalRequest":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/product/get-all-products"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"x-request-id","value":"26fc7e87-89df-41e3-8026-a5005a901a44"},{"key":"Content-Security-Policy","value":"default-src 'self';script-src 'self' 'unsafe-inline' cdn.tailwindcss.com;style-src 'self' 'unsafe-inline' fonts.googleapis.com cdn.tailwindcss.com;font-src 'self' fonts.gstatic.com;img-src 'self' data: res.cloudinary.com;base-uri 'self';form-action 'self';frame-ancestors 'self';object-src 'none';script-src-attr 'none'"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=31536000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"Vary","value":"Origin, Accept-Encoding"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Access-Control-Expose-Headers","value":"x-request-id"},{"key":"RateLimit-Policy","value":"300;w=900"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"289"},{"key":"RateLimit-Reset","value":"663"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"792"},{"key":"ETag","value":"W/\"318-MvfBwHZ9tXScDbi5GoJRZ/traWw\""},{"key":"Date","value":"Sun, 19 Apr 2026 10:51:13 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"statusCode\": 200,\n    \"message\": \"Products fetched successfully\",\n    \"requestId\": \"26fc7e87-89df-41e3-8026-a5005a901a44\",\n    \"data\": [\n        {\n            \"_id\": \"69e4b304154adcb052d162ed\",\n            \"name\": \"Alpha Sorter\",\n            \"description\": \"High-speed sorting robot\",\n            \"price\": 1250,\n            \"discount\": 15,\n            \"image\": \"https://res.cloudinary.com/dylhnozja/image/upload/v1776595716/products/ikmex17ze5cktxzafxn2.webp\",\n            \"status\": \"in stock\",\n            \"productCode\": \"0231dd7-0alport8\",\n            \"category\": {\n                \"_id\": \"69e4b09f154adcb052d162e1\",\n                \"name\": \"Gadgets\",\n                \"description\": \"Headphone Items\",\n                \"createdAt\": \"2026-04-19T10:38:23.613Z\",\n                \"updatedAt\": \"2026-04-19T10:38:23.613Z\",\n                \"__v\": 0\n            },\n            \"createdAt\": \"2026-04-19T10:48:36.585Z\",\n            \"updatedAt\": \"2026-04-19T10:48:36.585Z\",\n            \"__v\": 0,\n            \"finalPrice\": 1062.5,\n            \"id\": \"69e4b304154adcb052d162ed\"\n        }\n    ],\n    \"meta\": {\n        \"page\": 1,\n        \"limit\": 10,\n        \"total\": 1,\n        \"totalPage\": 1\n    }\n}"}],"_postman_id":"3a1a4020-8531-4d3e-882f-0e349437b507"},{"name":"Get Single Product","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 404\", function () {","    pm.expect(pm.response.code).to.eql(404);","});","","","pm.test(\"Response contains success flag set to true\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.property('success', true);","});","","","pm.test(\"Response includes a meaningful error message\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.all.keys('success', 'code', 'message', 'errorSource', 'requestId', 'stack');","    pm.expect(responseData.errorSource).to.be.an('array').that.is.not.empty;","    ","    responseData.errorSource.forEach(function(error) {","        pm.expect(error).to.have.all.keys('path', 'message');","        pm.expect(error.message).to.exist.and.to.have.lengthOf.at.least(1, \"Error message should not be empty\");","    });","});","","","pm.test(\"ErrorSource is an array and contains at least one error object\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.errorSource).to.be.an('array').that.is.not.empty;","    responseData.errorSource.forEach(function(error) {","        pm.expect(error).to.be.an('object');","        pm.expect(error).to.have.property('path').that.is.a('string');","        pm.expect(error).to.have.property('message').that.is.a('string');","    });","});","","","pm.test(\"Each error object in errorSource has a non-empty path and message\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.have.property('errorSource').that.is.an('array').and.is.not.empty;","    ","    responseData.errorSource.forEach(function(error) {","        pm.expect(error).to.have.property('path').that.is.a('string').and.is.not.empty;","        pm.expect(error).to.have.property('message').that.is.a('string').and.is.not.empty;","    });","});"],"type":"text/javascript"}}],"id":"e80d1778-29fb-47ff-8c90-b9358abc6ad3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/product/69e37b55a9e43f2223df7216","description":"<h3 id=\"api-endpoint-retrieve-product-details\">API Endpoint: Retrieve Product Details</h3>\n<p>This endpoint allows users to retrieve detailed information about a specific product using its unique identifier (<code>productId</code>).</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><strong>Method</strong>: GET</li>\n<li><strong>URL</strong>: <code>http://localhost:5000/api/v1/product/69e4b304154adcb052d162ed</code></li>\n</ul>\n<h5 id=\"path-parameters\">Path Parameters:</h5>\n<ul>\n<li><code>productId</code> (string): The unique identifier of the product for which details are being requested. This parameter is required.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response will return a JSON object with the following structure:</p>\n<ul>\n<li><strong>success</strong> (boolean): Indicates whether the request was successful.</li>\n<li><strong>code</strong> (string): A code representing the status of the request, typically used for error handling.</li>\n<li><strong>message</strong> (string): A message providing additional information about the request status.</li>\n<li><strong>errorSource</strong> (array): An array of error objects, each containing:<ul>\n<li><strong>path</strong> (string): The path related to the error, if applicable.</li>\n<li><strong>message</strong> (string): A message describing the error.</li>\n</ul>\n</li>\n<li><strong>requestId</strong> (string): A unique identifier for the request, useful for tracking and debugging.</li>\n<li><strong>stack</strong> (string): A stack trace for debugging purposes, if applicable.</li>\n</ul>\n<h4 id=\"error-handling\">Error Handling</h4>\n<p>In case of an error, the API will return a status code of 400 along with a JSON response that includes details about the error. This can help users diagnose issues related to the request.</p>\n<h3 id=\"usage-notes\">Usage Notes</h3>\n<ul>\n<li>Ensure that the <code>productId</code> is valid and corresponds to an existing product in the system.</li>\n<li>Check the <code>success</code> field in the response to determine if the request was successful.</li>\n<li>Utilize the <code>errorSource</code> array to understand any issues that may have occurred during the request.</li>\n</ul>\n","urlObject":{"path":["product","69e37b55a9e43f2223df7216"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[{"id":"26524ab8-1a6a-433b-82b9-b719042da03c","name":"Get Single Product","originalRequest":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/product/get-single-product/69e4b304154adcb052d162ed"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"x-request-id","value":"3c94bb62-9d24-483a-8132-eee8b516423f"},{"key":"Content-Security-Policy","value":"default-src 'self';script-src 'self' 'unsafe-inline' cdn.tailwindcss.com;style-src 'self' 'unsafe-inline' fonts.googleapis.com cdn.tailwindcss.com;font-src 'self' fonts.gstatic.com;img-src 'self' data: res.cloudinary.com;base-uri 'self';form-action 'self';frame-ancestors 'self';object-src 'none';script-src-attr 'none'"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=31536000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"Vary","value":"Origin, Accept-Encoding"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Access-Control-Expose-Headers","value":"x-request-id"},{"key":"RateLimit-Policy","value":"300;w=900"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"900"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"738"},{"key":"ETag","value":"W/\"2e2-lPu1wzFXRLJm2rVc4EsORYIEvAs\""},{"key":"Date","value":"Sun, 19 Apr 2026 11:24:47 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"statusCode\": 200,\n    \"message\": \"Product retrieved successfully\",\n    \"requestId\": \"3c94bb62-9d24-483a-8132-eee8b516423f\",\n    \"data\": {\n        \"_id\": \"69e4b304154adcb052d162ed\",\n        \"name\": \"Alpha Sorter\",\n        \"description\": \"High-speed sorting robot\",\n        \"price\": 1250,\n        \"discount\": 15,\n        \"image\": \"https://res.cloudinary.com/dylhnozja/image/upload/v1776595716/products/ikmex17ze5cktxzafxn2.webp\",\n        \"status\": \"in stock\",\n        \"productCode\": \"0231dd7-0alport8\",\n        \"category\": {\n            \"_id\": \"69e4b09f154adcb052d162e1\",\n            \"name\": \"Gadgets\",\n            \"description\": \"Headphone Items\",\n            \"createdAt\": \"2026-04-19T10:38:23.613Z\",\n            \"updatedAt\": \"2026-04-19T10:38:23.613Z\",\n            \"__v\": 0\n        },\n        \"createdAt\": \"2026-04-19T10:48:36.585Z\",\n        \"updatedAt\": \"2026-04-19T10:48:36.585Z\",\n        \"__v\": 0,\n        \"finalPrice\": 1062.5,\n        \"id\": \"69e4b304154adcb052d162ed\"\n    }\n}"}],"_postman_id":"e80d1778-29fb-47ff-8c90-b9358abc6ad3"},{"name":"Delete Product","event":[{"listen":"test","script":{"id":"0b7e36c1-a6c5-49e5-9b33-7d34646a93e6","exec":["pm.test(\"Response status code is 404\", function () {","    pm.expect(pm.response.code).to.eql(404);","});","","","pm.test(\"Response has the required fields\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.all.keys('success', 'code', 'message', 'errorSource', 'requestId', 'stack');","});","","","pm.test(\"ErrorSource is an array and contains at least one object\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.errorSource).to.be.an('array').that.is.not.empty;","    responseData.errorSource.forEach(function(item) {","        pm.expect(item).to.be.an('object');","    });","});","","","pm.test(\"Error message must be a non-empty string\", function () {","    const responseData = pm.response.json();","","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.errorSource).to.be.an('array');","","    responseData.errorSource.forEach(function(error) {","        pm.expect(error.message).to.exist.and.to.be.a('string').and.to.have.lengthOf.at.least(1, \"Error message should not be empty\");","    });","});","","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});"],"type":"text/javascript","packages":{}}}],"id":"9ecc3968-6b97-45c2-8795-68878fe37225","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:5000/api/v1/product/delete-product/69e4b304154adcb052d162ed","urlObject":{"path":["product","delete-product","69e4b304154adcb052d162ed"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"9ecc3968-6b97-45c2-8795-68878fe37225"}],"id":"7c5c7658-2b00-4d44-ad6f-c64d810b73d7","_postman_id":"7c5c7658-2b00-4d44-ad6f-c64d810b73d7","description":""}],"variable":[{"key":"api_version","value":"/api/v1"},{"key":"base_Url","value":"http://localhost:5000"},{"key":"categoryId","value":"69e39c4b39b74da4c1aa7fa9"},{"key":"productId","value":"69e4b304154adcb052d162ed"}]}