{"info":{"_postman_id":"3a63b670-7443-47cb-b92c-51d51ba07afb","name":"ecom","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"20444054","collectionId":"3a63b670-7443-47cb-b92c-51d51ba07afb","publishedId":"2sAY4x9MRh","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-11-01T13:57:43.000Z"},"item":[{"name":"Products","item":[{"name":"Get All Products","id":"cdb8047a-bfd6-40b4-87da-644e985ae8f5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[],"url":"{{DOMAIN}}/api/v1/products/","urlObject":{"path":["api","v1","products",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"cdb8047a-bfd6-40b4-87da-644e985ae8f5"},{"name":"Get Single Product","id":"9013a956-e4f4-4000-b655-cdca2805071c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[],"url":"{{DOMAIN}}/api/v1/products/1/","urlObject":{"path":["api","v1","products","1",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"9013a956-e4f4-4000-b655-cdca2805071c"},{"name":"Update Product","id":"8d5d08d5-9cb9-4d2b-b5da-911423462d0f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"Product A","type":"text"},{"key":"description","value":"very good product too","type":"text"},{"key":"price","value":"30","type":"text"},{"key":"stock","value":"50","type":"text"}]},"url":"{{DOMAIN}}/api/v1/products/1/","urlObject":{"path":["api","v1","products","1",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"8d5d08d5-9cb9-4d2b-b5da-911423462d0f"},{"name":"Create Product","id":"779419af-d562-4adb-8f48-199ff978de77","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"Product N","type":"text"},{"key":"description","value":"very good product","type":"text"},{"key":"price","value":"30","type":"text"},{"key":"stock","value":"50","type":"text"}]},"url":"{{DOMAIN}}/api/v1/products/","urlObject":{"path":["api","v1","products",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"779419af-d562-4adb-8f48-199ff978de77"},{"name":"Upload Images For Product","id":"eaf9b9d9-a10f-406a-8c48-1ca83588023c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"product","value":"1","description":"<p>Product ID should be provided here</p>\n","type":"text"},{"key":"images","description":"<p>Only staff has the authority to upload product image</p>\n","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/penitent/Pictures/8.png"],"src":"/home/penitent/Pictures/8.png"}]},"url":"{{DOMAIN}}/api/v1/products/1/upload_images/","urlObject":{"path":["api","v1","products","1","upload_images",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"eaf9b9d9-a10f-406a-8c48-1ca83588023c"},{"name":"Create Review For Product","id":"71be7647-1581-49ce-9fb5-e8686ccde9fa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"comment","value":"good one","type":"text"}]},"url":"{{DOMAIN}}/api/v1/products/1/review/","urlObject":{"path":["api","v1","products","1","review",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"71be7647-1581-49ce-9fb5-e8686ccde9fa"},{"name":"Delete Review For Product","id":"7fd07f32-e85a-484b-9d10-8f65c40d8366","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"DELETE","header":[],"body":{"mode":"formdata","formdata":[]},"url":"{{DOMAIN}}/api/v1/products/1/review/","urlObject":{"path":["api","v1","products","1","review",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7fd07f32-e85a-484b-9d10-8f65c40d8366"}],"id":"31cf5334-3c90-49dc-bbef-466e6690c1c4","_postman_id":"31cf5334-3c90-49dc-bbef-466e6690c1c4","description":""},{"name":"Accounts","item":[{"name":"Register","id":"b1f72761-5cc4-4fec-b327-4240960eb13f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\"username\":\"jayeed222\",\n\"first_name\":\"Jayeed\",\n\"last_name\":\"Mohd\",\n\"email\":\"thisisit@gmail.com\",\n\"password\":\"admin\",\n\"is_staff\": false\n\n}","options":{"raw":{"language":"json"}}},"url":"{{DOMAIN}}/accounts/register/","urlObject":{"path":["accounts","register",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"b1f72761-5cc4-4fec-b327-4240960eb13f"},{"name":"Login","event":[{"listen":"test","script":{"id":"6058c046-2331-418f-90f4-416e7e5199a1","exec":["pm.environment.set(\"token\", pm.response.json().access)"],"type":"text/javascript","packages":{}}}],"id":"f362930a-a087-42ce-bd6e-e1ee1b4b95e3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\n    \"username\":\"jayeed212\",\n    \"password\":\"admin\"\n}","options":{"raw":{"language":"json"}}},"url":"{{DOMAIN}}/api/token/","urlObject":{"path":["api","token",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"f362930a-a087-42ce-bd6e-e1ee1b4b95e3"},{"name":"Check User Profile","id":"ca88a40e-52a6-49f8-92d8-58c5fa3b1a96","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{DOMAIN}}/accounts/me","urlObject":{"path":["accounts","me"],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ca88a40e-52a6-49f8-92d8-58c5fa3b1a96"},{"name":"Update User Profile","id":"e3b908fe-3777-444e-985c-b9ce6b035053","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n\"username\":\"jayeed\",\n\"first_name\":\"Jayeed\",\n\"last_name\":\"Mohd\",\n\"email\":\"thisisit22@gmail.com\"\n\n}","options":{"raw":{"language":"json"}}},"url":"{{DOMAIN}}/accounts/me/update/","urlObject":{"path":["accounts","me","update",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e3b908fe-3777-444e-985c-b9ce6b035053"}],"id":"08aae0d4-1848-43ba-b387-ac4acdc5afff","_postman_id":"08aae0d4-1848-43ba-b387-ac4acdc5afff","description":""},{"name":"Orders","item":[{"name":"Order Place Cash On Delivery","id":"dd308fd6-f1c4-4f01-aecd-b3876df27807","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"street\": \"44 Subway\",\n    \"city\": \"Mongolian Town\",\n    \"state\": \"MA\",\n    \"zip_code\": \"5898\",\n    \"phone_no\": \"658-987-4444\",\n    \"country\": \"United States\",\n    \"orderItems\": [\n        {\n            \"product\": 7,\n            \"quantity\": 2,\n            \"price\":50 \n        }\n    ]\n}\n","options":{"raw":{"language":"json"}}},"url":"{{DOMAIN}}/api/v1/orders/place/","description":"<h3 id=\"place-order\">Place Order</h3>\n<p>The <code>POST /api/v1/orders/place/</code> endpoint is used to place a new order, any authenticated user can do this. This endpoint can be used a COD mode payment</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p><code>street</code> (string): The street address for the order delivery.</p>\n</li>\n<li><p><code>city</code> (string): The city for the order delivery.</p>\n</li>\n<li><p><code>state</code> (string): The state for the order delivery.</p>\n</li>\n<li><p><code>zip_code</code> (string): The zip code for the order delivery.</p>\n</li>\n<li><p><code>phone_no</code> (string): The contact phone number for the order.</p>\n</li>\n<li><p><code>country</code> (string): The country for the order delivery.</p>\n</li>\n<li><p><code>orderItems</code> (array): An array of objects containing the details of the items being ordered, including the <code>product</code> ID, <code>quantity</code>, and <code>price</code>.</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>Upon successful execution, the response will have a status code of 201 and a JSON object with the following fields:</p>\n<ul>\n<li><p><code>id</code> (integer): The ID of the order.</p>\n</li>\n<li><p><code>orderItems</code> (array): An array of objects containing the details of the ordered items.</p>\n</li>\n<li><p><code>street</code> (string): The street address for the order delivery.</p>\n</li>\n<li><p><code>city</code> (string): The city for the order delivery.</p>\n</li>\n<li><p><code>state</code> (string): The state for the order delivery.</p>\n</li>\n<li><p><code>zip_code</code> (string): The zip code for the order delivery.</p>\n</li>\n<li><p><code>phone_no</code> (string): The contact phone number for the order.</p>\n</li>\n<li><p><code>country</code> (string): The country for the order delivery.</p>\n</li>\n<li><p><code>total_amount</code> (integer): The total amount of the order.</p>\n</li>\n<li><p><code>payment_status</code> (string): The status of the payment.</p>\n</li>\n<li><p><code>status</code> (string): The status of the order.</p>\n</li>\n<li><p><code>created_at</code> (string): The timestamp of when the order was created.</p>\n</li>\n<li><p><code>user</code> (integer): The ID of the user associated with the order.</p>\n</li>\n</ul>\n","urlObject":{"path":["api","v1","orders","place",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"dd308fd6-f1c4-4f01-aecd-b3876df27807"},{"name":"Get All Orders","id":"9353cd62-8903-44ef-9b22-c711c491f6fe","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{DOMAIN}}/api/v1/orders/","urlObject":{"path":["api","v1","orders",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"9353cd62-8903-44ef-9b22-c711c491f6fe"},{"name":"Get Single Order","id":"2a05e165-1d71-4250-bf32-f126b01bbf79","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{DOMAIN}}/api/v1/orders/25","urlObject":{"path":["api","v1","orders","25"],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"2a05e165-1d71-4250-bf32-f126b01bbf79"},{"name":"Process Order","id":"6fa79b28-12f6-4673-b5cb-ffd33185702a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"formdata","formdata":[{"key":"status","value":"Shipped","type":"text"}]},"url":"{{DOMAIN}}/api/v1/orders/25/process/","urlObject":{"path":["api","v1","orders","25","process",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"6fa79b28-12f6-4673-b5cb-ffd33185702a"},{"name":"Delete Order","id":"ab5fded1-2a0f-41b4-be1b-6733dff00b2f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"DELETE","header":[],"body":{"mode":"formdata","formdata":[{"key":"status","value":"Shipped","type":"text"}]},"url":"{{DOMAIN}}/api/v1/orders/25/delete/","urlObject":{"path":["api","v1","orders","25","delete",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ab5fded1-2a0f-41b4-be1b-6733dff00b2f"},{"name":"Order Place Online","id":"f930bcf2-bdef-4e56-a3b5-e4125072effc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"street\": \"44 Subway\",\n    \"city\": \"Mongolian Town\",\n    \"state\": \"MA\",\n    \"zip_code\": \"5898\",\n    \"phone_no\": \"658-987-4444\",\n    \"country\": \"United States\",\n    \"orderItems\": [\n        {\n            \"name\":\"product A\",\n            \"image\": \"http://localhost:8000/media/products/5.png\",\n            \"product\": 1,\n            \"quantity\": 2,\n            \"price\": 30\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{DOMAIN}}/api/v1/create-checkout-session/","description":"<p>Please take the url at the end of the response and paste it in a browser. You can further move on with the payment process there. Before doing so, make sure, Stripe CLI is on and configured as per github documentation</p>\n","urlObject":{"path":["api","v1","create-checkout-session",""],"host":["{{DOMAIN}}"],"query":[],"variable":[]}},"response":[{"id":"d80b9a69-a1c9-43b9-8887-bebc3820d67c","name":"Response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"street\": \"44 Subway\",\n    \"city\": \"Mongolian Town\",\n    \"state\": \"MA\",\n    \"zip_code\": \"5898\",\n    \"phone_no\": \"658-987-4444\",\n    \"country\": \"United States\",\n    \"orderItems\": [\n        {\n            \"name\":\"product A\",\n            \"image\": \"http://localhost:8000/media/products/5.png\",\n            \"product\": 1,\n            \"quantity\": 2,\n            \"price\": 30\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{DOMAIN}}/api/v1/create-checkout-session/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 01 Nov 2024 13:35:35 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.11.0"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"2305"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"session\": {\n        \"id\": \"cs_test_a1pKN6RpypN2XoQhK40BH537TPszBwHNs6D6WcrIyOwJAmzYZqemnLB5TZ\",\n        \"object\": \"checkout.session\",\n        \"after_expiration\": null,\n        \"allow_promotion_codes\": null,\n        \"amount_subtotal\": 6000,\n        \"amount_total\": 6000,\n        \"automatic_tax\": {\n            \"enabled\": false,\n            \"liability\": null,\n            \"status\": null\n        },\n        \"billing_address_collection\": null,\n        \"cancel_url\": \"http://localhost:8000/\",\n        \"client_reference_id\": null,\n        \"client_secret\": null,\n        \"consent\": null,\n        \"consent_collection\": null,\n        \"created\": 1730468134,\n        \"currency\": \"usd\",\n        \"currency_conversion\": null,\n        \"custom_fields\": [],\n        \"custom_text\": {\n            \"after_submit\": null,\n            \"shipping_address\": null,\n            \"submit\": null,\n            \"terms_of_service_acceptance\": null\n        },\n        \"customer\": null,\n        \"customer_creation\": \"if_required\",\n        \"customer_details\": {\n            \"address\": null,\n            \"email\": \"thisisit@gmail.com\",\n            \"name\": null,\n            \"phone\": null,\n            \"tax_exempt\": \"none\",\n            \"tax_ids\": null\n        },\n        \"customer_email\": \"thisisit@gmail.com\",\n        \"expires_at\": 1730554534,\n        \"invoice\": null,\n        \"invoice_creation\": {\n            \"enabled\": false,\n            \"invoice_data\": {\n                \"account_tax_ids\": null,\n                \"custom_fields\": null,\n                \"description\": null,\n                \"footer\": null,\n                \"issuer\": null,\n                \"metadata\": {},\n                \"rendering_options\": null\n            }\n        },\n        \"livemode\": false,\n        \"locale\": null,\n        \"metadata\": {\n            \"city\": \"Mongolian Town\",\n            \"country\": \"United States\",\n            \"phone_no\": \"658-987-4444\",\n            \"state\": \"MA\",\n            \"street\": \"44 Subway\",\n            \"user\": \"9\",\n            \"zip_code\": \"5898\"\n        },\n        \"mode\": \"payment\",\n        \"payment_intent\": null,\n        \"payment_link\": null,\n        \"payment_method_collection\": \"if_required\",\n        \"payment_method_configuration_details\": null,\n        \"payment_method_options\": {\n            \"card\": {\n                \"request_three_d_secure\": \"automatic\"\n            }\n        },\n        \"payment_method_types\": [\n            \"card\"\n        ],\n        \"payment_status\": \"unpaid\",\n        \"phone_number_collection\": {\n            \"enabled\": false\n        },\n        \"recovered_from\": null,\n        \"saved_payment_method_options\": null,\n        \"setup_intent\": null,\n        \"shipping_address_collection\": null,\n        \"shipping_cost\": null,\n        \"shipping_details\": null,\n        \"shipping_options\": [],\n        \"status\": \"open\",\n        \"submit_type\": null,\n        \"subscription\": null,\n        \"success_url\": \"http://localhost:8000/\",\n        \"total_details\": {\n            \"amount_discount\": 0,\n            \"amount_shipping\": 0,\n            \"amount_tax\": 0\n        },\n        \"ui_mode\": \"hosted\",\n        \"url\": \"https://checkout.stripe.com/c/pay/cs_test_a1pKN6RpypN2XoQhK40BH537TPszBwHNs6D6WcrIyOwJAmzYZqemnLB5TZ#fidkdWxOYHwnPyd1blpxYHZxWjA0SlVuV1xHNUFSNkFQcFQ3M2RtS2ZWb289SUx%2FfWhDT1Q3dEZ2X2hDf2sybEdmcTZdSmN2b0NhczRjRzNhR29pdG5zN0MyTE9DUWROclMwMmx0M0dqUUdvNTV9UTZrMXJRSScpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl\"\n    }\n}"}],"_postman_id":"f930bcf2-bdef-4e56-a3b5-e4125072effc"}],"id":"e6161605-49fd-4891-bfdf-b05dc9e9dc14","_postman_id":"e6161605-49fd-4891-bfdf-b05dc9e9dc14","description":""}]}