"Dokan" is a robust e-commerce platform designed to empower merchants and entrepreneurs with seamless online selling capabilities. It offers a user-friendly interface for setting up and managing digital storefronts, enabling businesses to showcase their products effectively. Dokan supports various features like customizable storefronts, multi-vendor functionality, secure payment gateways, and extensive product management tools. It fosters a vibrant marketplace where sellers can reach a wide audience, while buyers enjoy a rich shopping experience with diverse product offerings. With its scalable architecture and intuitive design, Dokan facilitates the growth and success of e-commerce ventures across different industries.
Endpoint:
/api/productsMethod:
POSTSample Request Body:
{ "name": "iPhone 13", "description": "A sleek and powerful smartphone with cutting-edge features.", "price": 999, "category": "Electronics", "tags": ["smartphone", "Apple", "iOS"], "variants": [ { "type": "Color", "value": "Midnight Blue" }, { "type": "Storage Capacity", "value": "256GB" } ], "inventory": { "quantity": 50, "inStock": true } }Sample Response:
{ "success": true, "message": "Product created successfully!", "data": { "name": "iPhone 13", "description": "A sleek and powerful smartphone with cutting-edge features.", "price": 999, "category": "Electronics", "tags": ["smartphone", "Apple", "iOS"], "variants": [ { "type": "Color", "value": "Midnight Blue" }, { "type": "Storage Capacity", "value": "256GB" } ], "inventory": { "quantity": 50, "inStock": true } } }
Endpoint:
/api/productsMethod:
GETSample Response:
{ "success": true, "message": "Products fetched successfully!", "data": [ { "name": "iPhone 13", "description": "A sleek and powerful smartphone with cutting-edge features.", "price": 999, "category": "Electronics", "tags": ["smartphone", "Apple", "iOS"], "variants": [ { "type": "Color", "value": "Midnight Blue" }, { "type": "Storage Capacity", "value": "256GB" } ], "inventory": { "quantity": 50, "inStock": true } }, { "name": "Samsung Galaxy S21", "description": "High-performance Android smartphone with advanced camera capabilities.", "price": 799, "category": "Electronics", "tags": ["smartphone", "Samsung", "Android"], "variants": [ { "type": "Color", "value": "Phantom Black" }, { "type": "Storage Capacity", "value": "128GB" } ], "inventory": { "quantity": 30, "inStock": true } } ] }
Endpoint:
/api/products/:productIdMethod:
GETSample Response:
{ "success": true, "message": "Product fetched successfully!", "data": { "name": "iPhone 13", "description": "A sleek and powerful smartphone with cutting-edge features.", "price": 999, "category": "Electronics", "tags": ["smartphone", "Apple", "iOS"], "variants": [ { "type": "Color", "value": "Midnight Blue" }, { "type": "Storage Capacity", "value": "256GB" } ], "inventory": { "quantity": 50, "inStock": true } } }
Endpoint:
/api/products/:productIdMethod:
PUTSample Request Body:
{ "name": "iPhone 13", "description": "A sleek and powerful smartphone with cutting-edge features.", "price": 999, "category": "Electronics", "tags": ["smartphone", "Apple", "iOS"], "variants": [ { "type": "Color", "value": "Midnight Blue" }, { "type": "Storage Capacity", "value": "256GB" } ], "inventory": { "quantity": 50, "inStock": true } }Sample Response:
{ "success": true, "message": "Product updated successfully!", "data": { "name": "iPhone 13", "description": "A sleek and powerful smartphone with cutting-edge features.", "price": 999, "category": "Electronics", "tags": ["smartphone", "Apple", "iOS"], "variants": [ { "type": "Color", "value": "Midnight Blue" }, { "type": "Storage Capacity", "value": "256GB" } ], "inventory": { "quantity": 49, "inStock": true } } }
Endpoint:
/api/products/:productIdMethod:
DELETESample Response:
{ "success": true, "message": "Product deleted successfully!", "data": null }
- Endpoint:
/api/products?searchTerm=iphone - Method: GET
- Sample Response:
{"success": true,"message": "Products matching search term 'iphone' fetched successfully!","data": [{"name": "iPhone 13 Pro","description": "The latest flagship iPhone model with advanced camera features.","price": 999,"category": "Smartphones","tags": ["iPhone","Apple","Mobile"],"variants": [{"type": "Color","value": "Graphite"},{"type": "Storage","value": "256GB"}],"inventory": {"quantity": 50,"inStock": true}},{"name": "iPhone SE","description": "Compact and affordable iPhone model with powerful performance.","price": 399,"category": "Smartphones","tags": ["iPhone","Apple","Mobile"],"variants": [{"type": "Color","value": "White"},{"type": "Storage","value": "128GB"}],"inventory": {"quantity": 20,"inStock": true}}]}Endpoint:
/api/ordersMethod:
POSTRequest Body:
{ "email": "level2@programming-hero.com", "productId": "5fd67e890b60c903cd8544a3", "price": 999, "quantity": 1 }Response:
{ "success": true, "message": "Order created successfully!", "data": { "email": "level2@programming-hero.com", "productId": "5fd67e890b60c903cd8544a3", "price": 999, "quantity": 1 } }
Endpoint:
/api/ordersMethod:
GETSample Response:
{ "success": true, "message": "Orders fetched successfully!", "data": [ { "email": "level2@programming-hero.com", "productId": "5fd67e890b60c903cd8544a3", "price": 999, "quantity": 1 } ] }
Endpoint:
/api/orders?email=level2@programming-hero.comMethod:
GETSample Response:
{ "success": true, "message": "Orders fetched successfully for user email!", "data": [ { "email": "level2@programming-hero.com", "productId": "5fd67e890b60c903cd8544a3", "price": 999, "quantity": 1 } ] }
- Insufficient Quantity Error
{"success": false,"message": "Insufficient quantity available in inventory"}- Not Found Error
{"success": false,"message": "Order not found"}- Not Found Route
{"success": false,"message": "Route not found"}- /api/v1/product (POST)
- /api/v1/product (Get All Products)
- /api/v1/product?searchTerm=Iphone (Get Search Products)
- api/v1/product/66862f1ef362f9c62432d131 (Single GET)
- api/v1/product/66862f1ef362f9c62432d131 (PUT)
- api/v1/product/66862f1ef362f9c62432d131 (DELETE)
- /api/v1/order (POST)
- api/v1/order?email=level3@programming-hero.com (GET)
- GitHub Repository URL (Server): https://github.com/ShuvoProgram/dokan
- Live Server Link: https://dokan-v1.vercel.app/api/v1