Automatic Reordering System
Overview
The Auto-Reordering System monitors inventory levels and automatically generates purchase orders when stock falls below reorder points. This intelligent system prevents stockouts, optimizes inventory levels, and reduces manual procurement work.
Key Concepts
Reorder Point
The reorder point is the inventory quantity threshold that triggers an automatic reorder. When available stock (on-hand minus reserved) drops to or below this level, the system knows it's time to replenish.
Example:
Product: Premium Widget
Reorder Point: 50 units
Quantity On Hand: 45 units
Quantity Reserved: 0 units
Quantity Available: 45 units
Status: 45 ≤ 50 → NEEDS REORDERReorder Quantity
The reorder quantity is the suggested amount to order when restocking. This should bring inventory back to optimal levels while accounting for lead time and demand.
Example:
Product: Premium Widget
Reorder Point: 50 units (minimum safe level)
Reorder Quantity: 200 units (optimal stock level)
When available ≤ 50: Order 200 units
After receipt: Available = 245 units (safe buffer)Business Logic
The reorder system uses this logic:
quantity_available = quantity_on_hand - quantity_reserved
if (quantity_available <= reorder_point):
generate_purchase_order(product, reorder_quantity)Key Points:
- Uses available stock (on-hand minus reserved), not just on-hand
- Reserved stock is allocated to orders, so it's not available for new sales
- Reorder point should account for lead time + safety stock
- Reorder quantity should optimize order frequency vs holding costs
Inventory Model
Reorder Fields
Every inventory record has these optional reorder settings:
{
"id": 1,
"product_id": 101,
"warehouse_id": 1,
"quantity_on_hand": 45,
"quantity_reserved": 10,
"quantity_available": 35, // Computed: on_hand - reserved
"reorder_point": 50,
"reorder_quantity": 200,
"last_counted_at": "2025-12-15T10:30:00Z",
"last_movement_at": "2025-12-17T08:15:00Z"
}Field Definitions:
reorder_point(integer, nullable): Threshold quantity that triggers reorderreorder_quantity(integer, nullable): Suggested quantity to orderquantity_available(computed): on_hand - reserved (actual stock available for allocation)
Setting Reorder Points
Manual Configuration:
PUT /api/v1/operations/inventory/reorder-settingsRequest:
{
"product_id": 101,
"warehouse_id": 1,
"reorder_point": 50,
"reorder_quantity": 200
}Business Rules:
- Reorder point must be non-negative (>= 0)
- Reorder quantity must be positive (> 0)
- Reorder quantity should be greater than reorder point (best practice)
- Both can be null (disables auto-reorder for that product)
System Validation:
- If reorder_quantity ≤ reorder_point, validation warning is issued
- System recommends reorder_quantity > reorder_point for optimal inventory management
- Example: If reorder_point = 50, reorder_quantity should be at least 51 (typically much higher like 200)
Auto-Reorder Generation
API Endpoint
Endpoint: POST /api/v1/operations/purchase-orders/generate-reorders
Authentication: Required (Bearer token)
Route Name: purchase-orders.generate-reorders
Method: POST (state-changing operation)
Request
No parameters required - system automatically detects products needing reorder:
curl -X POST https://api.example.com/api/v1/operations/purchase-orders/generate-reorders \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json"Response
Success (200):
{
"message": "Reorder purchase orders generated successfully",
"data": [
{
"id": 78,
"order_number": "PO-202512-00078",
"status": "draft",
"supplier": {
"id": 12,
"name": "Acme Supplies Inc",
"email": "orders@acmesupplies.com"
},
"order_date": "2025-12-17",
"expected_delivery_date": "2025-12-24",
"total_amount": 3100.00,
"currency": "USD",
"line_items": [
{
"id": 234,
"product_id": 101,
"product_sku": "WIDGET-001",
"product_name": "Premium Widget",
"quantity_ordered": 200,
"unit_price": 15.50,
"line_total": 3100.00,
"warehouse_id": 1
}
],
"internal_notes": "Auto-generated reorder - stock below reorder point"
}
],
"count": 1
}No Reorders Needed (200):
{
"message": "Reorder purchase orders generated successfully",
"data": [],
"count": 0
}How It Works
Detection Algorithm
The system scans all inventory records to find products needing reorder:
SELECT * FROM operations_inventory
WHERE reorder_point IS NOT NULL
AND (quantity_on_hand - quantity_reserved) <= reorder_pointConditions for Auto-Reorder:
- Product has reorder_point configured (not null)
- Available stock ≤ reorder_point
- Product has preferred supplier configured
- Product is active (not discontinued)
PO Generation Logic
Current Implementation Note: The auto-reorder generation is currently a placeholder returning an empty collection. Full implementation follows this workflow:
Step 1: Find products needing reorder
- Query all inventory records with configured reorder points
- Filter where:
(quantity_on_hand - quantity_reserved) <= reorder_point - Load related product and preferred supplier information
Step 2: Group by supplier
- Organize low-stock products by their preferred supplier
- This allows creating one PO per supplier with multiple line items
- More efficient than separate POs for each product
Step 3: Create PO for each supplier
For each supplier group:
- Create new purchase order with:
- Supplier ID from the grouped products
- Status:
draft(requires approval before sending) - Order date: current date
- Expected delivery date: current date + supplier's lead time
- Internal notes: "Auto-generated reorder - stock below reorder point"
Step 4: Add line items
For each product in the supplier group:
- Create PO line item with:
- Product ID
- Quantity ordered: uses
reorder_quantity(or calculates optimal quantity if not set) - Unit price: uses last purchase price or product cost price
- Warehouse ID: destination warehouse for the stock
Return value:
- Collection of generated purchase orders in draft status
- Ready for review, approval, and sending
Supplier Selection
Preferred Supplier (Product-level configuration):
- Each product can have a designated preferred supplier
- Auto-reorders use preferred supplier automatically
- Ensures consistent quality and pricing
If No Preferred Supplier:
- Use last supplier from which product was purchased
- Or use default supplier for product category
- Or require manual supplier selection (PO stays in draft)
Warehouse Routing
Single Warehouse:
Product has inventory at Warehouse A only
→ Reorder sends to Warehouse AMulti-Warehouse:
Product has inventory at multiple warehouses:
- Warehouse A: available = 20, reorder_point = 50 → NEEDS REORDER
- Warehouse B: available = 100, reorder_point = 50 → OK
Generate PO line item for Warehouse A onlyEach warehouse's inventory is tracked independently.
Reorder Calculations
Determining Reorder Point
Formula:
reorder_point = (average_daily_usage × lead_time_days) + safety_stockExample:
Product: Premium Widget
Average Daily Sales: 5 units/day
Supplier Lead Time: 7 days
Safety Stock Buffer: 15 units
Reorder Point = (5 × 7) + 15 = 50 unitsRationale: When you hit 50 units, you have enough to last through the 7-day lead time (35 units) plus a 15-unit buffer for demand variance.
Determining Reorder Quantity
Economic Order Quantity (EOQ) Formula:
EOQ = √((2 × annual_demand × order_cost) / holding_cost_per_unit)Simplified Approach:
reorder_quantity = average_monthly_usage × reorder_frequency_monthsExample:
Product: Premium Widget
Average Monthly Sales: 150 units
Desired Reorder Frequency: 1.5 months (6 weeks)
Reorder Quantity = 150 × 1.5 = 225 units
Round to case pack: 200 unitsFactors to Consider:
- Order frequency (minimize handling overhead)
- Storage capacity (can you hold the quantity?)
- Perishability (don't over-order expiring goods)
- Supplier MOQs (minimum order quantities)
- Volume discounts (price breaks at certain quantities)
Suggested Quantity Calculation
The system calculates suggested reorder quantities using this logic:
Step 1: Check if reorder is needed
- If available stock is above reorder point, no suggestion provided
- Returns null (no reorder needed)
Step 2: Use configured reorder quantity
- If
reorder_quantityis configured (not null) - Return that specific value
- This is the preferred method (explicitly defined by user)
Step 3: Calculate deficit
- If
reorder_quantityis not configured - Calculate:
deficit = reorder_point - quantity_available - Return the deficit amount (quantity needed to reach reorder point)
Behavior Summary:
- If
reorder_quantityis configured → use that value - If not configured → suggest quantity to reach reorder point
- Ensures you don't order too little (always returns at least the deficit)
Workflow Integration
Manual Trigger
Use Case: Procurement manager reviews inventory and triggers reorder generation manually
Steps:
- Navigate to Inventory → Reorder Report
- Review products below reorder point
- Click "Generate Reorders" button
- System creates draft POs
- Review, modify if needed, approve, and send
Scheduled Automation
Use Case: System runs nightly to auto-generate reorders
Workflow:
- Scheduler executes at configured time (e.g., 2:00 AM)
- Calls the purchase order service to generate reorders
- Creates draft POs for all products below reorder points
- Optionally auto-approves POs below configured threshold
- Optionally auto-sends approved POs to suppliers
Auto-Approval Logic:
- Check each generated PO's total amount
- If below configured auto-approval limit (e.g., $1,000)
- Automatically approve and send the PO
- If above limit, leave in draft for manual review
Configuration Options:
- Schedule frequency (daily, hourly, etc.)
- Execution time (e.g., 2:00 AM when traffic is low)
- Auto-approval threshold amount
- Auto-send after approval (yes/no)
- Email notifications for generated orders
Event-Driven
Use Case: Trigger reorder immediately when inventory drops below threshold
Workflow:
- System listens for stock adjustment events
- When inventory is updated (sale, transfer, adjustment)
- Event handler checks if inventory now needs reorder
- If available stock ≤ reorder point, triggers PO generation
- Background job creates the purchase order
Advantages:
- Real-time response to stock changes
- Immediate reorder for critical items
- Prevents stockouts during high-demand periods
- No waiting for scheduled job
Considerations:
- May generate frequent small orders during busy periods
- Consider implementing cooldown period between reorders
- May want to batch orders if multiple products need reordering
- Balance immediacy with order efficiency
Monitoring & Reporting
Reorder Report
Endpoint: GET /api/v1/operations/inventory/reorder-report
Response:
{
"data": [
{
"product_id": 101,
"product_sku": "WIDGET-001",
"product_name": "Premium Widget",
"warehouse_id": 1,
"warehouse_name": "Main Warehouse",
"quantity_available": 35,
"reorder_point": 50,
"reorder_quantity": 200,
"deficit": 15,
"suggested_order_quantity": 200,
"preferred_supplier": {
"id": 12,
"name": "Acme Supplies Inc"
},
"last_purchase_date": "2025-11-15",
"average_daily_usage": 5.2,
"days_until_stockout": 6
}
],
"summary": {
"total_products_needing_reorder": 1,
"total_suggested_order_value": 3100.00,
"by_warehouse": {
"Main Warehouse": 1
},
"by_supplier": {
"Acme Supplies Inc": 1
}
}
}Use Cases:
- Daily review of products needing reorder
- Planning procurement budget
- Identifying supplier concentration
- Forecasting warehouse capacity needs
Low Stock Alerts
Endpoint: GET /api/v1/operations/inventory/low-stock
Response:
{
"data": [
{
"product_id": 101,
"sku": "WIDGET-001",
"name": "Premium Widget",
"warehouse_id": 1,
"quantity_available": 35,
"reorder_point": 50,
"status": "low_stock",
"urgency": "medium"
}
]
}Urgency Levels:
critical: Available ≤ 25% of reorder pointhigh: Available ≤ 50% of reorder pointmedium: Available ≤ 75% of reorder pointlow: Available ≤ reorder point
Best Practices
Setting Reorder Points
1. Calculate Based on Data
- Don't guess - use historical sales data
- Account for lead time variability
- Include safety stock for demand spikes
- Review and adjust quarterly
2. Consider Product Characteristics
Fast-Moving Items (high turnover):
Higher reorder point, frequent orders
Example: reorder_point = 100, reorder_quantity = 500
Slow-Moving Items (low turnover):
Lower reorder point, larger quantities per order
Example: reorder_point = 10, reorder_quantity = 50
Seasonal Items:
Adjust reorder points before peak season
Reduce after season ends3. Account for Lead Time
Short Lead Time (2-3 days):
Lower reorder point acceptable
Example: reorder_point = 20
Long Lead Time (30+ days):
Higher reorder point required
Example: reorder_point = 200Optimizing Reorder Quantities
1. Balance Order Frequency vs Holding Costs
Order Too Often:
+ Lower inventory holding costs
- Higher order processing costs
- More staff time spent on receiving
Order Too Infrequently:
+ Lower order processing costs
- Higher inventory holding costs
- Risk of excess/obsolete stock2. Leverage Supplier Terms
Volume Discounts:
If 10% discount at 500 units → consider increasing reorder quantity
Free Shipping Threshold:
If free shipping at $2000 → bundle products to reach threshold
MOQ (Minimum Order Quantity):
Supplier requires 100 unit minimum → set reorder_quantity ≥ 1003. Case Pack Optimization
Supplier ships in case packs of 24 units
Calculated reorder quantity: 225 units
Round up: 225 ÷ 24 = 9.375 → 10 cases = 240 units
Better than: 225 units (would need 9 cases + 9 loose units)Automation Configuration
1. Start Conservative
Initial Setup:
Manual approval required for all auto-generated POs
Review for 2-4 weeks
Adjust reorder settings based on results2. Gradual Automation
Phase 1: Auto-generate, manual approve (draft → pending)
Phase 2: Auto-approve low-value POs (<$500)
Phase 3: Auto-approve + auto-send for trusted suppliers
Phase 4: Full automation with exception alerts3. Set Safety Limits
Configure system-wide safety limits to prevent issues:
auto_approve_limit: Maximum dollar amount for automatic approval (e.g., $1,000)max_reorder_quantity: Sanity check to prevent ordering excessive quantities (e.g., 10,000 units)min_days_between_orders: Cooldown period to prevent excessive ordering (e.g., 7 days)require_approval_for_new_suppliers: Force manual approval for orders from new suppliers (true/false)
Monitoring & Maintenance
1. Daily Checks
- Review reorder report
- Check for anomalies (huge quantities, wrong suppliers)
- Monitor auto-generated POs awaiting approval
2. Weekly Reviews
- Analyze stockouts (should be rare)
- Identify products frequently below reorder point
- Adjust reorder points as needed
3. Monthly Analysis
- Calculate inventory turnover
- Identify slow-moving stock
- Review supplier performance
- Optimize reorder quantities
4. Quarterly Updates
- Recalculate reorder points based on recent sales
- Account for seasonality
- Update supplier lead times
- Review and adjust automation rules
Troubleshooting
No POs Generated
Symptom: Generate-reorders returns empty array
Causes & Solutions:
No reorder points configured
sqlSELECT COUNT(*) FROM operations_inventory WHERE reorder_point IS NOT NULL;Solution: Configure reorder points for products
All stock levels above reorder points
sqlSELECT * FROM operations_inventory WHERE reorder_point IS NOT NULL AND (quantity_on_hand - quantity_reserved) <= reorder_point;Solution: This is good! No action needed
Products missing preferred supplier
- Check product configuration
- Assign preferred suppliers
- System may skip products without suppliers
Excessive Reorders
Symptom: Too many POs generated, ordering too frequently
Causes & Solutions:
Reorder point too high
- Recalculate based on actual lead time
- Reduce safety stock buffer
- Monitor for 2 weeks before adjusting
Reorder quantity too small
- Increase reorder_quantity
- Consider supplier MOQs and case packs
- Balance order frequency vs holding costs
System running too frequently
- Change from hourly to daily schedule
- Implement minimum days between orders check
- Add cooldown period after order generation
Stockouts Despite Auto-Reorder
Symptom: Products going out of stock even with reorder system
Root Causes:
Reorder point too low
Issue: Lead time increased but reorder point not updated Solution: Recalculate with current lead timeDemand spike
Issue: Sales exceeded historical average Solution: Increase safety stock bufferSupplier delays
Issue: PO sent but goods delayed Solution: Find backup supplier, increase reorder pointReserved stock not accounted
Issue: High reserved quantities eating into available stock Solution: Reorder point should account for typical reservation levels
Wrong Quantities Ordered
Symptom: POs generated with incorrect quantities
Causes:
Reorder quantity not configured
- System falls back to deficit calculation:
deficit = reorder_point - quantity_available - May result in ordering too little
- Solution: Explicitly set reorder_quantity for optimal stock replenishment
- System falls back to deficit calculation:
Stale configuration
- Reorder quantity from months ago
- Demand patterns changed
- Solution: Review and update quarterly
Integration Examples
Dashboard Widget
Display products needing reorder on your dashboard:
API Call:
GET /api/v1/operations/inventory/reorder-report
Authorization: Bearer {token}Display Metrics:
- Total products needing reorder (count of items in response)
- Total estimated order value (from
summary.total_suggested_order_value) - Urgent products (filter items where
days_until_stockout < 3) - Products grouped by warehouse or supplier
Visualization Ideas:
- Chart showing low stock trends over time
- Table of products sorted by urgency
- Alerts for critical stock levels (< 25% of reorder point)
Email Notifications
Send daily digest of reorder needs to procurement team:
Email Content:
- Subject: "Daily Reorder Report - {count} products need attention"
- Number of products below reorder point
- Total estimated order value
- Link to generate reorders action
- List of urgent items (stockout within 3 days)
Trigger:
- Scheduled daily at specific time (e.g., 8:00 AM)
- Only send if products need reordering
- Include actionable links to review and approve
Slack Integration
Post alerts for critical stock levels to team channel:
Alert Triggers:
- Stock drops below 25% of reorder point (critical)
- Stock drops below 50% of reorder point (high urgency)
- New auto-generated PO awaiting approval
Alert Content:
- Product name and SKU
- Current available quantity
- Reorder point threshold
- Days until estimated stockout
- Link to view product or PO
Delivery:
- Post to procurement team channel
- Mention specific team members for critical items
- Include quick action buttons (approve PO, view details)
Related Guides
- Purchase Order Workflow - Complete PO lifecycle
- Receiving Goods - Process incoming shipments
- Inventory Management - Stock control
- Supplier Management - Supplier configuration
Summary
The Auto-Reordering System prevents stockouts through intelligent monitoring and automated purchase order generation. Key takeaways:
- Reorder Point = when to order (threshold quantity)
- Reorder Quantity = how much to order (optimal replenishment)
- Available Stock = on_hand - reserved (accounts for allocated inventory)
- Automation Levels = start manual, gradually increase automation
- Regular Review = adjust settings based on actual performance
Properly configured, the auto-reorder system reduces manual work, prevents stockouts, and optimizes inventory levels automatically.