API Documentation
Complete REST API reference for the Smart Warehouse Management System
Authentication
Currently, the API does not require authentication for demo purposes. In production, implement proper API key or JWT authentication.
Base URL
Development: http://localhost:8000/api
Production: https://your-domain.com/api
Inventory Management
Get Inventory Summary
GET /api/inventory/summary
Returns a summary of all inventory items with stock levels and alerts.
Response Example:
{
"success": true,
"total_products": 1250,
"total_value": 458750.50,
"low_stock_items": 12,
"out_of_stock_items": 3,
"categories": {
"Electronics": 450,
"Hardware": 380,
"Accessories": 420
}
}
Update Stock Level
POST /api/inventory/update
Update stock level for a specific product.
Request Body:
{
"sku": "PROD001",
"quantity": 100,
"operation": "add"
}
Chatbot Integration
Send Message to AI Assistant
POST /api/chat/message
Send a message to the AI chatbot and receive intelligent responses.
Request Body:
{
"message": "Check stock for SKU: PROD001",
"session_id": "optional-session-id"
}
Response Example:
{
"success": true,
"message": "Product PROD001 (Wireless Mouse) currently has 45 units in stock. Stock level is healthy.",
"action_taken": "inventory_check_PROD001",
"suggestions": [
"Update stock level",
"View product details",
"Generate reorder report"
]
}
Dashboard Data
Get Dashboard Overview
GET /api/dashboard/overview
Returns comprehensive dashboard data including metrics and recent activities.
Response Example:
{
"success": true,
"metrics": {
"total_products": 1250,
"total_orders": 89,
"pending_shipments": 12,
"revenue_today": 15750.00
},
"recent_activities": [
{
"type": "order",
"description": "Order #ORD001 processed",
"timestamp": "2025-06-28T10:30:00Z"
}
],
"alerts": [
{
"type": "low_stock",
"message": "3 products are running low on stock",
"priority": "medium"
}
]
}
Forecasting & Analytics
Get Demand Forecast
GET /api/forecasting/demand?weeks=4
Generate demand forecasting for products over specified time period.
Get Space Optimization
GET /api/space/optimization
Get recommendations for optimizing warehouse space allocation.
Order Management
Create New Order
POST /api/orders/create
Get Order Status
GET /api/orders/{order_id}/status
Dispatch Order
POST /api/orders/{order_id}/dispatch
Error Handling
The API uses standard HTTP status codes and returns error details in JSON format:
{
"success": false,
"error": "Product not found",
"error_code": "PRODUCT_NOT_FOUND",
"details": "No product found with SKU: INVALID001"
}
Common Status Codes:
- 200 - Success
- 400 - Bad Request
- 404 - Not Found
- 500 - Internal Server Error
Rate Limiting
API requests are limited to prevent abuse:
- 100 requests per minute per IP address
- 1000 requests per hour per API key (when authentication is enabled)
SDK & Libraries
Official SDKs and libraries will be available for:
- Python (requests-based client)
- JavaScript/Node.js
- cURL examples for all endpoints
For detailed implementation examples, visit the GitHub repository.