Authentication
Admin login and session management
Loading API documentation…
Version 1.0.0
RESTful API for the Chinni Treasure — Little Love luxury e-commerce platform. Supports product catalog browsing, order placement and tracking, admin dashboard analytics, and secure JWT-based administrator authentication.
/api/auth/loginAuthentication
adminLoginapplication/jsonAdmin username
Admin password
{
"username": "admin",
"password": "your-password"
}Login successful. Sets HttpOnly session cookie.
Missing required fields
Invalid credentials
Rate limited — 5 attempts per minute per IP
/api/auth/logoutAuthentication
adminLogoutSession cookie cleared
/api/auth/meAuthentication
getSessionUser is authenticated
No valid session
/api/categoriesCategories
listCategoriesArray of categories
Server error
/api/categoriesCategories
createCategoryapplication/jsonKebab-case slug. Auto-generated from name if omitted.
Category created
Validation error
Unauthorized
Slug already exists
/api/categories/latestCategories
Returns the newest in-stock, active product for every active category. Uses a single nested query to avoid N+1.
latestPerCategoryArray of { category, product } envelopes
Server error
/api/categories/{id}Categories
updateCategoryapplication/jsonCategory updated
Validation error
Unauthorized
Category not found
Slug already exists
/api/categories/{id}Categories
deleteCategoryCategory deleted
Unauthorized
Category not found
Category has active products and cannot be deleted
/api/category/{slug}/productsCategories
categoryProductsPaginated products for the category
Category not found or inactive
Server error
/api/productsProducts
listProductsArray of active products with category info
/api/productsProducts
createProductAdmin session requiredapplication/jsonStock keeping unit
Product name
Current selling price
Original/comparison price (MRP) for showing discounts
Product created successfully
Name and price are required
Unauthorized
/api/products/{id}Products
updateProductAdmin session requiredapplication/jsonOriginal/comparison price (MRP) for showing discounts
Product updated
Unauthorized
/api/products/{id}Products
deleteProductAdmin session requiredProduct deactivated
Unauthorized
/api/ordersOrders
listOrdersAdmin session requiredPaginated list of orders
Unauthorized
/api/ordersOrders
createOrderapplication/json10-digit phone
2-letter Indian state code
6-digit PIN
Order created successfully
Missing required fields or insufficient stock
Product not found
Conflict — retry your order
/api/orders/{id}Orders
getOrderFull order with items and status history
Order not found
/api/orders/{id}/statusOrders
updateOrderStatusAdmin session requiredapplication/jsonRequired when status is 'shipped'
For optimistic concurrency control
Order status updated
Tracking ID required for shipped, or invalid transition
Unauthorized
Order not found
Version conflict — order was modified by another request
/api/statsAnalytics
getDashboardStatsAdmin session requiredDashboard stats, chart data, and product sales
Unauthorized
/api/trackTracking
trackOrderMatching orders with item details
Provide orderId or phone parameter