Welcome to the ShopEase API documentation. This API allows you to manage users, categories, products, wishlists, carts, reviews, orders, and payments for an e-commerce platform.
The base URL for all API endpoints is:
(https://shop-ease-3oxf.onrender.com/api/v1/)
Most endpoints require authentication using a Bearer Token. Include the token in the Authorization header as follows:
Authorization: Bearer <token>
- URL:
/login/ - Method:
POST - Body (JSON):
{ "email": "admin@example.com", "password": "admin123!" }
- URL:
/register/ - Method:
POST - Body (JSON):
{ "username": "test", "email": "test@example.com", "phone_number": "12134567890", "password": "test123!" }
- URL:
/profile/ - Method:
GET - Authorization: Bearer Token
- URL:
/profile/ - Method:
PUT - Authorization: Bearer Token
- Body (JSON):
{ "country": "Bangladesh" }
- URL:
/categories/ - Method:
POST - Authorization: Bearer Token
- Body (JSON):
{ "name": "Smart Home", "description": "Devices for home automation", "parent_category": "", "subcategories": [ { "name": "Smart Speakers", "description": "Voice-controlled speakers" }, { "name": "Smart Lighting", "description": "Automated lighting systems" } ] }
- URL:
/categories/{category_id}/ - Method:
PUT - Authorization: Bearer Token
- Body (JSON):
{ "name": "Updated Electronics", "description": "Updated description for electronic devices and accessories", "parent_category": null, "subcategories": [ { "name": "Updated Smartphones", "description": "Updated mobile phones and accessories" }, { "name": "Updated Laptops", "description": "Updated laptops and notebooks" } ] }
- URL:
/categories/ - Method:
GET
- URL:
/categories/{category_id}/ - Method:
DELETE - Authorization: Bearer Token
- URL:
/products/ - Method:
POST - Authorization: Bearer Token
- Body (JSON):
{ "name": "Wireless Gaming Headset", "description": "Immerse yourself in the game with this comfortable and high-quality wireless headset.", "price": "99.99", "discounted_price": "79.99", "category_id": "0be23434-7fd4-468d-9e1d-d41ff7b2b77d", "brand": "GameOn", "stock": 20, "features": [ "Low-latency wireless connection", "Noise-canceling microphone", "50mm drivers" ], "specifications": [ {"key": "Frequency response", "value": "20Hz - 20kHz"}, {"key": "Wireless range", "value": "15m"} ], "tags": [ "gaming", "headset", "wireless" ] }
- URL:
/products/{product_id}/images/ - Method:
POST - Authorization: Bearer Token
- Body (form-data):
image: <file> is_main: True
- URL:
/products/ - Method:
GET
- URL:
/products/{product_id}/ - Method:
GET
- URL:
/products/{product_id}/ - Method:
PATCH - Authorization: Bearer Token
- Body (JSON):
{ "name": "Gaming Console X Updated" }
- URL:
/products/{product_id}/ - Method:
DELETE - Authorization: Bearer Token
- URL:
/wishlist/ - Method:
GET - Authorization: Bearer Token
- URL:
/wishlist/add/ - Method:
POST - Authorization: Bearer Token
- Body (JSON):
{ "product_id": "e0db2959-9c20-4589-b2a5-e2150020f35e" }
- URL:
/wishlist/remove/{wishlist_id}/ - Method:
DELETE - Authorization: Bearer Token
- URL:
/cart/ - Method:
GET - Authorization: Bearer Token
- URL:
/cart/add/ - Method:
POST - Authorization: Bearer Token
- Body (JSON):
{ "product_id": "e0db2959-9c20-4589-b2a5-e2150020f35e", "quantity": 1 }
- URL:
/cart/update/{product_id}/ - Method:
PATCH - Authorization: Bearer Token
- Body (JSON):
{ "quantity": 5 }
- URL:
/cart/remove/{product_id}/ - Method:
DELETE - Authorization: Bearer Token
- URL:
/products/{product_id}/reviews/ - Method:
POST - Authorization: Bearer Token
- Body (JSON):
{ "rating": 5, "comment": "This product is amazing! Highly recommended." }
- URL:
/products/{product_id}/reviews/ - Method:
GET
- URL:
/reviews/{review_id}/ - Method:
DELETE - Authorization: Bearer Token
- URL:
/reviews/{review_id}/ - Method:
PATCH - Authorization: Bearer Token
- Body (JSON):
{ "rating": 4 }
- URL:
/orders/create/ - Method:
POST - Authorization: Bearer Token
- Body (JSON):
{ "products": [ { "product_id": "1734bb47-0177-49db-903e-5f1a4bb520fc", "quantity": 1 }, { "product_id": "815d4748-53f6-451a-ae38-0c3330aaefd6", "quantity": 4 } ], "shipping_address": { "street": "123 Main St", "city": "Anytown", "state": "State", "country": "Country", "zipCode": "12345" }, "payment_method": "credit_card" }
- URL:
/orders/update-status/{order_id}/ - Method:
PATCH - Authorization: Bearer Token
- Body (JSON):
{ "status": "shipped" }
- URL:
/orders/track/{order_id}/ - Method:
GET - Authorization: Bearer Token
- URL:
/orders/{order_id}/ - Method:
GET - Authorization: Bearer Token
- URL:
/orders/ - Method:
GET - Authorization: Bearer Token
- URL:
/orders/cancel/{order_id}/ - Method:
PATCH - Authorization: Bearer Token
- Body (JSON):
{ "status": "cancelled" }
- URL:
/payments/ - Method:
POST - Authorization: Bearer Token
- Body (JSON):
{ "order": "c1b7c291-ccb3-4900-be86-17b41d9844e0", "amount": "100.00", "payment_method": "credit_card" }
- URL:
/payments/{payment_id}/ - Method:
GET - Authorization: Bearer Token
To test the API, use the following endpoint:
- URL:
/ - Method:
GET
This project is licensed under the MIT License. See the LICENSE file for details.