{"openapi":"3.0.0","info":{"title":"ILB Mart API Documentation","version":"2.0.0","description":"Complete API documentation for ILB Mart - Pincode-based e-commerce platform","contact":{"name":"ILB Mart Team","email":"support@ilbmart.com"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"http://localhost:3005","description":"Development server"},{"url":"https://api.ilbmart.com","description":"Production server"}],"tags":[{"name":"Food Discovery","description":"Home screen, restaurant discovery, and search"},{"name":"Food Cart","description":"Cart management (requires user authentication)"},{"name":"Food Orders","description":"Order placement, tracking, and management (requires user authentication)"}],"components":{"securitySchemes":{"userAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"User authentication token"},"adminAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Admin authentication token"},"sellerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Seller authentication token"},"deliveryAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Delivery Boy authentication token"},"restaurantAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Restaurant/Food Seller authentication token"}},"schemas":{"Error":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"string","example":"Error message"}}},"Success":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object"}}},"User":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"email":{"type":"string"},"mobile":{"type":"string"},"avatar":{"type":"string"},"default_pincode":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"Admin":{"type":"object","properties":{"id":{"type":"integer","example":1},"name":{"type":"string","example":"Admin User"},"email":{"type":"string","example":"admin@ilbmart.com"},"mobile":{"type":"string","example":"9876543210"},"username":{"type":"string","example":"admin"},"role_id":{"type":"integer","example":1},"status":{"type":"integer","example":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Role":{"type":"object","properties":{"id":{"type":"integer","example":1},"name":{"type":"string","example":"Super Admin"},"description":{"type":"string","example":"Full system access"},"permissions":{"type":"array","items":{"type":"string"},"example":["dashboard","users","orders","finance"]},"status":{"type":"integer","example":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Seller":{"type":"object","properties":{"id":{"type":"integer","example":1,"description":"Seller unique identifier"},"name":{"type":"string","example":"Fresh Foods Store","description":"Seller name","maxLength":255},"email":{"type":"string","example":"seller@example.com","description":"Seller email address","maxLength":255},"mobile":{"type":"string","example":"9876543210","nullable":true,"description":"Seller mobile number","maxLength":15},"address":{"type":"string","example":"123 Market Street","nullable":true,"description":"Seller address"},"pincode":{"type":"string","example":"400001","nullable":true,"description":"Seller pincode","maxLength":10},"status":{"type":"integer","example":1,"description":"Seller status (0=inactive, 1=active)","enum":[0,1]},"image":{"type":"string","example":"https://example.com/seller.jpg","nullable":true,"description":"Seller profile image URL","maxLength":250},"created_at":{"type":"string","format":"date-time","description":"Account creation timestamp","example":"2024-01-01T00:00:00.000Z"},"updated_at":{"type":"string","format":"date-time"},"country_id":{"type":"integer","description":"Country ID","example":1},"state_id":{"type":"integer","description":"State ID","example":1},"city_id":{"type":"integer","description":"City ID","example":1},"password":{"type":"string","description":"Encrypted password","maxLength":255,"example":"encrypted_password_hash"},"api_token":{"type":"string","nullable":true,"description":"Current API token","maxLength":255,"example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"update_at":{"type":"string","format":"date-time","description":"Last update timestamp","example":"2024-01-01T00:00:00.000Z"}},"additionalProperties":false},"Address":{"type":"object","properties":{"id":{"type":"integer","example":1},"seller_id":{"type":"integer","example":1},"country_id":{"type":"integer","example":1},"state_id":{"type":"integer","example":1},"city_id":{"type":"integer","example":1},"pincode":{"type":"string","example":"400001"},"local_area":{"type":"string","example":"Andheri West"},"landmark":{"type":"string","example":"Near Metro Station"},"address":{"type":"string","example":"123 Market Street"},"type":{"type":"string","enum":["billing","shipping"],"example":"shipping"},"is_primary":{"type":"boolean","example":true},"is_active":{"type":"boolean","example":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Product":{"type":"object","properties":{"id":{"type":"integer","example":1,"description":"Product unique identifier"},"name":{"type":"string","example":"Fresh Tomatoes","description":"Product name","maxLength":150},"description":{"type":"string","example":"Fresh organic tomatoes","nullable":true,"description":"Product description"},"base_price":{"type":"number","example":100},"sale_price":{"type":"number","example":80},"discount":{"type":"number","example":20},"qty":{"type":"integer","example":50,"nullable":true,"description":"Available quantity"},"qty_unit":{"type":"string","example":"kg"},"category_id":{"type":"integer","example":1},"brand_id":{"type":"integer","example":1,"description":"Brand ID"},"images":{"type":"array","items":{"type":"string"},"example":["https://example.com/image1.jpg"]},"status":{"type":"integer","example":1,"description":"Product status (0=inactive, 1=active)","enum":[0,1]},"seller_id":{"type":"integer","example":1},"pincode_id":{"type":"integer","example":1},"discount_type":{"type":"integer","example":1},"meta_title":{"type":"string","example":"Fresh Tomatoes - Organic"},"meta_keyword":{"type":"string","example":"tomatoes, fresh, organic"},"meta_desc":{"type":"string","example":"Fresh organic tomatoes from local farms"},"mfd_date":{"type":"string","format":"date","example":"2024-01-01"},"exp_date":{"type":"string","format":"date","example":"2024-01-15"},"new_lounch":{"type":"boolean","example":false},"is_popular":{"type":"boolean","example":true},"is_trending":{"type":"integer","example":1,"description":"Show in trending lists (0=no, 1=yes)","enum":[0,1]},"is_price_saver":{"type":"integer","example":1,"description":"Price-saver badge (0=no, 1=yes)","enum":[0,1]},"created_at":{"type":"string","format":"date-time","nullable":true,"description":"Creation timestamp","example":"2024-01-01T00:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last update timestamp","example":"2024-01-01T00:00:00.000Z"},"cat_id":{"type":"integer","description":"Category ID","example":1},"slug":{"type":"string","nullable":true,"description":"URL-friendly product slug","maxLength":256,"example":"fresh-tomatoes"},"act_price":{"type":"integer","description":"Actual price in paise/cents","example":10000},"price":{"type":"integer","description":"Selling price in paise/cents","example":8000},"product_code":{"type":"string","nullable":true,"description":"Product code/SKU","maxLength":50,"example":"TOM001"},"weight":{"type":"string","description":"Product weight/size","maxLength":50,"example":"1kg"},"image":{"type":"string","nullable":true,"description":"Product image URL","maxLength":250,"example":"https://example.com/tomato.jpg"},"fssi_code":{"type":"string","description":"FSSAI code","maxLength":25,"example":"12345678901234"},"sub_cat_id":{"type":"integer","nullable":true,"description":"Sub-category ID","example":null}},"additionalProperties":false},"Category":{"type":"object","properties":{"id":{"type":"integer","example":1,"description":"Category unique identifier"},"name":{"type":"string","example":"Vegetables","description":"Category name","maxLength":255},"description":{"type":"string","example":"Fresh vegetables category","nullable":true,"description":"Category description"},"parent_id":{"type":"integer","example":null,"nullable":true,"description":"Parent category ID (null for main categories)"},"image":{"type":"string","example":"https://example.com/category.jpg","nullable":true,"description":"Category thumbnail image URL","maxLength":255},"cat_id":{"type":"integer","nullable":true,"description":"Legacy category ID","example":null},"slug":{"type":"string","description":"URL-friendly category slug","maxLength":255,"example":"vegetables"},"show_home":{"type":"integer","description":"Show on homepage (0=no, 1=yes)","enum":[0,1],"example":1},"display_order":{"type":"integer","description":"Display order for sorting","default":0,"example":1},"status":{"type":"integer","description":"Category status (0=inactive, 1=active)","enum":[0,1],"example":1},"meta_title":{"type":"string","nullable":true,"description":"SEO meta title","maxLength":150,"example":"Fresh Vegetables - ILB Mart"},"meta_keyword":{"type":"string","nullable":true,"description":"SEO meta keywords","example":"vegetables, fresh, organic"},"meta_desc":{"type":"string","nullable":true,"description":"SEO meta description","example":"Fresh organic vegetables delivered to your door"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp","example":"2024-01-01T00:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp","example":"2024-01-01T00:00:00.000Z"}},"additionalProperties":false},"Order":{"type":"object","properties":{"id":{"type":"integer","example":1,"description":"Order unique identifier"},"order_id":{"type":"string","example":"ORD123456789","description":"Order ID string","maxLength":50},"customer_id":{"type":"integer","example":1,"description":"Customer ID"},"seller_id":{"type":"integer","example":1},"grand_total":{"type":"number","example":255,"format":"decimal","description":"Final total amount"},"order_status":{"type":"string","enum":["pending","processing","shipped","delivered","cancelled"],"example":"pending","description":"Current order status","maxLength":50},"payment_status":{"type":"string","enum":["pending","paid","failed"],"example":"pending","description":"Payment status","maxLength":50},"delivery_address":{"type":"string","example":"123 Customer Street"},"delivery_pincode":{"type":"string","example":"400001"},"tracking_number":{"type":"string","example":"TRK123456789"},"created_at":{"type":"string","format":"date-time","description":"Order creation timestamp","example":"2024-01-01T00:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp","example":"2024-01-01T00:00:00.000Z"},"pincode_id":{"type":"integer","description":"Pincode ID","example":1},"total_item":{"type":"integer","description":"Total number of items","example":5},"total_amount":{"type":"number","format":"decimal","description":"Total amount before discounts","example":250},"discount_amount":{"type":"number","format":"decimal","description":"Discount amount applied","default":0,"example":25},"other_charges":{"type":"number","format":"decimal","description":"Other charges (delivery, etc.)","default":0,"example":30},"payment_type":{"type":"string","description":"Payment method","maxLength":50,"enum":["cod","online","wallet"],"example":"cod"},"status":{"type":"integer","description":"Order status (0=inactive, 1=active)","enum":[0,1],"example":1}},"additionalProperties":false},"Offer":{"type":"object","properties":{"id":{"type":"integer","example":1},"seller_id":{"type":"integer","example":1},"title":{"type":"string","example":"Summer Sale"},"description":{"type":"string","example":"Get 20% off on all summer products"},"discount_type":{"type":"string","enum":["percentage","fixed"],"example":"percentage"},"discount_value":{"type":"number","example":20},"min_order_amount":{"type":"number","example":500},"max_discount":{"type":"number","example":200},"start_date":{"type":"string","format":"date","example":"2024-06-01"},"end_date":{"type":"string","format":"date","example":"2024-08-31"},"status":{"type":"string","enum":["active","inactive"],"example":"active"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"SellerBankAccount":{"type":"object","properties":{"id":{"type":"integer"},"account_holder_name":{"type":"string"},"account_number":{"type":"string","example":"xxxx1234"},"ifsc_code":{"type":"string"},"bank_name":{"type":"string"},"branch_name":{"type":"string"},"is_primary":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}},"SellerGstDetail":{"type":"object","properties":{"id":{"type":"integer"},"gst_number":{"type":"string"},"business_name":{"type":"string"},"business_address":{"type":"string"},"pan_number":{"type":"string"},"is_verified":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}},"SellerWallet":{"type":"object","properties":{"balance":{"type":"number"},"pending_balance":{"type":"number"},"total_earnings":{"type":"number"},"total_payouts":{"type":"number"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"SellerTransaction":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string","enum":["credit","debit"]},"amount":{"type":"number"},"description":{"type":"string"},"status":{"type":"string"},"reference_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"SellerOrderItem":{"type":"object","properties":{"id":{"type":"integer"},"order_id":{"type":"integer"},"product_id":{"type":"integer"},"qty":{"type":"integer"},"price":{"type":"number"},"status":{"type":"string"}}},"SellerNotification":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"message":{"type":"string"},"type":{"type":"string"},"is_read":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}},"DeliveryBoy":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"mobile":{"type":"string"},"status":{"type":"string","enum":["active","inactive"]}}},"PincodeServiceability":{"type":"object","properties":{"pincode":{"type":"string"},"delivery_available":{"type":"boolean"}}},"SellerApproval":{"type":"object","properties":{"id":{"type":"integer","example":1},"name":{"type":"string","example":"Fresh Foods Ltd"},"email":{"type":"string","example":"seller@example.com"},"mobile":{"type":"string","example":"9876543210"},"address":{"type":"string","example":"123 Market Street"},"pincode":{"type":"string","example":"400001"},"status":{"type":"string","enum":["pending","approved","rejected"],"example":"pending"},"submitted_at":{"type":"string","format":"date-time"},"documents":{"type":"object","properties":{"gst_certificate":{"type":"string"},"pan_card":{"type":"string"},"bank_details":{"type":"string"}}}}},"ProductApproval":{"type":"object","properties":{"id":{"type":"integer","example":1},"seller_id":{"type":"integer","example":1},"name":{"type":"string","example":"Fresh Tomatoes"},"description":{"type":"string","example":"Fresh organic tomatoes"},"base_price":{"type":"number","example":100},"sale_price":{"type":"number","example":80},"category_id":{"type":"integer","example":1},"brand_id":{"type":"integer","example":1},"status":{"type":"string","enum":["pending","approved","rejected"],"example":"pending"},"submitted_at":{"type":"string","format":"date-time"},"images":{"type":"array","items":{"type":"string"},"example":["https://example.com/image1.jpg"]}}},"Pagination":{"type":"object","properties":{"current_page":{"type":"integer","example":1},"per_page":{"type":"integer","example":10},"total":{"type":"integer","example":100},"total_pages":{"type":"integer","example":10},"has_next":{"type":"boolean","example":true},"has_prev":{"type":"boolean","example":false}}},"SellerStats":{"type":"object","properties":{"total_pending":{"type":"integer","example":25},"total_approved":{"type":"integer","example":150},"total_rejected":{"type":"integer","example":10},"approval_rate":{"type":"number","example":88.2}}},"ProductStats":{"type":"object","properties":{"total_pending":{"type":"integer","example":45},"total_approved":{"type":"integer","example":320},"total_rejected":{"type":"integer","example":15},"approval_rate":{"type":"number","example":91.4}}},"RecentApproval":{"type":"object","properties":{"id":{"type":"integer","example":1},"type":{"type":"string","enum":["seller","product"],"example":"seller"},"name":{"type":"string","example":"Fresh Foods Ltd"},"action":{"type":"string","enum":["approved","rejected"],"example":"approved"},"admin_name":{"type":"string","example":"Admin User"},"timestamp":{"type":"string","format":"date-time"}}},"UserLoginRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email","description":"User email address","maxLength":255,"example":"user@example.com"},"password":{"type":"string","description":"User password","minLength":1,"example":"password123"}},"additionalProperties":false},"UserRegisterRequest":{"type":"object","required":["name","email","password","mobile"],"properties":{"name":{"type":"string","description":"Full name of the user","minLength":2,"maxLength":255,"example":"John Doe"},"email":{"type":"string","format":"email","description":"Email address","maxLength":255,"example":"john@example.com"},"password":{"type":"string","description":"Password (minimum 6 characters)","minLength":6,"maxLength":255,"example":"password123"},"mobile":{"type":"string","description":"Mobile number (10-15 digits)","pattern":"^[0-9]{10,15}$","example":"9876543210"}},"additionalProperties":false},"SellerLoginRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email","description":"Seller email address","maxLength":255,"example":"seller@example.com"},"password":{"type":"string","description":"Seller password","minLength":1,"example":"password123"}},"additionalProperties":false},"SellerRegisterRequest":{"type":"object","required":["name","email","password","mobile","business_name","gst_number"],"properties":{"name":{"type":"string","description":"Full name of the seller","minLength":2,"maxLength":255,"example":"Jane Smith"},"email":{"type":"string","format":"email","description":"Email address","maxLength":255,"example":"jane@freshfoods.com"},"password":{"type":"string","description":"Password (minimum 6 characters)","minLength":6,"maxLength":255,"example":"password123"},"mobile":{"type":"string","description":"Mobile number (10-15 digits)","pattern":"^[0-9]{10,15}$","example":"9876543210"},"business_name":{"type":"string","description":"Business name","minLength":2,"maxLength":255,"example":"Fresh Foods Ltd"},"gst_number":{"type":"string","description":"GST registration number","minLength":15,"maxLength":15,"pattern":"^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$","example":"27AABCU9603R1ZX"}},"additionalProperties":false},"SendOTPRequest":{"type":"object","required":["mobile"],"properties":{"mobile":{"type":"string","description":"Mobile number to send OTP (10-15 digits)","pattern":"^[0-9]{10,15}$","example":"9876543210"}},"additionalProperties":false},"VerifyOTPRequest":{"type":"object","required":["mobile","otp"],"properties":{"mobile":{"type":"string","description":"Mobile number (10-15 digits)","pattern":"^[0-9]{10,15}$","example":"9876543210"},"otp":{"type":"string","description":"6-digit OTP","pattern":"^[0-9]{6}$","example":"123456"}},"additionalProperties":false},"UserData":{"type":"object","properties":{"id":{"type":"integer","description":"User unique identifier","example":1},"name":{"type":"string","description":"User full name","example":"John Doe"},"email":{"type":"string","description":"User email address","example":"john@example.com"},"mobile":{"type":"string","description":"User mobile number","example":"9876543210"},"pincode":{"type":"string","nullable":true,"description":"User default pincode","example":"400001"},"role":{"type":"string","description":"User role","example":"user"}},"additionalProperties":false},"SellerData":{"type":"object","properties":{"id":{"type":"integer","description":"Seller unique identifier","example":1},"name":{"type":"string","description":"Seller name","example":"Jane Smith"},"email":{"type":"string","description":"Seller email address","example":"jane@freshfoods.com"},"mobile":{"type":"string","description":"Seller mobile number","example":"9876543210"},"address":{"type":"string","nullable":true,"description":"Seller address","example":"123 Market Street"},"pincode":{"type":"string","nullable":true,"description":"Seller pincode","example":"400001"},"role":{"type":"string","description":"User role","example":"seller"}},"additionalProperties":false},"AuthResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Login successful"},"data":{"type":"object","properties":{"token":{"type":"string","description":"JWT authentication token","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"user":{"oneOf":[{"$ref":"#/components/schemas/UserData"},{"$ref":"#/components/schemas/SellerData"}]}},"additionalProperties":false}},"additionalProperties":false},"OTPResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"OTP sent successfully"},"data":{"type":"object","properties":{"mobile":{"type":"string","description":"Mobile number OTP was sent to","example":"9876543210"},"otp":{"type":"string","description":"OTP code (only shown in development mode)","nullable":true,"example":"123456"}},"additionalProperties":false}},"additionalProperties":false},"AdminLoginRequest":{"type":"object","required":["username","password"],"properties":{"username":{"type":"string","description":"Admin username, email, or mobile number","example":"admin@ilbmart.com"},"password":{"type":"string","description":"Admin password","example":"admin123"}},"additionalProperties":false},"AdminLoginResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Login successful"},"data":{"type":"object","properties":{"id":{"type":"integer","description":"Admin ID","example":1},"name":{"type":"string","description":"Admin full name","example":"Admin User"},"email":{"type":"string","description":"Admin email address","example":"admin@ilbmart.com"},"mobile":{"type":"string","description":"Admin mobile number","example":"9876543210"},"username":{"type":"string","description":"Admin username","example":"admin"},"role_id":{"type":"integer","description":"Admin role ID","example":1},"userType":{"type":"string","description":"User type identifier","example":"admin"},"apiToken":{"type":"string","description":"JWT authentication token","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}},"additionalProperties":false}},"additionalProperties":false},"AdminRegisterRequest":{"type":"object","required":["name","username","password","mobile","email"],"properties":{"name":{"type":"string","description":"Full name of the admin","minLength":2,"maxLength":255,"example":"John Doe"},"username":{"type":"string","description":"Unique username for the admin","minLength":3,"maxLength":100,"example":"johndoe"},"password":{"type":"string","description":"Password (minimum 6 characters)","minLength":6,"maxLength":255,"example":"password123"},"mobile":{"type":"string","description":"Mobile number (10-15 digits)","pattern":"^[0-9]{10,15}$","example":"9876543210"},"email":{"type":"string","format":"email","description":"Email address","maxLength":255,"example":"john@ilbmart.com"}},"additionalProperties":false},"AdminRegisterResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Admin registered successfully"},"data":{"type":"object","properties":{"id":{"type":"integer","description":"Generated admin ID","example":1},"name":{"type":"string","description":"Admin full name","example":"John Doe"},"username":{"type":"string","description":"Admin username","example":"johndoe"},"mobile":{"type":"string","description":"Admin mobile number","example":"9876543210"},"email":{"type":"string","description":"Admin email address","example":"john@ilbmart.com"}},"additionalProperties":false}},"additionalProperties":false},"AdminProfile":{"type":"object","properties":{"id":{"type":"integer","description":"Admin unique identifier","example":1},"name":{"type":"string","description":"Admin full name","maxLength":255,"example":"Admin User"},"email":{"type":"string","format":"email","description":"Admin email address","maxLength":255,"example":"admin@ilbmart.com"},"mobile":{"type":"string","description":"Admin mobile number","maxLength":15,"example":"9876543210"},"username":{"type":"string","description":"Admin username","maxLength":100,"example":"admin"},"role_id":{"type":"integer","description":"Admin role identifier","example":1},"status":{"type":"integer","description":"Admin status (0=inactive, 1=active)","enum":[0,1],"example":1},"api_token":{"type":"string","description":"Current API token (if logged in)","nullable":true,"maxLength":255,"example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"created_at":{"type":"string","format":"date-time","description":"Account creation timestamp","example":"2024-01-01T00:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp","example":"2024-01-01T00:00:00.000Z"}},"additionalProperties":false},"UpdateProfileRequest":{"type":"object","properties":{"name":{"type":"string","description":"Full name","minLength":2,"maxLength":255,"example":"Updated Admin Name"},"email":{"type":"string","format":"email","description":"Email address","maxLength":255,"example":"updated@ilbmart.com"},"mobile":{"type":"string","description":"Mobile number","pattern":"^[0-9]{10,15}$","example":"9876543210"},"password":{"type":"string","description":"New password (optional)","minLength":6,"maxLength":255,"example":"newpassword123"}},"additionalProperties":false},"ChangePasswordRequest":{"type":"object","required":["currentPassword","newPassword"],"properties":{"currentPassword":{"type":"string","description":"Current password","minLength":1,"example":"oldpassword123"},"newPassword":{"type":"string","description":"New password (minimum 6 characters)","minLength":6,"maxLength":255,"example":"newpassword123"}},"additionalProperties":false},"ForgotPasswordRequest":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","description":"Admin email address","maxLength":255,"example":"admin@ilbmart.com"}},"additionalProperties":false},"ResetPasswordRequest":{"type":"object","required":["resetToken","newPassword"],"properties":{"resetToken":{"type":"string","description":"Password reset token received via email","minLength":1,"example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"newPassword":{"type":"string","description":"New password (minimum 6 characters)","minLength":6,"maxLength":255,"example":"newpassword123"}},"additionalProperties":false},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"string","description":"Error message","example":"Invalid credentials"}},"additionalProperties":false},"SuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","description":"Success message","example":"Operation successful"},"data":{"type":"object","description":"Response data (varies by endpoint)","additionalProperties":true}},"additionalProperties":false},"CreateCategoryRequest":{"type":"object","required":["name","slug"],"properties":{"parent_id":{"type":"integer","nullable":true,"description":"Parent category ID (null for main categories)","example":null},"cat_id":{"type":"integer","nullable":true,"description":"Legacy category ID","example":null},"name":{"type":"string","description":"Category name","minLength":1,"maxLength":255,"example":"Fruits"},"slug":{"type":"string","description":"URL-friendly category slug","minLength":1,"maxLength":255,"example":"fruits"},"description":{"type":"string","nullable":true,"description":"Category description","example":"Fresh fruits category"},"show_home":{"type":"integer","description":"Show on homepage (0=no, 1=yes)","enum":[0,1],"default":0,"example":1},"image":{"type":"string","nullable":true,"description":"Category thumbnail image URL","maxLength":255,"example":"https://example.com/fruits.jpg"},"display_order":{"type":"integer","description":"Display order for sorting","default":0,"example":1},"status":{"type":"integer","description":"Category status (0=inactive, 1=active)","enum":[0,1],"default":1,"example":1},"meta_title":{"type":"string","nullable":true,"description":"SEO meta title","maxLength":150,"example":"Fresh Fruits - ILB Mart"},"meta_keyword":{"type":"string","nullable":true,"description":"SEO meta keywords","example":"fruits, fresh, organic"},"meta_desc":{"type":"string","nullable":true,"description":"SEO meta description","example":"Fresh organic fruits delivered to your door"}},"additionalProperties":false},"CreateProductRequest":{"type":"object","required":["name","cat_id","brand_id","act_price","price","weight","fssi_code"],"properties":{"name":{"type":"string","description":"Product name","minLength":1,"maxLength":150,"example":"Fresh Apples"},"cat_id":{"type":"integer","description":"Category ID","minimum":1,"example":2},"brand_id":{"type":"integer","description":"Brand ID","minimum":1,"example":1},"slug":{"type":"string","nullable":true,"description":"URL-friendly product slug","maxLength":256,"example":"fresh-apples"},"act_price":{"type":"integer","description":"Actual price in paise/cents","minimum":0,"example":15000},"price":{"type":"integer","description":"Selling price in paise/cents","minimum":0,"example":12000},"qty":{"type":"integer","nullable":true,"description":"Available quantity","minimum":0,"example":100},"product_code":{"type":"string","nullable":true,"description":"Product code/SKU","maxLength":50,"example":"APP001"},"weight":{"type":"string","description":"Product weight/size","minLength":1,"maxLength":50,"example":"1kg"},"image":{"type":"string","nullable":true,"description":"Product image URL","maxLength":250,"example":"https://example.com/apple.jpg"},"description":{"type":"string","nullable":true,"description":"Product description","example":"Fresh red apples"},"status":{"type":"integer","description":"Product status (0=inactive, 1=active)","enum":[0,1],"default":1,"example":1},"fssi_code":{"type":"string","description":"FSSAI code","minLength":1,"maxLength":25,"example":"12345678901234"},"is_trending":{"type":"integer","description":"Show in trending lists (0=no, 1=yes)","enum":[0,1],"default":0,"example":1},"is_price_saver":{"type":"integer","description":"Price-saver badge (0=no, 1=yes)","enum":[0,1],"default":0,"example":1},"sub_cat_id":{"type":"integer","nullable":true,"description":"Sub-category ID","example":null}},"additionalProperties":false},"Customer":{"type":"object","properties":{"id":{"type":"integer","description":"Customer unique identifier","example":1},"name":{"type":"string","nullable":true,"description":"Customer full name","maxLength":255,"example":"John Customer"},"email":{"type":"string","nullable":true,"description":"Customer email address","maxLength":255,"example":"customer@example.com"},"mobile":{"type":"string","nullable":true,"description":"Customer mobile number","maxLength":15,"example":"9876543210"},"country_id":{"type":"integer","nullable":true,"description":"Country ID","example":1},"state_id":{"type":"integer","nullable":true,"description":"State ID","example":1},"city_id":{"type":"integer","nullable":true,"description":"City ID","example":1},"pincode":{"type":"string","nullable":true,"description":"Customer pincode","maxLength":10,"example":"400001"},"address":{"type":"string","nullable":true,"description":"Customer address","example":"123 Customer Street, Mumbai"},"password":{"type":"string","nullable":true,"description":"Encrypted password","maxLength":255,"example":"encrypted_password_hash"},"status":{"type":"integer","description":"Customer status (0=inactive, 1=active)","enum":[0,1],"example":1},"api_token":{"type":"string","nullable":true,"description":"Current API token","maxLength":255,"example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"image":{"type":"string","nullable":true,"description":"Customer profile image URL","maxLength":250,"example":"https://example.com/customer.jpg"},"created_at":{"type":"string","format":"date-time","description":"Account creation timestamp","example":"2024-01-01T00:00:00.000Z"},"update_at":{"type":"string","format":"date-time","description":"Last update timestamp","example":"2024-01-01T00:00:00.000Z"}},"additionalProperties":false},"PaginationResponse":{"type":"object","properties":{"totalRecords":{"type":"integer","description":"Total number of records","example":100},"totalPages":{"type":"integer","description":"Total number of pages","example":10},"currentPage":{"type":"integer","description":"Current page number","example":1},"pageSize":{"type":"integer","description":"Number of items per page","example":10}},"additionalProperties":false},"ListResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"type":"object"},"description":"Array of data items"},"pagination":{"$ref":"#/components/schemas/PaginationResponse"}},"additionalProperties":false},"DeliveryRegistration":{"type":"object","required":["name","mobile","password","driving_license","vehicle_registration","id_proof"],"properties":{"name":{"type":"string","description":"Full name of the delivery partner"},"mobile":{"type":"string","description":"Unique mobile number"},"password":{"type":"string","format":"password"},"service_type":{"type":"string","enum":["FOOD","GROCERY","BOTH"],"default":"BOTH"},"vehicle_details":{"type":"object","properties":{"type":{"type":"string","example":"bike"},"model":{"type":"string","example":"Honda Activa"},"number":{"type":"string","example":"MH12AB1234"}}},"profile_image":{"type":"string","format":"binary"},"driving_license":{"type":"string","format":"binary"},"vehicle_registration":{"type":"string","format":"binary"},"id_proof":{"type":"string","format":"binary"}}},"FoodRestaurant":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"status":{"type":"string","enum":["PENDING","APPROVED","REJECTED","SUSPENDED"]}}},"FoodOrder":{"type":"object","properties":{"id":{"type":"integer"},"order_status":{"type":"string"},"final_amount":{"type":"number"},"customer_name":{"type":"string"}}}}},"paths":{"/api/v1/food-admin/restaurant/status":{"post":{"summary":"Update Restaurant Status","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"type":"integer"},"status":{"type":"string","enum":["APPROVED","REJECTED","SUSPENDED"]}}}}}},"responses":{"200":{"description":"Status updated successfully"}}}},"/api/v1/food-admin/delivery/status":{"post":{"summary":"Update Delivery Partner Status","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"type":"integer"},"status":{"type":"string","enum":["APPROVED","REJECTED","SUSPENDED"]}}}}}},"responses":{"200":{"description":"Status updated successfully"}}}},"/api/v1/food-admin/refund/process":{"post":{"summary":"Process Refund","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["refundId","action"],"properties":{"refundId":{"type":"integer"},"action":{"type":"string","enum":["APPROVE","REJECT"]}}}}}},"responses":{"200":{"description":"Refund processed"}}}},"/api/v1/food-admin/penalty":{"post":{"summary":"Apply Penalty","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entity_type","entity_id","amount","reason"],"properties":{"entity_type":{"type":"string","enum":["RESTAURANT","DELIVERY"]},"entity_id":{"type":"integer"},"amount":{"type":"number"},"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"Penalty applied"}}}},"/api/v1/food-admin/payouts/generate":{"post":{"summary":"Generate Payouts","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["RESTAURANT","DELIVERY"]}}}}}},"responses":{"200":{"description":"Payouts generated"}}}},"/api/v1/food-admin/payouts/restaurant/mark-paid":{"post":{"summary":"Mark Restaurant Payout as Paid","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["payout_id","transaction_reference"],"properties":{"payout_id":{"type":"integer"},"transaction_reference":{"type":"string"},"payment_method":{"type":"string","default":"BANK_TRANSFER"},"notes":{"type":"string"}}}}}},"responses":{"200":{"description":"Payout marked as paid"}}}},"/api/v1/food-admin/payouts/delivery/mark-paid":{"post":{"summary":"Mark Delivery Payout as Paid","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["payout_id","transaction_reference"],"properties":{"payout_id":{"type":"integer"},"transaction_reference":{"type":"string"},"payment_method":{"type":"string","default":"BANK_TRANSFER"},"notes":{"type":"string"}}}}}},"responses":{"200":{"description":"Payout marked as paid"}}}},"/api/v1/food-admin/ops/orders-stuck":{"get":{"summary":"Get Stuck Orders","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"parameters":[{"in":"query","name":"hours","schema":{"type":"integer","default":2}}],"responses":{"200":{"description":"List of stuck orders"}}}},"/api/v1/food-admin/ops/sla-violations":{"get":{"summary":"Get SLA Violations","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"responses":{"200":{"description":"List of SLA violations"}}}},"/api/v1/food-admin/ops/restaurant-rejection-ratio":{"get":{"summary":"Get Restaurant Rejection Ratio","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"parameters":[{"in":"query","name":"restaurant_id","schema":{"type":"integer"}},{"in":"query","name":"days","schema":{"type":"integer","default":7}}],"responses":{"200":{"description":"List of rejection ratios"}}}},"/api/v1/food-admin/ops/delivery-cancellation-rate":{"get":{"summary":"Get Delivery Cancellation Rate","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"parameters":[{"in":"query","name":"delivery_boy_id","schema":{"type":"integer"}},{"in":"query","name":"days","schema":{"type":"integer","default":7}}],"responses":{"200":{"description":"List of cancellation rates"}}}},"/api/v1/food-admin/restaurants":{"get":{"summary":"List all restaurants","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"parameters":[{"in":"query","name":"status","schema":{"type":"string","enum":["PENDING","APPROVED","REJECTED","SUSPENDED"]}},{"in":"query","name":"search","schema":{"type":"string"}},{"in":"query","name":"page","schema":{"type":"integer"}}],"responses":{"200":{"description":"List of restaurants"}}}},"/api/v1/food-admin/delivery-partners":{"get":{"summary":"List all delivery partners","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"parameters":[{"in":"query","name":"status","schema":{"type":"string"}},{"in":"query","name":"is_available","schema":{"type":"boolean"}},{"in":"query","name":"search","schema":{"type":"string"}}],"responses":{"200":{"description":"List of delivery partners"}}}},"/api/v1/food-admin/orders":{"get":{"summary":"List all food orders","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"parameters":[{"in":"query","name":"status","schema":{"type":"string"}},{"in":"query","name":"restaurant_id","schema":{"type":"integer"}},{"in":"query","name":"start_date","schema":{"type":"string","format":"date"}},{"in":"query","name":"end_date","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"List of food orders"}}}},"/api/v1/food-admin/orders/{id}":{"get":{"summary":"Get food order details","tags":["Food Admin Operations"],"security":[{"adminAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Order details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodOrder"}}}}}}},"/api/v1/food/home":{"get":{"summary":"Food Home Screen (Aggregated)","description":"Returns all home screen sections in one call: offers, cuisines, popular dishes, and nearby restaurants.\nUses graceful degradation — if a section fails, it returns an empty array instead of failing entirely.\n","tags":["Food Discovery"],"parameters":[{"in":"query","name":"lat","required":true,"schema":{"type":"number","example":28.5355},"description":"User latitude"},{"in":"query","name":"lng","required":true,"schema":{"type":"number","example":77.391},"description":"User longitude"},{"in":"query","name":"pincode","schema":{"type":"string","example":"201301"},"description":"Optional pincode for filtering"},{"in":"query","name":"business_type","schema":{"type":"string","enum":["FOOD","CATERING","RO_WATER","ICE_CREAM"]},"description":"Filter the home feed by specific business type"}],"responses":{"200":{"description":"Home screen data","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"offers":{"type":"array","items":{"type":"object"}},"quick_cuisines":{"type":"array","items":{"type":"object"}},"popular_dishes":{"type":"array","items":{"type":"object"}},"nearby_restaurants":{"type":"array","items":{"type":"object"}},"explore_cuisines":{"type":"array","items":{"type":"object"}}}}}}}}},"400":{"description":"Missing or invalid lat/lng"}}}},"/api/v1/food/home/offers":{"get":{"summary":"Get Food Offers","description":"Standalone endpoint for offers (for refresh/pagination).","tags":["Food Discovery"],"responses":{"200":{"description":"List of active offers"}}}},"/api/v1/food/home/cuisines":{"get":{"summary":"Get Quick Cuisines","description":"Standalone endpoint for quick cuisine categories.","tags":["Food Discovery"],"responses":{"200":{"description":"List of cuisine categories"}}}},"/api/v1/food/home/popular-dishes":{"get":{"summary":"Get Popular Dishes","description":"Standalone endpoint for trending/popular dishes.","tags":["Food Discovery"],"responses":{"200":{"description":"List of popular dishes"}}}},"/api/v1/food/home/nearby-restaurants":{"get":{"summary":"Get Nearby Restaurants","description":"Standalone endpoint for nearby restaurants based on location.","tags":["Food Discovery"],"parameters":[{"in":"query","name":"lat","required":true,"schema":{"type":"number","example":28.5355}},{"in":"query","name":"lng","required":true,"schema":{"type":"number","example":77.391}},{"in":"query","name":"limit","schema":{"type":"integer","default":20,"example":20}},{"in":"query","name":"business_type","schema":{"type":"string","enum":["FOOD","CATERING","RO_WATER","ICE_CREAM"]},"description":"Filter by precise business type"}],"responses":{"200":{"description":"List of nearby restaurants with distance"},"400":{"description":"Missing lat/lng parameters"}}}},"/api/v1/food/restaurants/search":{"get":{"summary":"Search Restaurants","description":"Search restaurants by keyword, location, or pincode within a 20km radius.","tags":["Food Discovery"],"parameters":[{"in":"query","name":"lat","schema":{"type":"number","example":28.5355},"description":"User latitude (for distance calculation)"},{"in":"query","name":"lng","schema":{"type":"number","example":77.391},"description":"User longitude"},{"in":"query","name":"keyword","schema":{"type":"string","example":"pizza"},"description":"Search keyword (restaurant name)"},{"in":"query","name":"pincode","schema":{"type":"string","example":"201301"},"description":"Filter by pincode"},{"in":"query","name":"business_type","schema":{"type":"string","enum":["FOOD","CATERING","RO_WATER","ICE_CREAM"]},"description":"Filter to specific types like CATERING or RO_WATER"}],"responses":{"200":{"description":"List of matching restaurants with distance","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image_url":{"type":"string"},"distance":{"type":"number","description":"Distance in km"}}}}}}}}}}}},"/api/v1/food/dishes/search":{"get":{"summary":"Search by Dish / Food Item","description":"Search restaurants by dish name. Returns restaurants that serve matching dishes.","tags":["Food Discovery"],"parameters":[{"in":"query","name":"query","required":true,"schema":{"type":"string","example":"biryani"},"description":"Dish name to search"},{"in":"query","name":"lat","schema":{"type":"number","example":28.5355}},{"in":"query","name":"lng","schema":{"type":"number","example":77.391}},{"in":"query","name":"pincode","schema":{"type":"string","example":"201301"}},{"in":"query","name":"business_type","schema":{"type":"string","enum":["FOOD","CATERING","RO_WATER","ICE_CREAM"]},"description":"Filter dishes by specific business area"}],"responses":{"200":{"description":"Restaurants serving the searched dish","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"matching_dishes":{"type":"string","description":"Comma-separated matching dish names"},"dish_count":{"type":"integer"},"distance":{"type":"number"}}}},"meta":{"type":"object","properties":{"searchQuery":{"type":"string"},"resultCount":{"type":"integer"}}}}}}}},"400":{"description":"Missing search query"}}}},"/api/v1/food/restaurants/{id}":{"get":{"summary":"Get Restaurant Details","description":"Get full details of a specific restaurant including address, rating, and preparation time.","tags":["Food Discovery"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"},"description":"Restaurant ID"}],"responses":{"200":{"description":"Restaurant details","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image_url":{"type":"string"},"rating":{"type":"number"},"preparation_time":{"type":"integer","description":"Avg preparation time in minutes"},"address_line":{"type":"string"},"city":{"type":"string"},"pincode":{"type":"string"}}}}}}}},"404":{"description":"Restaurant not found or not approved"}}}},"/api/v1/food/restaurants/{id}/menu":{"get":{"summary":"Get Restaurant Menu","description":"Returns menu grouped by categories with all active items.","tags":["Food Discovery"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"},"description":"Restaurant ID"}],"responses":{"200":{"description":"Menu categorized with items","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","example":"Starters"},"sort_order":{"type":"integer"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","example":"Paneer Tikka"},"price":{"type":"number","example":199},"description":{"type":"string"},"is_veg":{"type":"boolean"},"image_url":{"type":"string"}}}}}}}}}}}},"404":{"description":"Restaurant not found or inactive"}}}},"/api/v1/food/cart":{"get":{"summary":"Get Cart","description":"Get current cart with items, restaurant info, and total.","tags":["Food Cart"],"security":[{"userAuth":[]}],"responses":{"200":{"description":"Cart details","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"cart_id":{"type":"integer"},"restaurant":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"image_url":{"type":"string"}}},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"menu_item_id":{"type":"integer"},"name":{"type":"string"},"price":{"type":"number"},"quantity":{"type":"integer"},"is_veg":{"type":"boolean"},"image_url":{"type":"string"}}}},"total":{"type":"number"}}}}}}}}}}},"/api/v1/food/cart/summary":{"get":{"summary":"Get Cart Summary","description":"Full checkout summary with item breakdown, taxes, delivery fee, and grand total.","tags":["Food Cart"],"security":[{"userAuth":[]}],"responses":{"200":{"description":"Cart summary with pricing breakdown"}}}},"/api/v1/food/cart/add":{"post":{"summary":"Add Item to Cart","description":"Add a menu item to the cart. Enforces single-restaurant rule — if cart has items from another restaurant, returns 409 error.\nSupports both `menu_item_id` and `item_id` parameter names.\n","tags":["Food Cart"],"security":[{"userAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["restaurant_id","menu_item_id","quantity"],"properties":{"restaurant_id":{"type":"integer","example":39,"description":"Restaurant ID"},"menu_item_id":{"type":"integer","example":43,"description":"Menu item ID"},"quantity":{"type":"integer","example":1,"description":"Quantity to add"}}}}}},"responses":{"200":{"description":"Item added to cart","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Added to cart"}}}}}},"400":{"description":"Item not available or restaurant not active"},"409":{"description":"Cart contains items from another restaurant"}}}},"/api/v1/food/cart/update":{"post":{"summary":"Update Cart Item Quantity","description":"Update quantity of an existing cart item. Set quantity to 0 to remove the item.","tags":["Food Cart"],"security":[{"userAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cart_item_id","quantity"],"properties":{"cart_item_id":{"type":"integer","description":"Cart item ID (not menu item ID)"},"quantity":{"type":"integer","description":"New quantity (0 to remove)"}}}}}},"responses":{"200":{"description":"Cart updated"}}}},"/api/v1/food/cart/item/{itemId}":{"delete":{"summary":"Remove Cart Item","description":"Remove a specific item from the cart.","tags":["Food Cart"],"security":[{"userAuth":[]}],"parameters":[{"in":"path","name":"itemId","required":true,"schema":{"type":"integer"},"description":"Cart item ID to remove"}],"responses":{"200":{"description":"Item removed from cart"}}}},"/api/v1/food/cart/clear":{"delete":{"summary":"Clear Entire Cart","description":"Remove all items and reset the cart.","tags":["Food Cart"],"security":[{"userAuth":[]}],"responses":{"200":{"description":"Cart cleared"}}}},"/api/v1/food/orders/validate":{"post":{"summary":"Validate Order (Pre-check)","description":"Validate cart before placing the order. Checks item availability, restaurant status,\ndelivery distance, and calculates final pricing.\n","tags":["Food Orders"],"security":[{"userAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"address_id":{"type":"integer","description":"Delivery address ID"}}}}}},"responses":{"200":{"description":"Validation result with price breakdown"},"400":{"description":"Validation failed (items unavailable, out of range, etc.)"}}}},"/api/v1/food/orders":{"post":{"summary":"Place Order","description":"Place a food order from the current cart. ACID-hardened with state machine guards.\nSupports idempotency via `X-Idempotency-Key` header.\nCreates a delivery task automatically upon order placement.\n","tags":["Food Orders"],"security":[{"userAuth":[]}],"parameters":[{"in":"header","name":"X-Idempotency-Key","schema":{"type":"string"},"description":"Optional idempotency key to prevent duplicate orders"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address_id":{"type":"integer","description":"Delivery address ID (uses primary address if not provided)"},"payment_method":{"type":"string","enum":["COD","ONLINE","WALLET"],"example":"COD","description":"Payment method (also accepts payment_mode)"},"payment_transaction_id":{"type":"string","description":"Transaction ID for online payments"}}}}}},"responses":{"200":{"description":"Order placed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"orderId":{"type":"integer","example":35},"orderCode":{"type":"string","example":"FO1771015581553476"},"finalAmount":{"type":"number","example":162.9},"paymentStatus":{"type":"string","example":"PENDING"},"taskId":{"type":"integer","description":"Auto-created delivery task ID"}}}}}}}},"400":{"description":"Cart empty, items unavailable, or out of delivery range"}}},"get":{"summary":"Get Order History","description":"Get all food orders for the authenticated user.","tags":["Food Orders"],"security":[{"userAuth":[]}],"responses":{"200":{"description":"List of past orders"}}}},"/api/v1/food/orders/{id}":{"get":{"summary":"Get Order Details","description":"Get detailed information about a specific order including items.","tags":["Food Orders"],"security":[{"userAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"},"description":"Order ID"}],"responses":{"200":{"description":"Order details with items"},"404":{"description":"Order not found"}}}},"/api/v1/food/orders/{id}/track":{"get":{"summary":"Track Order","description":"Get real-time order status including delivery partner info and location.\nStatus flow: PLACED → ACCEPTED → PREPARING → READY_FOR_PICKUP → OUT_FOR_DELIVERY → DELIVERED\n","tags":["Food Orders"],"security":[{"userAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Order tracking information","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"order_status":{"type":"string","enum":["PLACED","ACCEPTED","PREPARING","READY_FOR_PICKUP","OUT_FOR_DELIVERY","DELIVERED","CANCELLED"]},"delivery_partner":{"type":"object"},"estimated_time":{"type":"string"}}}}}}}}}}},"/api/v1/food/orders/{id}/payment-status":{"get":{"summary":"Get Payment Status","description":"Check the payment status for a specific order.","tags":["Food Orders"],"security":[{"userAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Payment status details"}}}},"/api/v1/food/orders/{id}/cancel":{"post":{"summary":"Cancel Order","description":"Cancel an order. ACID-hardened with state machine guards.\nOnly cancellable in PLACED or ACCEPTED state.\nAutomatically initiates refund if payment was made and cancels delivery task.\n","tags":["Food Orders"],"security":[{"userAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Order cancelled successfully"},"400":{"description":"Order cannot be cancelled in current state"},"404":{"description":"Order not found"}}}},"/api/v1/food/orders/{id}/reorder":{"post":{"summary":"Reorder","description":"Re-add items from a previous order to the cart for quick reordering.","tags":["Food Orders"],"security":[{"userAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Items added to cart from previous order"},"404":{"description":"Order not found"}}}},"/api/v1/food/orders/{id}/retry-payment":{"post":{"summary":"Retry Payment","description":"Retry a failed payment for an existing order.\nACID-hardened with strict guards. Only works for orders with FAILED payment status.\n","tags":["Food Orders"],"security":[{"userAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"payment_method":{"type":"string","enum":["COD","ONLINE","WALLET"]},"payment_transaction_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Payment retried successfully"},"400":{"description":"Payment retry not applicable"}}}},"/api/v1/food/orders/{id}/rate":{"post":{"summary":"Rate Order","description":"Rate a delivered order (1-5 stars). Updates the restaurant's average rating.","tags":["Food Orders"],"security":[{"userAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rating"],"properties":{"rating":{"type":"integer","minimum":1,"maximum":5,"example":4,"description":"Rating from 1 to 5"},"comment":{"type":"string","example":"Great food, loved the paneer tikka!","description":"Optional review comment"}}}}}},"responses":{"200":{"description":"Rating submitted successfully"},"400":{"description":"Invalid rating or order not delivered yet"},"404":{"description":"Order not found"}}}}}}