You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone https://github.com/harshalkumar-ishi/django-ecommerce-api.git
cd django-ecommerce-api
cp .env .env.example
docker-compose up --build -d
On startup, the entrypoint script automatically:
Waits for PostgreSQL + Redis to be healthy
Runs all migrations
Seeds demo categories, products, coupons
Seeds Celery Beat schedules
Starts the Django server
📖 API Endpoints
Auth
Method
Endpoint
Description
POST
/api/v1/auth/register/
Register new user
POST
/api/v1/auth/login/
Login, get JWT tokens
POST
/api/v1/auth/logout/
Blacklist refresh token
POST
/api/v1/auth/token/refresh/
Refresh access token
GET/PATCH
/api/v1/auth/profile/
View / update profile
Products
Method
Endpoint
Description
GET
/api/v1/products/
List products (filter, search, sort)
GET
/api/v1/products/featured/
Featured products
GET
/api/v1/products/search/?q=iphone
Smart search
GET
/api/v1/products/<slug>/
Product detail
GET
/api/v1/products/<slug>/related/
Related products
GET/POST
/api/v1/products/<slug>/reviews/
Reviews
GET/POST
/api/v1/products/categories/
Categories
Cart
Method
Endpoint
Description
GET
/api/v1/cart/
View cart (Redis cached)
POST
/api/v1/cart/items/
Add item
PATCH
/api/v1/cart/items/<id>/
Update quantity
DELETE
/api/v1/cart/items/<id>/
Remove item
POST
/api/v1/cart/coupon/
Apply coupon
DELETE
/api/v1/cart/coupon/
Remove coupon
Orders
Method
Endpoint
Description
GET
/api/v1/orders/
My orders
POST
/api/v1/orders/place/
Place order from cart
GET
/api/v1/orders/<id>/
Order detail + timeline
POST
/api/v1/orders/<id>/cancel/
Cancel order
Payments
Method
Endpoint
Description
POST
/api/v1/payments/create/
Create Razorpay order
POST
/api/v1/payments/verify/
Verify payment signature
GET
/api/v1/payments/<order_id>/detail/
Payment status
POST
/api/v1/payments/<order_id>/retry/
Retry failed payment
POST
/api/v1/payments/webhook/razorpay/
Razorpay webhook
Wishlist
Method
Endpoint
Description
GET
/api/v1/wishlist/
View wishlist
POST
/api/v1/wishlist/items/
Add product
DELETE
/api/v1/wishlist/items/<id>/
Remove product
PATCH
/api/v1/wishlist/items/<id>/alert/
Set price alert
GET
/api/v1/wishlist/recommendations/
Get recommendations
💳 Razorpay Integration Flow
1. POST /api/v1/payments/create/ → Get razorpay_order_id
2. Use Razorpay JS SDK on frontend → User completes payment
3. POST /api/v1/payments/verify/ → Verify signature, confirm order
4. Webhook /payments/webhook/ → Server-to-server confirmation backup
5. POST /payments/<id>/retry/ → Retry on failure (max 3 attempts)