{"info":{"_postman_id":"ffd8c90c-3ac1-478a-8c21-f870f0841048","name":"E-commerce","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"30607558","collectionId":"ffd8c90c-3ac1-478a-8c21-f870f0841048","publishedId":"2sAYBd6ndu","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-12-09T02:17:16.000Z"},"item":[{"name":"Buyer Add Item to Cart","id":"3024ef3e-d2e3-4e0f-85f6-69568c167da1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"product_id\": \"2\",\n  \"quantity\": 1\n}\n","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1/admin/api.php/buyer/cart/add","description":"<h3 id=\"add-product-to-cart\">Add Product to Cart</h3>\n<p>This endpoint allows the buyer to add a product to their cart. The buyer must provide the product ID and quantity of the product they wish to add.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p><code>product_id</code> (string) - StartFragmentThe ID of the product to be added to the cart. <em>(Required)</em></p>\n</li>\n<li><p><code>quantity</code> (integer) - StartFragmentThe quantity of the product to be added to the cart. <em>(Required)</em></p>\n</li>\n</ul>\n<h4 id=\"example-request\"><strong>Example Request</strong></h4>\n<p>Send the request body in raw JSON format:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"product_id\": \"1\",\n    \"quantity\": 2\n}\n\n</code></pre>\n<h4 id=\"response\"><strong>Response:</strong></h4>\n<p>The response includes the following fields:</p>\n<ul>\n<li><p><strong><code>status</code></strong> (string)<br />  Indicates the status of the request (e.g., \"success\", \"error\").</p>\n</li>\n<li><p><strong><code>message</code></strong> (string)<br />  Provides additional information or error messages.</p>\n</li>\n</ul>\n<h4 id=\"example-responses\"><strong>Example Responses</strong></h4>\n<h4 id=\"success\"><strong>Success</strong></h4>\n<p>HTTP Status Code: 200<br /><strong>Response Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"success\",\n    \"message\": \"Product added to cart successfully.\"\n}\n\n</code></pre>\n<h4 id=\"error-cases\"><strong>Error Cases</strong></h4>\n<ol>\n<li>Missing <code>product_id</code> or <code>quantity</code>HTTP Status Code: 400</li>\n</ol>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Product ID and quantity are required.\"\n}\n\n</code></pre>\n<p>2. Product Not Found HTTP Status Code: 200</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Product ID does not exist in the product table\"\n}\n\n</code></pre>\n<p>3. Invalid <code>quantity</code>HTTP Status Code: 200</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Invalid quantity. Please provide a number greater than 0.\"\n}\n\n</code></pre>\n<p>4. Unauthorized HTTP Status Code: 401</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Unauthorized: Token missing\"\n}\n\n</code></pre>\n<p>5. Unexpected Error HTTP Status Code: 500</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"An unexpected error occurred. Please try again later.\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","path":["admin","api.php","buyer","cart","add"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"3024ef3e-d2e3-4e0f-85f6-69568c167da1"},{"name":"Buyer View Cart","id":"fccca5ae-afdc-436b-b9ff-4bec5f40e7e2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://127.0.0.1/admin/api.php/buyer/cart/view","description":"<h3 id=\"buyer-view-cart\">Buyer View Cart</h3>\n<p>This endpoint allows the buyer to view all the items currently in their cart. The cart details include the product ID, name, quantity, and price.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<p>No body is required for this request.</p>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li><p><strong><code>status</code></strong> (string): Indicates the status of the request (e.g., \"success\", \"error\").</p>\n</li>\n<li><p><strong><code>cart_items</code></strong> (array): A list of items currently in the buyer's cart, including product details.</p>\n</li>\n</ul>\n<h5 id=\"sample-response\">Sample Response</h5>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"success\",\n    \"data\": {\n        \"cart_id\": \"cart_67545ef2b9106\",\n        \"user_id\": \"1a32c55b-a62a-4c1f-8141-a8c1f51f82d6\",\n        \"items\": [\n            {\n                \"product_id\": 1,\n                \"product_name\": \"Casual T-Shirt\",\n                \"price\": \"250.00\",\n                \"quantity\": 2,\n                \"total\": \"500.00\"\n            }\n        ],\n        \"total_items\": 2,\n        \"total_price\": 500\n    }\n}\n\n</code></pre>\n<h4 id=\"error-cases\"><strong>Error Cases</strong></h4>\n<p>1. Cart is Empty HTTP Status Code: 200</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"success\",\n    \"data\": {\n        \"cart_id\": \"cart_67550bb9e2ba8\",\n        \"user_id\": \"1a32c55b-a62a-4c1f-8141-a8c1f51f82d6\",\n        \"items\": [],\n        \"total_items\": 0,\n        \"total_price\": 0\n    }\n}\n\n</code></pre>\n<p>2. Unauthorized HTTP Status Code: 401</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Unauthorized: Token missing\"\n}\n\n</code></pre>\n<p>3. Unexpected ErrorHTTP Status Code: 500</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"An unexpected error occurred. Please try again later.\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","path":["admin","api.php","buyer","cart","view"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"fccca5ae-afdc-436b-b9ff-4bec5f40e7e2"},{"name":"Buyer Update Cart Item","id":"b84e2c14-2294-40e1-9162-a83462131897","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"product_id\": 1,\n  \"quantity\": 3\n}\n","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1/admin/api.php/buyer/cart/update","description":"<h3 id=\"update-buyers-cart\">Update Buyer's Cart</h3>\n<p>This endpoint allows the buyer to update the quantity of a specific product in their cart. The buyer must provide the product ID and the new quantity.</p>\n<p><strong>Request Body</strong></p>\n<ul>\n<li><p><code>product_id</code> (number): The ID of the product to be updated in the cart.</p>\n</li>\n<li><p><code>quantity</code> (number): The new quantity of the product in the cart.</p>\n</li>\n</ul>\n<p><strong>Sample Request:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"product_id\": \"1\",\n    \"quantity\": 3\n}\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<p>The response is in JSON format and includes the following fields:</p>\n<ul>\n<li><p><code>status</code> (string): Indicates the status of the request.</p>\n</li>\n<li><p><code>message</code> (string): Provides additional information or messages related to the request.</p>\n</li>\n</ul>\n<p><strong>Sample Responses:</strong></p>\n<h4 id=\"success\"><strong>Success</strong></h4>\n<p><strong>HTTP Status Code: 200</strong></p>\n<p><strong>Sample Response:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"success\",\n    \"message\": \"Product quantity updated successfully\"\n}\n\n</code></pre>\n<p><strong>Error Cases</strong></p>\n<ol>\n<li>Missing <code>product_id</code> or <code>quantity</code>HTTP Status Code: 400</li>\n</ol>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Product ID and quantity are required.\"\n}\n\n</code></pre>\n<p>2. Product Not Found in Cart HTTP Status Code: 200</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Product ID does not exist in the product table\"\n}\n\n</code></pre>\n<p>3. Invalid <code>quantity</code>HTTP Status Code: 400</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Invalid quantity. Please provide a number greater than 0.\"\n}\n\n</code></pre>\n<p>4. Unauthorized HTTP Status Code: 401</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Unauthorized: Token missing\"\n}\n\n</code></pre>\n<p>5. Unexpected Error HTTP Status Code: 500</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"An unexpected error occurred. Please try again later.\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","path":["admin","api.php","buyer","cart","update"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"b84e2c14-2294-40e1-9162-a83462131897"},{"name":"Buyer Remove Cart Item","id":"635eafd6-9a47-4699-bc65-ec5f080ec543","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"{\n    \"product_id\": 1\n}\n","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1/shopping-cart/api.php/buyer/cart/remove","description":"<h3 id=\"remove-product-from-shopping-cart\">Remove Product from Shopping Cart</h3>\n<p>This endpoint allows the buyer to remove a specific product from their cart. The buyer must provide the product ID of the item they wish to remove.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><strong><code>product_id</code></strong> (string): The ID of the product to remove from the cart. <em>(Required)</em></li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"product_id\": \"1\"\n}\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<p>The response will be a JSON object with the following properties:</p>\n<ul>\n<li><p><strong><code>status</code></strong> (string): Indicates the status of the request (e.g., \"success\", \"error\").</p>\n</li>\n<li><p><strong><code>message</code></strong> (string): Provides additional information or error messages.</p>\n</li>\n</ul>\n<h4 id=\"success\"><strong>Success</strong></h4>\n<p>HTTP Status Code: 200<br /><strong>Response Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"success\",\n    \"message\": \"Product removed from cart successfully.\"\n}\n\n</code></pre>\n<h4 id=\"error-cases\"><strong>Error Cases</strong></h4>\n<ol>\n<li>Missing <code>product_id</code> or <code>quantity</code>HTTP Status Code: 400</li>\n</ol>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Product ID is required.\"\n}\n\n</code></pre>\n<p>2. Product Not Found HTTP Status Code: 200</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Product not found in the cart.\"\n}\n\n</code></pre>\n<p>3. UnauthorizedHTTP Status Code: 401</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Unauthorized: Token missing or invalid.\"\n}\n\n</code></pre>\n<p>4. Unexpected Error HTTP Status Code: 500</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"An unexpected error occurred. Please try again later.\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","path":["shopping-cart","api.php","buyer","cart","remove"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"635eafd6-9a47-4699-bc65-ec5f080ec543"},{"name":"Buyer Clear Cart","id":"66832479-f394-4a42-8c79-32aead42f19e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1/admin/api.php/buyer/cart/clear","description":"<h3 id=\"clear-buyers-cart\">Clear Buyer's Cart</h3>\n<p>This endpoint is used to clear the cart for a buyer.</p>\n<p><strong>Request</strong></p>\n<ul>\n<li>No request body is needed for this endpoint.</li>\n</ul>\n<p><strong>Response</strong></p>\n<p>The response includes the following fields:</p>\n<ul>\n<li><p><strong><code>status</code></strong> (string): Indicates the status of the request (e.g., \"success\", \"error\").</p>\n</li>\n<li><p><strong><code>message</code></strong> (string): Provides additional information or error messages.</p>\n</li>\n</ul>\n<h4 id=\"success\"><strong>Success</strong></h4>\n<p>HTTP Status Code: 200<br /><strong>Response Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"success\",\n    \"message\": \"Cart cleared successfully. The cart is now empty.\"\n}\n\n</code></pre>\n<h4 id=\"error-cases\"><strong>Error Cases</strong></h4>\n<ol>\n<li>Cart Already EmptyHTTP Status Code: 200</li>\n</ol>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"info\",\n    \"message\": \"Your cart is already empty\"\n}\n\n</code></pre>\n<p>2. Unauthorized HTTP Status Code: 401</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Unauthorized: Token missing or invalid.\"\n}\n\n</code></pre>\n<p>3. Unexpected Error HTTP Status Code: 500</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"An unexpected error occurred. Please try again later.\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","path":["admin","api.php","buyer","cart","clear"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"66832479-f394-4a42-8c79-32aead42f19e"},{"name":"Buyer Checkout","id":"4af71774-ff5b-45dc-8880-83b8e0d2a32f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"payment_method\": \"Credit Card\"\n}\n","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1/admin/api.php/buyer/cart/checkout","description":"<h3 id=\"checkout-shopping-cart\">Checkout Shopping Cart</h3>\n<p>This endpoint is used to checkout the shopping cart for the buyer.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><code>payment_method</code> (string, required): The payment method chosen by the buyer (e.g., \"Credit Card\", \"COD\").</li>\n</ul>\n<p>Example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"payment_method\": \"Credit Card\"\n}\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li><p><strong><code>status</code></strong> (string): Indicates the status of the request (e.g., \"success\", \"error\").</p>\n</li>\n<li><p><strong><code>message</code></strong> (string): Provides additional information or error messages.</p>\n</li>\n<li><p><strong><code>order_id</code></strong> (integer): The unique ID of the created order.</p>\n</li>\n<li><p><strong><code>total_amount</code></strong> (float): The total cost of all items in the cart.</p>\n</li>\n<li><p><strong><code>order_items</code></strong> (array): A list of items included in the order, with their details.</p>\n</li>\n</ul>\n<p><strong>Example Responses</strong></p>\n<h4 id=\"success\"><strong>Success</strong></h4>\n<p><strong>HTTP Status Code</strong>: 200</p>\n<p><strong>Response Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"success\",\n    \"message\": \"Checkout initiated successfully\",\n    \"order_id\": \"25\",\n    \"total_amount\": \"1799\",\n    \"payment_method\": \"Credit Card\",\n    \"order_items\": [\n        {\n            \"product_id\": 2,\n            \"quantity\": 1,\n            \"price\": \"1799.00\"\n        }\n    ]\n}\n\n</code></pre>\n<h4 id=\"error-cases\"><strong>Error Cases</strong></h4>\n<ol>\n<li>Missing <code>payment_method</code>HTTP Status Code: 400</li>\n</ol>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Payment method is required.\"\n}\n\n</code></pre>\n<p>2. Cart is Empty HTTP Status Code: 200</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Cart is empty\"\n}\n\n</code></pre>\n<p>3. UnauthorizedHTTP Status Code: 401</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Unauthorized: Token missing or invalid.\"\n}\n\n</code></pre>\n<p>4. Unexpected Error HTTP Status Code: 500</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"An unexpected error occurred. Please try again later.\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","path":["admin","api.php","buyer","cart","checkout"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"4af71774-ff5b-45dc-8880-83b8e0d2a32f"},{"name":"Buyer Checkout Review Order","id":"d4e68d8b-2bf0-4723-93d0-31b916906034","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1/admin/api.php/buyer/checkout/review","description":"<h3 id=\"checkout-review\">Checkout Review</h3>\n<p>This endpoint allows the buyer to review their most recent order after checkout. It fetches the order details, including items, total amount, payment method, and order status. No request body is needed.</p>\n<h4 id=\"request\">Request</h4>\n<p>No request body is required for this endpoint.</p>\n<h4 id=\"response\">Response</h4>\n<p>The response will have a status code of 200 and a Content-Type of <code>text/html</code>. The response body will contain the following fields:</p>\n<ul>\n<li><p><strong><code>status</code></strong> (string): Indicates the status of the request (e.g., \"success\", \"error\").</p>\n</li>\n<li><p><strong><code>message</code></strong> (string): Provides additional information or error messages.</p>\n</li>\n<li><p><code>order</code> (object): Contains information about the order, including:</p>\n<ul>\n<li><p><code>order_id</code> (integer): The ID of the order.</p>\n</li>\n<li><p><code>total_amount</code> (string): The total amount of the order.</p>\n</li>\n<li><p><code>payment_method</code> (string): The payment method used for the order.</p>\n</li>\n<li><p><code>status</code>(string): The current status of the order (e.g., \"Pending\", \"Confirmed\").</p>\n</li>\n<li><p><code>order_date</code> (string): The date of the order.</p>\n</li>\n<li><p><code>order_items</code> (array): An array of objects containing information about the items in the order, including:</p>\n<ul>\n<li><p><code>product_id</code> (integer): The ID of the product.</p>\n</li>\n<li><p><code>quantity</code> (integer): The quantity of the product in the order.</p>\n</li>\n<li><p><code>price</code> (string): The price of the product.</p>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<p><strong>Example Responses</strong></p>\n<h4 id=\"success\"><strong>Success</strong></h4>\n<p><strong>HTTP Status Code</strong>: 200</p>\n<p><strong>Response Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"success\",\n    \"message\": \"Checkout review successfully.\",\n    \"order\": {\n        \"order_id\": 25,\n        \"total_amount\": \"1799.00\",\n        \"payment_method\": \"Credit Card\",\n        \"status\": \"Pending\",\n        \"order_date\": \"2024-12-09 08:14:33\",\n        \"order_items\": [\n            {\n                \"product_id\": 2,\n                \"quantity\": 1,\n                \"price\": \"1799.00\"\n            }\n        ]\n    }\n}\n\n</code></pre>\n<h4 id=\"error-cases\"><strong>Error Cases</strong></h4>\n<ol>\n<li>No Recent Order FoundHTTP Status Code: 404</li>\n</ol>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"No recent order found to review.\"\n}\n\n</code></pre>\n<p>2. Unauthorized HTTP Status Code: 401</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Unauthorized: Token missing or invalid.\"\n}\n\n</code></pre>\n<p>3. Unexpected Error HTTP Status Code: 500</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"An unexpected error occurred. Please try again later.\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","path":["admin","api.php","buyer","checkout","review"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"d4e68d8b-2bf0-4723-93d0-31b916906034"},{"name":"Buyer Checkout Confirmation","id":"f5c7f9bc-c94d-46ed-acde-5cc5739c5277","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"order_id\": \"20\"\n}\n","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1/admin/api.php/buyer/checkout/confirm","description":"<h3 id=\"buyer-checkout-confirmation\">Buyer Checkout Confirmation</h3>\n<p>This endpoint allows the buyer to confirm their order after checkout. The buyer must provide the order ID of the order they wish to confirm.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><code>order_id</code> (string) -The ID of the order to confirm. <em>(Required)</em></li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"order_id\": \"20\"\n}\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<p>The response includes the following fields:</p>\n<ul>\n<li><p><code>status</code> (string) - FragmentIndicates the status of the request (e.g., \"success\", \"error\").</p>\n</li>\n<li><p><code>message</code> (string) - Provides additional information about the confirmation.</p>\n</li>\n</ul>\n<p><strong>Example Responses</strong></p>\n<h4 id=\"success\"><strong>Success</strong></h4>\n<p><strong>HTTP Status Code</strong>: 200</p>\n<p><strong>Response Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"success\",\n    \"message\": \"Order confirmed successfully.\"\n}\n\n</code></pre>\n<h4 id=\"error-cases\"><strong>Error Cases</strong></h4>\n<ol>\n<li>Missing <code>order_id</code> HTTP Status Code: 200</li>\n</ol>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Order ID is required.\"\n}\n\n</code></pre>\n<p>2. Order Not Found HTTP Status Code: 200</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Order not found.\"\n}\n\n</code></pre>\n<p>3. UnauthorizedHTTP Status Code: 401</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Unauthorized: Token missing\"\n}\n\n</code></pre>\n<p>4. Unexpected Error HTTP Status Code: 500</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"An unexpected error occurred. Please try again later.\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","path":["admin","api.php","buyer","checkout","confirm"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"f5c7f9bc-c94d-46ed-acde-5cc5739c5277"},{"name":"Buyer Checkout Payment","id":"5bf4982c-d008-4ed2-9880-e87a8617223d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"order_id\": 24,\n    \"amount\": \"\",\n    \"status\": \"\"\n}\n","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1/admin/api.php/buyer/checkout/payment","description":"<h3 id=\"checkout-payment\">Checkout Payment</h3>\n<p>This endpoint allows the buyer to process the payment for an order. The buyer must provide the order ID, payment amount, and payment method.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p><code>order_id</code> (number): The ID of the order to be paid. <em>(Required)</em></p>\n</li>\n<li><p><code>pamount</code> (number): The total amount for the payment. <em>(Required)</em></p>\n</li>\n<li><p><code>status</code> (string): The payment method used (e.g., \"Credit Card\", \"Cash on Delivery\"). <em>(Required)</em></p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"order_id\": 24,\n    \"amount\": 200.00,\n    \"status\": \"Completed\"\n}\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li><p><code>status</code> (string): Indicates the status of the request (e.g., \"success\", \"error\").</p>\n</li>\n<li><p><code>message</code> (string): A message related to the payment processing.</p>\n</li>\n</ul>\n<p><strong>Example Responses</strong></p>\n<h4 id=\"success\"><strong>Success</strong></h4>\n<p><strong>HTTP Status Code</strong>: 200</p>\n<p><strong>Response Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"success\",\n    \"message\": \"Payment processed successfully.\"\n}\n\n</code></pre>\n<h4 id=\"error-cases\"><strong>Error Cases</strong></h4>\n<ol>\n<li>Missing <code>order_id</code> HTTP Status Code: 200</li>\n</ol>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Missing required payment details\"\n}\n\n</code></pre>\n<p>2. Order Not Found HTTP Status Code: 200</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Order not found. Please check the order id and try again.\"\n}\n\n</code></pre>\n<p>3. UnauthorizedHTTP Status Code: 401</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Unauthorized: Token missing\"\n}\n\n</code></pre>\n<p>4. Unexpected Error HTTP Status Code: 500</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"An unexpected error occurred. Please try again later.\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","path":["admin","api.php","buyer","checkout","payment"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"5bf4982c-d008-4ed2-9880-e87a8617223d"},{"name":"Buyer Cancel Checkout","id":"ce73f059-d449-4da5-ab04-ddcd55dde3c9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"order_id\": \"3\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1/admin/api.php/buyer/checkout/cancel","description":"<h2 id=\"checkout-cancel\">Checkout Cancel</h2>\n<p>This endpoint is used to cancel a checkout process for a buyer.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<ul>\n<li><code>order_id</code> (string) - The ID of the order to be cancelled.</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"order_id\": 24\n}\n\n</code></pre>\n<h3 id=\"response\">Response</h3>\n<ul>\n<li><p><code>status</code> - Indicates the status of the request (e.g., \"success\", \"error\").</p>\n</li>\n<li><p><code>message</code> - Provides additional information about the status.</p>\n</li>\n</ul>\n<p><strong>Example Responses</strong></p>\n<h4 id=\"success\"><strong>Success</strong></h4>\n<p><strong>HTTP Status Code</strong>: 200</p>\n<p><strong>Response Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"success\",\n    \"message\": \"Checkout cancelled successfully.\"\n}\n\n</code></pre>\n<h4 id=\"error-cases\"><strong>Error Cases</strong></h4>\n<ol>\n<li>Missing <code>order_id</code> HTTP Status Code: 200</li>\n</ol>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"order ID is required.\"\n}\n\n</code></pre>\n<p>2. Order Not Found HTTP Status Code: 200</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"order ID not found.\"\n}\n\n</code></pre>\n<p>3. UnauthorizedHTTP Status Code: 401</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"Unauthorized: Token missing\"\n}\n\n</code></pre>\n<p>4. Unexpected Error HTTP Status Code: 500</p>\n<p><strong>Response Body</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"error\",\n    \"message\": \"An unexpected error occurred. Please try again later.\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","path":["admin","api.php","buyer","checkout","cancel"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"ce73f059-d449-4da5-ab04-ddcd55dde3c9"}],"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""]}},{"listen":"test","script":{"type":"text/javascript","exec":[""]}}],"variable":[{"key":"id","value":"1"},{"key":"base_url","value":"https://postman-rest-api-learner.glitch.me/"}]}