ShopSphere API Reference
Base URL https://www.qapracticelabs.com/api/ecom. Send and accept JSON.
Authentication
Call POST /auth/login and send the returned token on every protected request, either as
Authorization: Bearer <token> or the bare Authorization: <token>. Tokens expire after 24 hours.
The UI keeps the session in localStorage under token, userId and userEmail:
set those three keys before opening a dashboard page to skip the login screen.
Send X-Chaos-Mode: 1 to get randomly delayed responses. Limits: 300 requests/min per user, 10 login attempts/min per email.
Test data
- Demo login:
demo@practice.test/Demo@1234 - Valid coupons:
PRACTICE10(10%),QA25(25%),FREESHIP(5%). Inactive:EXPIRED50 - Orders are deleted after 7 days; accounts (except the demo account) are deleted 30 days after registration, so register again after that.
Auth
POST
/auth/register
{"firstName":"Ada","lastName":"Lovelace","userEmail":"ada@example.com","userMobile":"9123456789","occupation":"Engineer","gender":"Female","userPassword":"Strong@123","confirmPassword":"Strong@123"} 201 {"message":"Registered Successfully"} · 400 duplicate email · 422 validation
POST
/auth/login
{"userEmail":"demo@practice.test","userPassword":"Demo@1234"} 200 {"token":"…","userId":"1","message":"Login Successfully"} · 401
POST
/auth/password-new
{"userEmail":"…","userMobile":"9123456789","userPassword":"New@1234","confirmPassword":"New@1234"} 200 · 404 no match · 403 demo account
GET
/auth/me
token 200 {"userId","firstName","lastName","userEmail"}
POST
/auth/logout
token 200 {"message":"Logout Successfully"}
Products
POST
/product/get-all-products
token {"productName":"tee","minPrice":0,"maxPrice":5000,"productCategory":["fashion"],"productSubCategory":["t-shirts"],"productFor":["women"]} 200 {"data":[…],"count":n} — every field optional
GET
/product/get-product-detail/{id}
token 200 {"data":{…}} · 404
Cart
POST
/user/add-to-cart
token {"productId":1} 200 {"message":"Product Added To Cart","count":n}
GET
/user/get-cart-products
token 200 {"products":[{…,"quantity":n}],"count":n}
GET
/user/get-cart-count
token 200 {"count":n}
DELETE
/user/remove-from-cart/{productId}
token 200 · 404 not in cart
Orders
POST
/order/apply-coupon
token {"couponCode":"PRACTICE10"} 200 {"discountPercent":10} · 404 Invalid Coupon
POST
/order/create-order
token {"orders":[{"country":"Bangladesh","productOrderedId":1}],"couponCode":"PRACTICE10"} 201 {"orders":["<orderId>"],"productOrderId":["1"],"message":"Order Placed Successfully"}
GET
/order/get-orders-for-customer/{userId}
token 200 {"data":[…],"count":n} · 403 another user
GET
/order/get-orders-details?id={orderId}
token 200 · 403 "You are not authorize to view this order" · 404
DELETE
/order/delete-order/{orderId}
token 200 {"message":"Orders Deleted Successfully"} · 403
GET
/order/download-csv
token 200 text/csv attachment