{"info":{"_postman_id":"a4358b8a-9774-4c29-b64a-7c42b5ba1158","name":"Flower Obsession Application Nest.JS","description":"<html><head></head><body><p>Project powered by <a href=\"https://www.linkedin.com/in/mohamedelsayed2002/\">Mohamed Elsayed</a></p>\n<h1 id=\"get-started-here\">🚀 Get started here</h1>\n<p>This template guides you through CRUD operations (GET, POST, PUT, DELETE), variables, and tests.</p>\n<h2 id=\"🔖-how-to-use-this-template\">🔖 <strong>How to use this template</strong></h2>\n<h4 id=\"step-1-send-requests\"><strong>Step 1: Send requests</strong></h4>\n<p>RESTful APIs allow you to perform CRUD operations using the POST, GET, PUT, and DELETE HTTP methods.</p>\n<p>This collection contains each of these <a href=\"https://learning.postman.com/docs/sending-requests/requests/\">request</a> types. Open each request and click \"Send\" to see what happens.</p>\n<h4 id=\"step-2-view-responses\"><strong>Step 2: View responses</strong></h4>\n<p>Observe the response tab for status code (200 OK), response time, and size.</p>\n<h4 id=\"step-3-send-new-body-data\"><strong>Step 3: Send new Body data</strong></h4>\n<p>Update or add new data in \"Body\" in the POST request. Typically, Body data is also used in PUT request.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"name\": \"Add your name in the body\"\n}\n\n</code></pre><h4 id=\"step-4-update-the-variable\"><strong>Step 4: Update the variable</strong></h4>\n<p>Variables enable you to store and reuse values in Postman. We have created a <a href=\"https://learning.postman.com/docs/sending-requests/variables/\">variable</a> called <code>base_url</code> with the sample request <a href=\"https://postman-api-learner.glitch.me\">https://postman-api-learner.glitch.me</a>. Replace it with your API endpoint to customize this collection.</p>\n<h4 id=\"step-5-add-tests-in-the-scripts-tab\"><strong>Step 5: Add tests in the \"Scripts\" tab</strong></h4>\n<p>Adding tests to your requests can help you confirm that your API is working as expected. You can write test scripts in JavaScript and view the output in the \"Test Results\" tab.</p>\n<h2 id=\"💪-pro-tips\">💪 Pro tips</h2>\n<ul>\n<li><p>Use folders to group related requests and organize the collection.</p>\n</li>\n<li><p>Add more <a href=\"https://learning.postman.com/docs/writing-scripts/intro-to-scripts/\">scripts</a> to verify if the API works as expected and execute workflows.</p>\n</li>\n</ul>\n<h2 id=\"💡related-templates\">💡Related templates</h2>\n<p><a href=\"https://go.postman.co/redirect/workspace?type=personal&amp;collectionTemplateId=e9a37a28-055b-49cd-8c7e-97494a21eb54&amp;sourceTemplateId=ddb19591-3097-41cf-82af-c84273e56719\">API testing basics</a><br><a href=\"https://go.postman.co/redirect/workspace?type=personal&amp;collectionTemplateId=e9c28f47-1253-44af-a2f3-20dce4da1f18&amp;sourceTemplateId=ddb19591-3097-41cf-82af-c84273e56719\">API documentation</a><br><a href=\"https://go.postman.co/redirect/workspace?type=personal&amp;collectionTemplateId=31a9a6ed-4cdf-4ced-984c-d12c9aec1c27&amp;sourceTemplateId=ddb19591-3097-41cf-82af-c84273e56719\">Authorization methods</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"🚀 Get started here","slug":"get-started-here"}],"owner":"25341458","collectionId":"a4358b8a-9774-4c29-b64a-7c42b5ba1158","publishedId":"2sAYkARP3u","public":true,"customColor":{"top-bar":"fdf3e9","right-sidebar":"fdf3e9","highlight":"fdf3e9"},"publishDate":"2025-03-19T18:50:17.000Z"},"item":[{"name":"Auth","item":[{"name":"Login","id":"447639c6-7ff8-4ca4-b10b-810839a45c54","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\" : \"mohamedelsayed20258@gmail.com\",\r\n    \"password\" : \"01093588197Mm!\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//auth/login","urlObject":{"path":["auth","login"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"447639c6-7ff8-4ca4-b10b-810839a45c54"},{"name":"Register","id":"34253626-9e63-4a1a-b393-75c169e5a719","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\" : \"Salma\",\r\n    \"email\" : \"salma1@gmail.com\",\r\n    \"gender\" : \"Female\",\r\n    \"phone\" : \"+201099104410\",\r\n    \"password\": \"01093588197Mm\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//auth/register","urlObject":{"path":["auth","register"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"34253626-9e63-4a1a-b393-75c169e5a719"},{"name":"Get All Users","id":"f6752fbf-b0bb-4cee-9ef9-93fab5b6684e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MjI1MDE3MywiZXhwIjoxNzQyMjUzNzczfQ.86kVCUI0t2AHlZOVfoCTV8Uz5f7L3-QeSOu3cY91byM","type":"text"}],"url":"https://postman-rest-api-learner.glitch.me//auth","urlObject":{"path":["auth"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"f6752fbf-b0bb-4cee-9ef9-93fab5b6684e"},{"name":"Get Profile","id":"5754d177-5947-4a35-95c9-7f271f4987fd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MjM0MTExMSwiZXhwIjoxNzQyMzQ0NzExfQ.2OoVffkLO1Sc8x27ylUA2F-shgpKWRlLE4gLgNO1DcA","type":"text"}],"url":"https://postman-rest-api-learner.glitch.me//auth/profile","urlObject":{"path":["auth","profile"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"5754d177-5947-4a35-95c9-7f271f4987fd"},{"name":"Revenue Analytics","id":"29ed029c-d68f-442c-9a1c-ef6a82c96352","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://postman-rest-api-learner.glitch.me//users/revenue-analytics","urlObject":{"path":["users","revenue-analytics"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"29ed029c-d68f-442c-9a1c-ef6a82c96352"},{"name":"Customer Analytics","id":"7862f696-63d0-49c7-9d56-0025321e8ea3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"7862f696-63d0-49c7-9d56-0025321e8ea3"}],"id":"873bbd1b-bec1-4cbf-8f73-f325e37cd349","description":"<p>Auth Routes Documentation</p>\n<ol>\n<li><p>Register User</p>\n<ol>\n<li><p>End Point <code>Post /auth/register</code></p>\n</li>\n<li><p>Description: Create a new user account.</p>\n</li>\n<li><p>Handling errors ( Duplicate emails, missing values)</p>\n</li>\n</ol>\n</li>\n</ol>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\"> {\n \"name\" : \"Mohamed Elsayed\",\n  \"email\" : \"mohamedelsayed20258@gmail.com\",\n  \"password\" : \"01093588197Mm!\"\n  \"gender\" : \"Male\"\n  \"phone\" : \"+201093588197\"\n }\n\n</code></pre>\n<ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"name\": \"Mohamed Elsayed\",\n    \"email\": \"mohamedelsayed20258@gmail.com@gmail.com\",\n    \"password\": \"$2b$08$B6i.T2TDBd9sHA0yhhtb5uRevu4jpd2trUC0eD5OhnfKOvYm7Qh/C\",\n    \"phone\": \"+201099104410\",\n    \"gender\": \"Male\",\n    \"role\": \"Admin\",\n    \"_id\": \"67d410dcf6f0ad0963b2e11d\",\n    \"createdAt\": \"2025-03-14T11:19:56.683Z\",\n    \"updatedAt\": \"2025-03-14T11:19:56.683Z\",\n    \"__v\": 0\n}\n\n</code></pre>\n<h2 id=\"login-user\">Login User</h2>\n<ul>\n<li><p>Endpoint: <code>POST /auth/login</code></p>\n</li>\n<li><p>Description: Authenticates a user and returns a access_token</p>\n</li>\n<li><p>Request body</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n \"email\" : \"mohamedelsayed20258@gmail.com\",\n \"password\" : \"01093588197Mm!\"\n}\n\n</code></pre>\n<ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDQwMjZhYjJlMTE2NDQ3YmEzMDc4NiIsInJvbGUiOiJVc2VyIiwibmFtZSI6IlNhbG1hI\niwiZW1haWwiOiJzYWxtYUBnbWFpbC5jb20iLCJwaG9uZSI6IisyMDEwOTkxMDQ0MTAiLCJpYXQiOjE3NDE5NDg1NTgsImV4cCI6MTc0MTk1MjE1OH0.IdNXAM3AzbMaVCSjZ7uMq\nWW6Kn-Sm3bQVCn7UZVoq2U\"\n}\n\n</code></pre>\n<h2 id=\"user-profile\">User Profile</h2>\n<ul>\n<li><p>Endpoint: <code>GET /auth/profile</code></p>\n</li>\n<li><p>Description: Retrieves authenticated user details</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"_id\": \"67d4026ab2e116447ba30786\",\n    \"name\": \"Mohamed\",\n    \"email\": \"mohamedelsayed20258@gmail.com\",\n    \"password\": \"$2b$08$kryS4DjnQHIlKE/SaQM8o.BlQWEu6HHoA9Qq/dN2lw0sC4EvzwZsi\",\n    \"phone\": \"+201099104410\",\n    \"gender\": \"Female\",\n    \"role\": \"User\",\n    \"createdAt\": \"2025-03-14T10:18:18.599Z\",\n    \"updatedAt\": \"2025-03-14T10:18:18.599Z\",\n    \"__v\": 0\n}\n\n</code></pre>\n<h2 id=\"get-all-users\">Get All Users</h2>\n<ul>\n<li><p>Endpoint <code>GET /auth</code></p>\n</li>\n<li><p>Description: Retieves a list of all users. Admin access required.</p>\n</li>\n<li><p>Headers</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>authorization : Bearer &lt;admin_token&gt;\n\n</code></pre><ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n    {\n        \"gender\": \"Male\",\n        \"_id\": \"67cee6ceca3431c4da6f6f55\",\n        \"name\": \"mohamedelsayed@gmail.com\",\n        \"email\": \"sayed123@gmail.com2\",\n        \"password\": \"01093588197Mm!\",\n        \"phone\": \"01093588197\",\n        \"role\": \"User\",\n        \"createdAt\": \"2025-03-10T13:19:10.712Z\",\n        \"updatedAt\": \"2025-03-10T13:19:10.712Z\",\n        \"__v\": 0\n    },\n    {\n        \"gender\": \"Male\",\n        \"_id\": \"67cee7366bb2187bcaf280e5\",\n        \"name\": \"mohamedelsayed20258@gmail.com\",\n        \"email\": \"sayed12223@gmail.com2\",\n        \"password\": \"01093588197Mm!\",\n        \"phone\": \"01093588197\",\n        \"role\": \"User\",\n        \"createdAt\": \"2025-03-10T13:20:54.070Z\",\n        \"updatedAt\": \"2025-03-10T13:20:54.070Z\",\n        \"__v\": 0\n    },\n...\n]\n\n</code></pre>\n","_postman_id":"873bbd1b-bec1-4cbf-8f73-f325e37cd349"},{"name":"Products","item":[{"name":"Create Product","id":"1d14672d-9a3a-44d8-989c-7143c3f354d6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MjQwNjg1MCwiZXhwIjoxNzQyNDEwNDUwfQ.pvzl7PFz7B-IVpxcKS4HLucOCt67MIr9jhfm4InwU7E","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"price\": 100,\r\n  \"quantity\": 120,\r\n  \"details\": [\r\n    {\r\n      \"lang\": \"en\",\r\n      \"title\": \"Product 7\",\r\n      \"description\": \"A bobfd kdosd.\"\r\n    },\r\n    {\r\n      \"lang\": \"ar\",\r\n      \"title\": \"المنتج السابع\",\r\n      \"description\": \"باقة جميلة من الورود الحمراء.\"\r\n    }\r\n  ]\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//products/create","urlObject":{"path":["products","create"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"1d14672d-9a3a-44d8-989c-7143c3f354d6"},{"name":"Get All Products","id":"07aba91a-9a4d-4ca7-a0de-a639bae7f7f4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://postman-rest-api-learner.glitch.me//products/all?lang=ar","urlObject":{"path":["products","all"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[{"key":"lang","value":"ar"}],"variable":[]}},"response":[],"_postman_id":"07aba91a-9a4d-4ca7-a0de-a639bae7f7f4"},{"name":"Get Product by ID","id":"53e33e69-a53e-4aa8-8c5c-dc44eec61551","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://postman-rest-api-learner.glitch.me//products/get-single-product/67db07e04dfed299e8f229b9?lang=en","urlObject":{"path":["products","get-single-product","67db07e04dfed299e8f229b9"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[{"key":"lang","value":"en"}],"variable":[]}},"response":[],"_postman_id":"53e33e69-a53e-4aa8-8c5c-dc44eec61551"},{"name":"Update Product Stock","id":"d8a04b94-9461-4dfe-af9f-f853e37e9b6b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MTk1MjA4NSwiZXhwIjoxNzQxOTU1Njg1fQ.rAQbwSVpts7LYqlD_oWcZV_-wYjtOOvIZVZ3__FPYhw","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"price\" : \"2000\",\r\n    \"quantity\" : \"20\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//products/update-stock/67d9e886d4a05eb830ed9bf8","urlObject":{"path":["products","update-stock","67d9e886d4a05eb830ed9bf8"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"d8a04b94-9461-4dfe-af9f-f853e37e9b6b"},{"name":"Delete Product","id":"4c0d0285-02c4-43eb-b021-77b3911fba6b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MjMyNTQ0OSwiZXhwIjoxNzQyMzI5MDQ5fQ.DF4ww0VbAleZS0wsCJLqiDPfjKNf27gF7NUZGVXU-L4","type":"text"}],"url":"https://postman-rest-api-learner.glitch.me//products/67d9e886d4a05eb830ed9bf8","urlObject":{"path":["products","67d9e886d4a05eb830ed9bf8"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"4c0d0285-02c4-43eb-b021-77b3911fba6b"},{"name":"Add Image","id":"59a96601-fd0c-474c-b1c3-9d87ad361aaf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MjQwNjg1MCwiZXhwIjoxNzQyNDEwNDUwfQ.pvzl7PFz7B-IVpxcKS4HLucOCt67MIr9jhfm4InwU7E","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"image","type":"file","uuid":"31bdbe64-dacd-4cf4-888f-c862fca2465f","src":"/C:/Users/pc/OneDrive/Desktop/flowers-none-bg.png"}]},"url":"https://postman-rest-api-learner.glitch.me//products/update-image/67db07e04dfed299e8f229b9","urlObject":{"path":["products","update-image","67db07e04dfed299e8f229b9"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"59a96601-fd0c-474c-b1c3-9d87ad361aaf"},{"name":"Get Product by Slug","id":"01061a6a-fca5-4a8c-85a1-f6e86ea526a8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://postman-rest-api-learner.glitch.me//products/get-product-by-slug/المنتج-السادس?lang=ar","urlObject":{"path":["products","get-product-by-slug","المنتج-السادس"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[{"key":"lang","value":"ar"}],"variable":[]}},"response":[],"_postman_id":"01061a6a-fca5-4a8c-85a1-f6e86ea526a8"}],"id":"e60ceb08-8490-4381-9101-9160af8c8983","description":"<p>Products Routes Documentation</p>\n<h1 id=\"create-product\">Create Product</h1>\n<ol>\n<li><p>End Point POST <code>/products/create</code></p>\n</li>\n<li><p>Description: Create new product</p>\n</li>\n<li><p>Handling Error (Duplicate Product slug)</p>\n</li>\n</ol>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"price\": 100,\n  \"quantity\": 120,\n  \"category\" : \"show\"\n  \"details\": [\n    {\n      \"lang\": \"en\",\n      \"title\": \"Product 7\",\n      \"description\": \"A bobfd kdosd.\"\n    },\n    {\n      \"lang\": \"ar\",\n      \"title\": \"المنتج السابع\",\n      \"description\": \"باقة جميلة من الورود الحمراء.\"\n    }\n  ]\n}\n\n</code></pre>\n<ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"price\": 100,\n    \"quantity\": 120,\n    \"sold\": 0,\n    \"details\": [\n        {\n            \"_id\": \"6804e5dfa067dcf1fcd337e4\",\n            \"lang\": \"en\",\n            \"title\": \"Product 7\",\n            \"slug\": \"product-7\",\n            \"description\": \"A bobfd kdosd.\",\n            \"__v\": 0\n        },\n        {\n            \"_id\": \"6804e5e0a067dcf1fcd337e6\",\n            \"lang\": \"ar\",\n            \"title\": \"المنتج السابع\",\n            \"slug\": \"المنتج-السابع\",\n            \"description\": \"باقة جميلة من الورود الحمراء.\",\n            \"__v\": 0\n        }\n    ],\n    \"_id\": \"6804e5dfa067dcf1fcd337e3\",\n    \"createdAt\": \"2025-04-20T12:17:36.398Z\",\n    \"updatedAt\": \"2025-04-20T12:17:36.398Z\",\n    \"__v\": 0\n}\n\n</code></pre>\n<ul>\n<li>Error No Auth</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"message\": \"Invalid or expired token.\",\n    \"error\": \"Unauthorized\",\n    \"statusCode\": 401\n}\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"message\": \"A product detail with the slug \\\"product-7\\\" already exists.\",\n    \"error\": \"Bad Request\",\n    \"statusCode\": 400\n}\n\n</code></pre><h1 id=\"2-get-all-products\">2. Get All Products</h1>\n<p>a. End Point <code>GET /products/all?lang=en</code> or <code>GET /products/all?lang=ar</code></p>\n<p>b. Get all product available</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n    {\n        \"_id\": \"67dc62a600c3c20f18414641\",\n        \"price\": 100,\n        \"quantity\": 27,\n        \"sold\": 3,\n        \"details\": [\n            {\n                \"_id\": \"67dc62a600c3c20f18414644\",\n                \"lang\": \"ar\",\n                \"title\": \"التيجان والزينة\",\n                \"slug\": \"التيجان-والزينة\",\n                \"description\": \"ترمز التيجان والزينة إلى الأناقة والقوة والاحتفال. سواء كانت للملوك أو حفلات الزفاف أو المناسبات الخاصة، فهي تضيف الجمال والرونق. مصنوعة من الذهب أو الفضة أو الزهور، فإنها تعزز أي حدث بسحر خاص.\",\n                \"__v\": 0\n            }\n        ],\n        \"createdAt\": \"2025-03-20T18:47:02.898Z\",\n        \"updatedAt\": \"2025-04-12T17:49:03.596Z\",\n        \"__v\": 0,\n        \"image\": \"https://res.cloudinary.com/doa5lqxcu/image/upload/v1742496512/products/iued2cpax9bo5oxxqde1.png\",\n        \"imageId\": \"products/iued2cpax9bo5oxxqde1\",\n        \"category\": \"show\"\n    },\n    {\n        \"_id\": \"67dc63c100c3c20f18414652\",\n        \"price\": 200,\n        \"quantity\": 20,\n        \"sold\": 0,\n        \"details\": [\n            {\n                \"_id\": \"67dc63c100c3c20f18414655\",\n                \"lang\": \"ar\",\n                \"title\": \"الزهور الطازجة\",\n                \"slug\": \"الزهور-الطازجة\",\n                \"description\": \"تضيف الزهور الطازجة جمالًا طبيعيًا وعطرًا منعشًا إلى أي مكان. ترمز إلى الحب والفرح والبدايات الجديدة، مما يجعلها مثالية للهدايا والزينة والمناسبات الخاصة. بتلاتها الرقيقة وألوانها الزاهية تخلق أجواء منعشة وجذابة.\",\n                \"__v\": 0\n            }\n        ],\n        \"createdAt\": \"2025-03-20T18:51:45.551Z\",\n        \"updatedAt\": \"2025-03-20T18:52:22.723Z\",\n        \"__v\": 0,\n        \"image\": \"https://res.cloudinary.com/doa5lqxcu/image/upload/v1742496742/products/jmcukixfl3jwwym81f2c.png\",\n        \"imageId\": \"products/jmcukixfl3jwwym81f2c\",\n        \"category\": \"show\"\n    },\n]\n\n</code></pre>\n<h1 id=\"3-get-product-by-id\">3. Get Product by Id</h1>\n<ul>\n<li><p>End Point English Product <code>GET /products/get-single-product/:id?lang=en</code></p>\n</li>\n<li><p>End Point Arabic Product <code>GET /products/get-single-product/:id?lang=ar</code></p>\n</li>\n<li><p>Error Handling</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"_id\": \"6804ddc0a067dcf1fcd337b2\",\n    \"price\": 100,\n    \"quantity\": 120,\n    \"sold\": 0,\n    \"details\": [\n        {\n            \"_id\": \"6804ddc0a067dcf1fcd337b3\",\n            \"lang\": \"en\",\n            \"title\": \"Product 7\",\n            \"slug\": \"product-7\",\n            \"description\": \"A bobfd kdosd.\",\n            \"__v\": 0\n        }\n    ],\n    \"createdAt\": \"2025-04-20T11:42:57.143Z\",\n    \"updatedAt\": \"2025-04-20T11:42:57.143Z\",\n    \"__v\": 0\n}\n\n</code></pre>\n<ul>\n<li>Not Found</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Product not found for the given language.\",\n    \"error\": \"Bad Request\",\n    \"statusCode\": 400\n}\n\n</code></pre>\n<h1 id=\"4-update-product-stock\">4. Update Product Stock</h1>\n<ul>\n<li><p>End point <code>PATCH /products/update-stock/:productId`</code></p>\n</li>\n<li><p>Error Handling</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"price\" : 2000,\n    \"quantity\" : 20\n}\n\n</code></pre>\n<ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"_id\": \"6804ddc0a067dcf1fcd337b2\",\n    \"price\": 2000,\n    \"quantity\": 20\n,\n    \"sold\": 0,\n    \"details\": [\n        {\n            \"_id\": \"6804ddc0a067dcf1fcd337b3\",\n            \"lang\": \"en\",\n            \"title\": \"Product 7\",\n            \"slug\": \"product-7\",\n            \"description\": \"A bobfd kdosd.\",\n            \"__v\": 0\n        }\n    ],\n    \"createdAt\": \"2025-04-20T11:42:57.143Z\",\n    \"updatedAt\": \"2025-04-20T11:42:57.143Z\",\n    \"__v\": 0\n}\n\n</code></pre>\n<ul>\n<li>Error</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Product not found.\",\n    \"error\": \"Bad Request\",\n    \"statusCode\": 400\n}\n\n</code></pre>\n<h1 id=\"5-delete-product\">5. Delete Product</h1>\n<ul>\n<li><p>End Point <code>DELETE /products/:productId</code></p>\n</li>\n<li><p>Headers Authorization <code>Bearer ${token}</code></p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Product deleted successfully.\"\n}\n\n</code></pre>\n<ul>\n<li>Error</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Product not found.\",\n    \"error\": \"Bad Request\",\n    \"statusCode\": 400\n}\n\n</code></pre>\n<h1 id=\"5-add-image\">5. Add Image</h1>\n<ul>\n<li><p>End point <code>PUT /products/update-image/:productId</code></p>\n</li>\n<li><p>Headers Authorization <code>Bearer ${token}</code></p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n \"image\" : \"image.png\"\n}\n\n</code></pre>\n<ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">   {\n        \"_id\": \"67dc63c100c3c20f18414652\",\n        \"price\": 200,\n        \"quantity\": 20,\n        \"sold\": 0,\n        \"details\": [\n            {\n                \"_id\": \"67dc63c100c3c20f18414655\",\n                \"lang\": \"ar\",\n                \"title\": \"الزهور الطازجة\",\n                \"slug\": \"الزهور-الطازجة\",\n                \"description\": \"تضيف الزهور الطازجة جمالًا طبيعيًا وعطرًا منعشًا إلى أي مكان. ترمز إلى الحب والفرح والبدايات الجديدة، مما يجعلها مثالية للهدايا والزينة والمناسبات الخاصة. بتلاتها الرقيقة وألوانها الزاهية تخلق أجواء منعشة وجذابة.\",\n                \"__v\": 0\n            }\n        ],\n        \"createdAt\": \"2025-03-20T18:51:45.551Z\",\n        \"updatedAt\": \"2025-03-20T18:52:22.723Z\",\n        \"__v\": 0,\n        \"image\": \"https://res.cloudinary.com/doa5lqxcu/image/upload/v1742496742/products/jmcukixfl3jwwym81f2c.png\",\n        \"imageId\": \"products/jmcukixfl3jwwym81f2c\",\n        \"category\": \"show\"\n    },\n\n</code></pre>\n<h1 id=\"6-get-product-by-slug\">6. Get Product by Slug</h1>\n<ul>\n<li><p>End Point Arabic <code>GET /products/get-product-by-slug/التيجان-والزينه?lang=ar</code></p>\n</li>\n<li><p>End Point English <code>GET /products/get-product-by-slug/crowns-and-decoration?lang=en</code></p>\n</li>\n<li><p>Error Handling</p>\n</li>\n<li><p>Response</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"_id\": \"67dc62a600c3c20f18414641\",\n    \"price\": 100,\n    \"quantity\": 27,\n    \"sold\": 3,\n    \"details\": [\n        {\n            \"_id\": \"67dc62a600c3c20f18414642\",\n            \"lang\": \"en\",\n            \"title\": \"Crowns and Decoration\",\n            \"slug\": \"crowns-and-decoration\",\n            \"description\": \"Crowns and decorations symbolize elegance, power, and celebration. Whether for royalty, weddings, or special occasions, they add beauty and prestige. Crafted from gold, silver, or flowers, they enhance any event with charm.\",\n            \"__v\": 0\n        }\n    ],\n    \"createdAt\": \"2025-03-20T18:47:02.898Z\",\n    \"updatedAt\": \"2025-04-12T17:49:03.596Z\",\n    \"__v\": 0,\n    \"image\": \"https://res.cloudinary.com/doa5lqxcu/image/upload/v1742496512/products/iued2cpax9bo5oxxqde1.png\",\n    \"imageId\": \"products/iued2cpax9bo5oxxqde1\",\n    \"category\": \"show\"\n}\n\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"_id\": \"67dc62a600c3c20f18414641\",\n    \"price\": 100,\n    \"quantity\": 27,\n    \"sold\": 3,\n    \"details\": [\n        {\n            \"_id\": \"67dc62a600c3c20f18414644\",\n            \"lang\": \"ar\",\n            \"title\": \"التيجان والزينة\",\n            \"slug\": \"التيجان-والزينة\",\n            \"description\": \"ترمز التيجان والزينة إلى الأناقة والقوة والاحتفال. سواء كانت للملوك أو حفلات الزفاف أو المناسبات الخاصة، فهي تضيف الجمال والرونق. مصنوعة من الذهب أو الفضة أو الزهور، فإنها تعزز أي حدث بسحر خاص.\",\n            \"__v\": 0\n        }\n    ],\n    \"createdAt\": \"2025-03-20T18:47:02.898Z\",\n    \"updatedAt\": \"2025-04-12T17:49:03.596Z\",\n    \"__v\": 0,\n    \"image\": \"https://res.cloudinary.com/doa5lqxcu/image/upload/v1742496512/products/iued2cpax9bo5oxxqde1.png\",\n    \"imageId\": \"products/iued2cpax9bo5oxxqde1\",\n    \"category\": \"show\"\n}\n\n</code></pre>\n<ul>\n<li>Error</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Product with this slug not found.\",\n    \"error\": \"Bad Request\",\n    \"statusCode\": 400\n}\n\n</code></pre>\n","_postman_id":"e60ceb08-8490-4381-9101-9160af8c8983"},{"name":"Cart","item":[{"name":"Create Cart","id":"861c8cf1-040a-4952-a395-2a868b9a50f5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MjM0MTExMSwiZXhwIjoxNzQyMzQ0NzExfQ.2OoVffkLO1Sc8x27ylUA2F-shgpKWRlLE4gLgNO1DcA","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"userId\" : \"67d1d7f0e32b4a36143aee61\",\r\n    \"quantity\" : 20\r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//cart/add/67d9e886d4a05eb830ed9bf8","urlObject":{"path":["cart","add","67d9e886d4a05eb830ed9bf8"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"861c8cf1-040a-4952-a395-2a868b9a50f5"},{"name":"Get User Cart","id":"2dc88d6e-40a4-43e4-b8ab-77b1325a47d4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MjI1MDE3MywiZXhwIjoxNzQyMjUzNzczfQ.86kVCUI0t2AHlZOVfoCTV8Uz5f7L3-QeSOu3cY91byM","type":"text"}],"url":"https://postman-rest-api-learner.glitch.me//cart/67d16926493b7f14e76052d9","urlObject":{"path":["cart","67d16926493b7f14e76052d9"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"2dc88d6e-40a4-43e4-b8ab-77b1325a47d4"},{"name":"Remove From Cart","id":"721739d1-fd4e-4842-80ea-b8fb4f3df2ad","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MTk1MjA4NSwiZXhwIjoxNzQxOTU1Njg1fQ.rAQbwSVpts7LYqlD_oWcZV_-wYjtOOvIZVZ3__FPYhw","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//cart/remove/67d17a2af0666a0c8a9d66c5","urlObject":{"path":["cart","remove","67d17a2af0666a0c8a9d66c5"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"721739d1-fd4e-4842-80ea-b8fb4f3df2ad"},{"name":"Update Quantity","id":"632ed5ae-5841-49c2-8e8b-35bfeebd8dca","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MTk1MjA4NSwiZXhwIjoxNzQxOTU1Njg1fQ.rAQbwSVpts7LYqlD_oWcZV_-wYjtOOvIZVZ3__FPYhw","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"quantity\" : 17\r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//cart/update/67d414bcf6f0ad0963b2e124","urlObject":{"path":["cart","update","67d414bcf6f0ad0963b2e124"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"632ed5ae-5841-49c2-8e8b-35bfeebd8dca"},{"name":"Clear Cart","id":"6928f031-1a85-49f9-88fe-62274403d282","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MTk1MjA4NSwiZXhwIjoxNzQxOTU1Njg1fQ.rAQbwSVpts7LYqlD_oWcZV_-wYjtOOvIZVZ3__FPYhw","type":"text"}],"url":"https://postman-rest-api-learner.glitch.me//cart/remove","urlObject":{"path":["cart","remove"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"6928f031-1a85-49f9-88fe-62274403d282"}],"id":"f95db66b-30dd-4b4c-ab00-11e0aa1daa5d","description":"<p>Cart Routes Documentation</p>\n<h1 id=\"create-cart\">Create Cart</h1>\n<ul>\n<li><p>End Point <code>POST /cart/add/:productId`</code></p>\n</li>\n<li><p>Handling Error</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"userId\" : \"67d1d7f0e32b4a36143aee61\",\n    \"quantity\" : 20\n}\n\n</code></pre>\n<ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"user\": \"67dc62a600c3c20f18414641\",\n    \"cartItems\": [\n        {\n            \"product\": {\n                \"_id\": \"67e060fb32cb09754ae30d3c\",\n                \"price\": 10,\n                \"quantity\": 1,\n                \"sold\": 1,\n                \"details\": [\n                    \"67e060fb32cb09754ae30d3d\",\n                    \"67e060fb32cb09754ae30d3f\"\n                ],\n                \"createdAt\": \"2025-03-23T19:29:00.249Z\",\n                \"updatedAt\": \"2025-04-14T13:11:39.215Z\",\n                \"__v\": 0,\n                \"image\": \"https://res.cloudinary.com/doa5lqxcu/image/upload/v1742758179/products/f9k0wsgxlowleuehxfvg.png\",\n                \"imageId\": \"products/f9k0wsgxlowleuehxfvg\",\n                \"category\": \"home\",\n                \"id\": \"67e060fb32cb09754ae30d3c\"\n            },\n            \"quantity\": 1,\n            \"price\": 10,\n            \"_id\": \"680649752d7c7fd17007d28d\",\n            \"id\": \"680649752d7c7fd17007d28d\"\n        }\n    ],\n    \"totalPrice\": 10,\n    \"totalPriceDiscount\": 0,\n    \"_id\": \"680649752d7c7fd17007d28c\",\n    \"createdAt\": \"2025-04-21T13:34:45.118Z\",\n    \"updatedAt\": \"2025-04-21T13:34:45.118Z\",\n    \"__v\": 0,\n    \"id\": \"680649752d7c7fd17007d28c\"\n}\n\n</code></pre>\n<ul>\n<li>Exceed the number of product in stock</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"we don't have all this quantity\",\n    \"error\": \"Bad Request\",\n    \"statusCode\": 400\n}\n\n</code></pre>\n<ul>\n<li>Product not found</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Product not found\",\n    \"error\": \"Not Found\",\n    \"statusCode\": 404\n}\n\n</code></pre>\n<h1 id=\"get-user-cart\">Get User Cart</h1>\n<ul>\n<li><p>End Point <code>/cart/:userId</code></p>\n</li>\n<li><p>Error Handling</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Cart found\",\n    \"cartItems\": [\n        {\n            \"product\": {\n                \"_id\": \"67e060fb32cb09754ae30d3c\",\n                \"price\": 10,\n                \"quantity\": 1,\n                \"sold\": 1,\n                \"details\": [\n                    {\n                        \"_id\": \"67e060fb32cb09754ae30d3d\",\n                        \"lang\": \"en\",\n                        \"title\": \"White Clouds\",\n                        \"slug\": \"white-clouds\",\n                        \"description\": \"Soft, floating clouds that bring a sense of peace and serenity.\",\n                        \"__v\": 0\n                    }\n                ],\n                \"createdAt\": \"2025-03-23T19:29:00.249Z\",\n                \"updatedAt\": \"2025-04-14T13:11:39.215Z\",\n                \"__v\": 0,\n                \"image\": \"https://res.cloudinary.com/doa5lqxcu/image/upload/v1742758179/products/f9k0wsgxlowleuehxfvg.png\",\n                \"imageId\": \"products/f9k0wsgxlowleuehxfvg\",\n                \"category\": \"home\",\n                \"id\": \"67e060fb32cb09754ae30d3c\"\n            },\n            \"quantity\": 1,\n            \"price\": 10,\n            \"_id\": \"680649752d7c7fd17007d28d\",\n            \"id\": \"680649752d7c7fd17007d28d\"\n        }\n    ],\n    \"totalPrice\": 10,\n    \"totalPriceDiscount\": 0,\n    \"id\": \"680649752d7c7fd17007d28c\"\n}\n\n</code></pre>\n<ul>\n<li>Cart Empty</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Cart not found\",\n    \"cartItems\": [],\n    \"totalPrice\": 0,\n    \"totalPriceDiscount\": 0,\n    \"id\": null\n}\n\n</code></pre>\n<h1 id=\"remove-from-cart\">Remove from Cart</h1>\n<ul>\n<li><p>End Point <code>PUT /cart/update/:productId</code></p>\n</li>\n<li><p>Error Handling</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"product removed from cart\"\n}\n\n</code></pre>\n<ul>\n<li>Product Not Found</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Product not found in cart\",\n    \"error\": \"Not Found\",\n    \"statusCode\": 404\n}\n\n</code></pre>\n<h1 id=\"update-quantity\">Update Quantity</h1>\n<ul>\n<li><p>End Point <code>PUT /cart/update/:productId</code></p>\n</li>\n<li><p>Error handling</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"_id\": \"6801a60e191a8d44fdb1d3be\",\n    \"user\": \"67d1d7f0e32b4a36143aee61\",\n    \"cartItems\": [\n        {\n            \"product\": {\n                \"_id\": \"67e0730c123daa97329bd3c3\",\n                \"price\": 240,\n                \"quantity\": 6,\n                \"sold\": 0,\n                \"details\": [\n                    \"67e0730c123daa97329bd3c4\",\n                    \"67e0730c123daa97329bd3c6\"\n                ],\n                \"createdAt\": \"2025-03-23T20:46:05.236Z\",\n                \"updatedAt\": \"2025-03-23T20:46:33.307Z\",\n                \"__v\": 0,\n                \"image\": \"https://res.cloudinary.com/doa5lqxcu/image/upload/v1742762792/products/ojmsliawlt3n71gq3wxu.png\",\n                \"imageId\": \"products/ojmsliawlt3n71gq3wxu\",\n                \"category\": \"weddings\",\n                \"id\": \"67e0730c123daa97329bd3c3\"\n            },\n            \"quantity\": 2,\n            \"price\": 480,\n            \"_id\": \"68026f18269195e708a295ca\",\n            \"id\": \"68026f18269195e708a295ca\"\n        },\n            ],\n    \"totalPrice\": 1058,\n    \"totalPriceDiscount\": 0,\n    \"createdAt\": \"2025-04-18T01:08:30.814Z\",\n    \"updatedAt\": \"2025-04-21T13:50:16.121Z\",\n    \"__v\": 6,\n    \"id\": \"6801a60e191a8d44fdb1d3be\"\n\n</code></pre>\n<ul>\n<li>If exceed the number of products in stock</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Exceeded stock. Only 6 available.\",\n    \"error\": \"Bad Request\",\n    \"statusCode\": 400\n}\n\n</code></pre>\n<ul>\n<li>Not found</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Product not found in cart\",\n    \"error\": \"Not Found\",\n    \"statusCode\": 404\n}\n\n</code></pre>\n<h1 id=\"clear-cart\">Clear Cart</h1>\n<ul>\n<li>End Point <code>DELETE /cart/remove</code></li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"_id\": \"6801a60e191a8d44fdb1d3be\",\n    \"user\": \"67d1d7f0e32b4a36143aee61\",\n    \"cartItems\": [],\n    \"totalPrice\": 0,\n    \"totalPriceDiscount\": 0,\n    \"createdAt\": \"2025-04-18T01:08:30.814Z\",\n    \"updatedAt\": \"2025-04-21T13:54:36.353Z\",\n    \"__v\": 7,\n    \"id\": \"6801a60e191a8d44fdb1d3be\"\n}\n\n</code></pre>\n","_postman_id":"f95db66b-30dd-4b4c-ab00-11e0aa1daa5d"},{"name":"Order","item":[{"name":"Create Order","id":"56a8d74b-06f7-49c8-9c2e-798be812fd1d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MjM0MTExMSwiZXhwIjoxNzQyMzQ0NzExfQ.2OoVffkLO1Sc8x27ylUA2F-shgpKWRlLE4gLgNO1DcA","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"street\" : \"30th Street\",\r\n    \"city\" : \"Alexandria\",\r\n    \"phone\" : \"01093588197\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//order/add","urlObject":{"path":["order","add"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"56a8d74b-06f7-49c8-9c2e-798be812fd1d"},{"name":"Get All Orders","id":"dbaff19a-2ae8-4c0d-a662-ffc76dc3ab61","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbW1hZCBFbC1zYXllZCIsImVtYWlsIjoibW9oYW1lZGVsc2F5ZWQyMDI1OEBnbWFpbC5jb20iLCJwaG9uZSI6IisyMDEwOTM1ODgxOTciLCJpYXQiOjE3NDUwODEwMDYsImV4cCI6MTc0NTA4NDYwNn0.63_NiZzQQvoXHEuXUAO_xsndFR67FJ_Ghw7yEytDCvw","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//order?page=3&limit=2","urlObject":{"path":["order"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[{"key":"page","value":"3"},{"key":"limit","value":"2"}],"variable":[]}},"response":[],"_postman_id":"dbaff19a-2ae8-4c0d-a662-ffc76dc3ab61"},{"name":"User Order","id":"837ef7bb-2b71-40c6-9d24-334f0e589fca","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MjI4OTg1MCwiZXhwIjoxNzQyMjkzNDUwfQ.slkLmK_JIwviI0KkNA6MqiRorNoAyAtHlydBxIoaJ6g","type":"text"}],"url":"https://postman-rest-api-learner.glitch.me//order/my-orders","urlObject":{"path":["order","my-orders"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"837ef7bb-2b71-40c6-9d24-334f0e589fca"},{"name":"Get Single Order","id":"5ff96366-a6cb-44cc-bb95-44ac83aec4b1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MjI4OTg1MCwiZXhwIjoxNzQyMjkzNDUwfQ.slkLmK_JIwviI0KkNA6MqiRorNoAyAtHlydBxIoaJ6g","type":"text"}],"url":"https://postman-rest-api-learner.glitch.me//order/67d33d3822c03408b6669134","urlObject":{"path":["order","67d33d3822c03408b6669134"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"5ff96366-a6cb-44cc-bb95-44ac83aec4b1"},{"name":"Order Status","id":"d8f591d5-bc92-44d8-83e2-e02047d43237","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MTk1NjQyNywiZXhwIjoxNzQxOTYwMDI3fQ.8zI9JOyti4sErK3GKu_1H_hrBBcODje-6O0cC7MSWfQ","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"isDelivered\" : true\r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//order/order-status/67d42316c6c87f1b1e40c8b5","urlObject":{"path":["order","order-status","67d42316c6c87f1b1e40c8b5"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"d8f591d5-bc92-44d8-83e2-e02047d43237"},{"name":"Make order Paid","id":"4fcb5ac5-17f4-493d-b67b-94fd64b7b509","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MTk1NjQyNywiZXhwIjoxNzQxOTYwMDI3fQ.8zI9JOyti4sErK3GKu_1H_hrBBcODje-6O0cC7MSWfQ","type":"text"}],"url":"https://postman-rest-api-learner.glitch.me//order/make-order-paid/67d42316c6c87f1b1e40c8b5","urlObject":{"path":["order","make-order-paid","67d42316c6c87f1b1e40c8b5"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"4fcb5ac5-17f4-493d-b67b-94fd64b7b509"},{"name":"Cancel Order","id":"d39b797d-3c45-4656-acfd-4f73fc2ed7e2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MTk1ODYzNCwiZXhwIjoxNzQxOTYyMjM0fQ.Rr6Uy9wsLVrcn2flYju5WCznlLPHAt7Lth3XWbMYPgU","type":"text"}],"url":"https://postman-rest-api-learner.glitch.me//order/cancel/67d42316c6c87f1b1e40c8b5","urlObject":{"path":["order","cancel","67d42316c6c87f1b1e40c8b5"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"d39b797d-3c45-4656-acfd-4f73fc2ed7e2"},{"name":"Delete Order","id":"b775bf7a-7af4-4e17-a959-81322fceeb2f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MTk1ODYzNCwiZXhwIjoxNzQxOTYyMjM0fQ.Rr6Uy9wsLVrcn2flYju5WCznlLPHAt7Lth3XWbMYPgU","type":"text"}],"url":"https://postman-rest-api-learner.glitch.me//order/delete/67d42316c6c87f1b1e40c8b5?=","urlObject":{"path":["order","delete","67d42316c6c87f1b1e40c8b5"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[{"key":"","value":""}],"variable":[]}},"response":[],"_postman_id":"b775bf7a-7af4-4e17-a959-81322fceeb2f"},{"name":"Order Stripe","id":"7e9f547c-9a56-4e6b-b133-99543d5669ca","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiLZhdit2YXYryDYp9mE2LPZitivIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0NDkxMjIyMCwiZXhwIjoxNzQ0OTE1ODIwfQ.xqDhkAumz-_mziEJxHciIU4KiPSX0ridIRPHSn-ejec","type":"text"}],"url":"https://postman-rest-api-learner.glitch.me//order/add-stripe","urlObject":{"path":["order","add-stripe"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"7e9f547c-9a56-4e6b-b133-99543d5669ca"}],"id":"4be557d9-ef04-4743-b636-9b9fd70a5ceb","description":"<p>Order Routes Documentation</p>\n<h1 id=\"create-order--cash\">Create Order ( Cash)</h1>\n<ul>\n<li><p>End Point <code>POST /order/add</code></p>\n</li>\n<li><p>Error handling</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"street\" : \"30th Street\",\n    \"city\" : \"Alexandria\",\n    \"phone\" : \"01093588197\"\n}\n\n</code></pre>\n<ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"user\": \"67d1d7f0e32b4a36143aee61\",\n    \"cartItems\": [],\n    \"totalOrderPrice\": 0,\n    \"shippingAddress\": {\n        \"street\": \"30th Street\",\n        \"city\": \"Alexandria\",\n        \"phone\": \"01093588197\",\n        \"_id\": \"680655d578a683cb6ccd921c\",\n        \"id\": \"680655d578a683cb6ccd921c\"\n    },\n    \"paymentMethod\": \"Cash\",\n    \"isPaid\": false,\n    \"paymentStatus\": \"pending\",\n    \"isDelivered\": false,\n    \"_id\": \"680655d578a683cb6ccd921b\",\n    \"createdAt\": \"2025-04-21T14:27:33.457Z\",\n    \"updatedAt\": \"2025-04-21T14:27:33.457Z\",\n    \"__v\": 0,\n    \"id\": \"680655d578a683cb6ccd921b\"\n}\n\n</code></pre>\n<ul>\n<li>Error</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Cart not found\",\n    \"error\": \"Not Found\",\n    \"statusCode\": 404\n}\n\n</code></pre>\n<h1 id=\"order-stripe\">Order Stripe</h1>\n<ul>\n<li><p>End Point <code>order/add-stripe</code></p>\n</li>\n<li><p>Error handling</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"url\": \"https://checkout.stripe.com/c/pay/cs_test_a1uFYoSHcDapkAybpcoqmEsSRUiUNFsktCOhyi7TeCiKnhYjMl7CE1E8KQ#fidkdWxOYHwnPyd1blpxYHZxWjA0V0ZtT3BHU0ddQTA2cGBfQmRLd0dXSXBGPXxkdU1VfEdiY2k0cTFKXUdWdHJhMUZMYlZGPXVdYkN/MXZWQ3Q9fGpzbkxvUjdsM3V/Uk1cU2t0cF9JXXUyNTVsXEhkSUFAfScpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic/cXdwYHgl\"\n}\n\n</code></pre>\n<ul>\n<li>Empty Cart</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Cart not found or empty\",\n    \"error\": \"Not Found\",\n    \"statusCode\": 404\n}\n\n</code></pre>\n<h1 id=\"get-all-orders-admin\">Get All Orders (Admin)</h1>\n<ul>\n<li><p>End Point <code>/order?page=1&amp;limit=10</code></p>\n</li>\n<li><p>Error handling</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"data\": [\n        {\n            \"_id\": \"67d42316c6c87f1b1e40c8b5\",\n            \"user\": {\n                \"_id\": \"67d1d7f0e32b4a36143aee61\",\n                \"name\": \"Mohammad El-sayed\",\n                \"email\": \"mohamedelsayed20258@gmail.com\"\n            },\n            \"cartItems\": [\n                {\n                    \"product\": null,\n                    \"quantity\": 7,\n                    \"price\": 1400,\n                    \"_id\": \"67d42128c6c87f1b1e40c8aa\",\n                    \"id\": \"67d42128c6c87f1b1e40c8aa\"\n                }\n            ],\n            \"totalOrderPrice\": 1400,\n            \"shippingAddress\": {\n                \"street\": \"30th Street\",\n                \"city\": \"Alexandria\",\n                \"phone\": \"01093588197\",\n                \"_id\": \"67d42316c6c87f1b1e40c8b7\",\n                \"id\": \"67d42316c6c87f1b1e40c8b7\"\n            },\n            \"paymentMethod\": \"Cash\",\n            \"isPaid\": true,\n            \"paymentStatus\": \"pending\",\n            \"isDelivered\": true,\n            \"createdAt\": \"2025-03-14T12:37:42.577Z\",\n            \"updatedAt\": \"2025-03-14T13:34:11.951Z\",\n            \"__v\": 0,\n            \"deliveredAt\": \"2025-03-14T13:34:11.937Z\",\n            \"paidAt\": \"2025-03-14T13:19:06.601Z\",\n            \"id\": \"67d42316c6c87f1b1e40c8b5\"\n        }\n    ],\n    \"total\": 27,\n    \"page\": 3,\n    \"totalPages\": 27\n}\n\n</code></pre>\n<h1 id=\"user-order\">User Order</h1>\n<ul>\n<li>End Point <code>GET /order/my-orders</code></li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n    {\n        \"paymentStatus\": \"pending\",\n        \"_id\": \"67d33d3822c03408b6669134\",\n        \"user\": \"67d1d7f0e32b4a36143aee61\",\n        \"cartItems\": [\n            {\n                \"product\": null,\n                \"quantity\": 4,\n                \"price\": 4,\n                \"_id\": \"67d1e8a722e3df06f255f4c7\",\n                \"id\": \"67d1e8a722e3df06f255f4c7\"\n            }\n        ],\n        \"totalOrderPrice\": 4,\n        \"shippingAddress\": {\n            \"street\": \"Mohrem Bek\",\n            \"city\": \"Alexandria\",\n            \"phone\": \"01093588197\",\n            \"_id\": \"67d33d3822c03408b6669136\",\n            \"id\": \"67d33d3822c03408b6669136\"\n        },\n        \"paymentMethod\": \"Cash\",\n        \"isPaid\": true,\n        \"isDelivered\": true,\n        \"createdAt\": \"2025-03-13T20:16:56.789Z\",\n        \"updatedAt\": \"2025-04-14T23:03:27.979Z\",\n        \"__v\": 0,\n        \"paidAt\": \"2025-03-13T21:45:02.592Z\",\n        \"deliveredAt\": \"2025-04-14T23:03:27.978Z\",\n        \"id\": \"67d33d3822c03408b6669134\"\n    }, ....\n]\n}\n\n</code></pre>\n<h1 id=\"get-single-order\">Get Single Order</h1>\n<ul>\n<li><p>End Point <code>/order/:cartId</code></p>\n</li>\n<li><p>Error handling</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"paymentStatus\": \"pending\",\n    \"_id\": \"67d33d3822c03408b6669134\",\n    \"user\": {\n        \"_id\": \"67d1d7f0e32b4a36143aee61\",\n        \"name\": \"Mohammad El-sayed\",\n        \"email\": \"mohamedelsayed20258@gmail.com\"\n    },\n    \"cartItems\": [\n        {\n            \"product\": null,\n            \"quantity\": 4,\n            \"price\": 4,\n            \"_id\": \"67d1e8a722e3df06f255f4c7\",\n            \"id\": \"67d1e8a722e3df06f255f4c7\"\n        }\n    ],\n    \"totalOrderPrice\": 4,\n    \"shippingAddress\": {\n        \"street\": \"Mohrem Bek\",\n        \"city\": \"Alexandria\",\n        \"phone\": \"01093588197\",\n        \"_id\": \"67d33d3822c03408b6669136\",\n        \"id\": \"67d33d3822c03408b6669136\"\n    },\n    \"paymentMethod\": \"Cash\",\n    \"isPaid\": true,\n    \"isDelivered\": true,\n    \"createdAt\": \"2025-03-13T20:16:56.789Z\",\n    \"updatedAt\": \"2025-04-14T23:03:27.979Z\",\n    \"__v\": 0,\n    \"paidAt\": \"2025-03-13T21:45:02.592Z\",\n    \"deliveredAt\": \"2025-04-14T23:03:27.978Z\",\n    \"id\": \"67d33d3822c03408b6669134\"\n}\n\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Order not found\",\n    \"error\": \"Bad Request\",\n    \"statusCode\": 400\n}\n\n</code></pre>\n<h1 id=\"order-status-admin\">Order Status (Admin)</h1>\n<ul>\n<li><p>End Point <code>PUT /order/order-status/:cartId</code></p>\n</li>\n<li><p>to change the status of the order by admin</p>\n</li>\n<li><p>Error handling</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"isDelivered\" : true\n}\n\n</code></pre>\n<ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"paymentStatus\": \"pending\",\n    \"_id\": \"67d350850e052d03448afc74\",\n    \"user\": \"67d1d7f0e32b4a36143aee61\",\n    \"cartItems\": [\n        {\n            \"product\": \"67d17a2af0666a0c8a9d66c5\",\n            \"quantity\": 2,\n            \"price\": 2,\n            \"_id\": \"67d350470e052d03448afc6e\",\n            \"id\": \"67d350470e052d03448afc6e\"\n        }\n    ],\n    \"totalOrderPrice\": 2,\n    \"shippingAddress\": {\n        \"street\": \"ds\",\n        \"city\": \"Alex\",\n        \"phone\": \"01093588197\",\n        \"_id\": \"67d350850e052d03448afc76\",\n        \"id\": \"67d350850e052d03448afc76\"\n    },\n    \"paymentMethod\": \"Cash\",\n    \"isPaid\": false,\n    \"isDelivered\": true,\n    \"createdAt\": \"2025-03-13T21:39:17.226Z\",\n    \"updatedAt\": \"2025-04-21T14:35:56.612Z\",\n    \"__v\": 0,\n    \"deliveredAt\": \"2025-04-21T14:35:56.611Z\",\n    \"id\": \"67d350850e052d03448afc74\"\n}\n\n</code></pre>\n<h1 id=\"make-order-paid\">Make order Paid</h1>\n<ul>\n<li><p>End Pont <code>PUT /order/make-order-paid/:cartId</code></p>\n</li>\n<li><p>to make the order paid to true by admin only</p>\n</li>\n<li><p>Error handling</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>In Headers \nauthorization : Bearer &lt;token&gt;\n\n</code></pre>","_postman_id":"4be557d9-ef04-4743-b636-9b9fd70a5ceb"},{"name":"User","item":[{"name":"Forgot Password","id":"20abcef4-c3a4-4e73-a217-a57f714871fa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\" : \"mohamedelsayed20258@gmail.com\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//users/forgot-password","urlObject":{"path":["users","forgot-password"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"20abcef4-c3a4-4e73-a217-a57f714871fa"},{"name":"Verify Code","id":"a9903b4a-7e89-4072-8fea-ffe014a11797","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\" : \"mohamedelsayed20258@gmail.com\",\r\n    \"code\" : \"712585\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//users/verify-code","urlObject":{"path":["users","verify-code"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"a9903b4a-7e89-4072-8fea-ffe014a11797"},{"name":"Complete Change Password","id":"825a2945-309f-4da0-ab3f-ee18f4df052f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\" : \"mohamedelsayed20258@gmail.com\",\r\n    \"newPassword\" : \"01093588197Mm!\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//users/forgot-password-complete","urlObject":{"path":["users","forgot-password-complete"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"825a2945-309f-4da0-ab3f-ee18f4df052f"},{"name":"Update User","id":"e15cd9cb-a962-49cd-9a87-ff332f25c008","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MTk0ODA0MCwiZXhwIjoxNzQxOTUxNjQwfQ.gK7NB0KhRyoHTjAdyoKdBtZb8hdgPvds_-9THx0gRDk","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"name\" : \"Salma Updated 2\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//users/67d4026ab2e116447ba30786","urlObject":{"path":["users","67d4026ab2e116447ba30786"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"e15cd9cb-a962-49cd-9a87-ff332f25c008"},{"name":"Delete User","id":"c4c2a4a2-7d05-47e3-b7c6-361f675d2a55","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbWVkIiwiZW1haWwiOiJtb2hhbWVkZWxzYXllZDIwMjU4QGdtYWlsLmNvbSIsInBob25lIjoiKzIwMTA5MzU4ODE5NyIsImlhdCI6MTc0MTk0ODA0MCwiZXhwIjoxNzQxOTUxNjQwfQ.gK7NB0KhRyoHTjAdyoKdBtZb8hdgPvds_-9THx0gRDk","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//users/67cef165589c52f07b82470a","urlObject":{"path":["users","67cef165589c52f07b82470a"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"c4c2a4a2-7d05-47e3-b7c6-361f675d2a55"},{"name":"Admin Stats","id":"0a975d90-271d-453c-980a-eb7b2d1e4c79","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDFkN2YwZTMyYjRhMzYxNDNhZWU2MSIsInJvbGUiOiJBZG1pbiIsIm5hbWUiOiJNb2hhbW1hZCBFbC1zYXllZCIsImVtYWlsIjoibW9oYW1lZGVsc2F5ZWQyMDI1OEBnbWFpbC5jb20iLCJwaG9uZSI6IisyMDEwOTM1ODgxOTciLCJpYXQiOjE3NDU5NDU2OTksImV4cCI6MTc0NTk0OTI5OX0.8j7fmNBv0MLRsAh9euqrPqdUPh3dGBCyEovuiiAXtyY","type":"text"}],"url":"https://postman-rest-api-learner.glitch.me//users/admin-stats","urlObject":{"path":["users","admin-stats"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"0a975d90-271d-453c-980a-eb7b2d1e4c79"},{"name":"Chart Data","id":"f7a7bf19-d0f9-423a-ae2b-153345150a70","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"f7a7bf19-d0f9-423a-ae2b-153345150a70"}],"id":"ff467b04-f420-4b0c-a9b5-4a1a1aa2e435","description":"<h2 id=\"forgot-password\">Forgot Password</h2>\n<ul>\n<li><p>End Point POST <code>users/forgot-password</code></p>\n</li>\n<li><p>Handling Error</p>\n</li>\n</ul>\n<p>Request</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"email\": \"mohamedelsayed20258@gmail.com\"\n}\n\n</code></pre>\n<ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Verification code send to your email\"\n}\n\n</code></pre>\n<ul>\n<li>Error</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Email not found\",\n    \"error\": \"Not Found\",\n    \"statusCode\": 404\n}\n\n</code></pre>\n<h2 id=\"verify-code\">Verify code</h2>\n<ul>\n<li><p>End Point POST <code>users/verify-code</code></p>\n</li>\n<li><p>Handling Error</p>\n</li>\n<li><p>Request</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"email\" : \"mohamedelsayed20258@gmail.com\",\n    \"code\" : \"732983\"\n}\n\n</code></pre>\n<ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Verification successful. You can now reset your password.\"\n}\n\n</code></pre>\n<ul>\n<li>Handling Error and after 30 minutes if code not used will throw an error.</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Invalid verification code\",\n    \"error\": \"Bad Request\",\n    \"statusCode\": 400\n}\n\n</code></pre>\n<h2 id=\"complete-change-password\">Complete Change Password</h2>\n<ul>\n<li><p>End Point PUT <code>users/forgot-password-complete</code></p>\n</li>\n<li><p>Handling Error</p>\n</li>\n<li><p>Request</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"email\" : \"mohamedelsayed20258@gmail.com\",\n    \"newPassword\" : \"01093588197Mm!!\"\n}\n\n</code></pre>\n<ul>\n<li>Response</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Password changed successfully\"\n}\n\n</code></pre>\n<ul>\n<li>Handling Error + I check if the user verified the code or not. so user can't skip step 2. MUST pass the code first and then change the password.</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Email not found\",\n    \"error\": \"Not Found\",\n    \"statusCode\": 404\n}\n\n</code></pre>\n","_postman_id":"ff467b04-f420-4b0c-a9b5-4a1a1aa2e435"},{"name":"Payment","item":[{"name":"Create Payment Intent","id":"ae454ead-c54f-4771-880a-ed4e6cc8268f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://postman-rest-api-learner.glitch.me//payments/create-payment-intent/67d33d3822c03408b6669134","urlObject":{"path":["payments","create-payment-intent","67d33d3822c03408b6669134"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"ae454ead-c54f-4771-880a-ed4e6cc8268f"},{"name":"Confirm Payment","id":"cf7093fc-1abd-46c1-8785-98e7d240bee6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"paymentIntentId\" : \"pi_3R3wRRBGW5nGUVos0VEB4ohX\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-rest-api-learner.glitch.me//payments/confirm-payment/67d33d3822c03408b6669134","urlObject":{"path":["payments","confirm-payment","67d33d3822c03408b6669134"],"host":["https://postman-rest-api-learner.glitch.me/"],"query":[],"variable":[]}},"response":[],"_postman_id":"cf7093fc-1abd-46c1-8785-98e7d240bee6"}],"id":"3d4bae23-ca86-43ba-857f-0c19c622c49e","_postman_id":"3d4bae23-ca86-43ba-857f-0c19c622c49e","description":""}],"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""]}},{"listen":"test","script":{"type":"text/javascript","exec":[""]}}],"variable":[{"id":"530bbdd9-38d3-441e-92dc-61f171c18dc2","key":"id","value":"1"},{"id":"57b5ecc1-1ffd-4eb5-a9a4-fa78c5251c5d","key":"base_url","value":"https://postman-rest-api-learner.glitch.me/"}]}