This endpoint provides access to the complete set of menu rules that control menu behavior, item availability, pricing logic, and operational constraints, enabling sophisticated menu management and automation.
Menu rules provide the business logic layer that automates menu management, ensuring consistent application of business policies, operational constraints, and customer experience requirements.
Path Parameters
The unique identifier of the store to retrieve menu rules for
Query Parameters
Filter rules by type (availability, pricing, display, operational)
Return only currently active rules
Filter rules that apply to a specific menu
Include detailed rule configuration and metadata
Response
Array of menu rule objects with complete configuration details
Total number of rules for the store
Number of currently active rules
Summary of rules by category and type
Response Example
{
"rules" : [
{
"rule_id" : "rule_123" ,
"rule_name" : "Breakfast Hour Availability" ,
"rule_type" : "availability" ,
"is_active" : true ,
"priority" : 1 ,
"conditions" : {
"time_range" : {
"start" : "06:00" ,
"end" : "11:00"
},
"days_of_week" : [ "monday" , "tuesday" , "wednesday" , "thursday" , "friday" ]
},
"actions" : {
"set_availability" : true ,
"apply_to_items" : [ "breakfast_menu_items" ]
},
"created_at" : "2024-01-01T00:00:00Z" ,
"updated_at" : "2024-01-15T10:30:00Z"
}
],
"total_count" : 15 ,
"active_count" : 12 ,
"rule_categories" : {
"availability" : 8 ,
"pricing" : 4 ,
"display" : 2 ,
"operational" : 1
}
}
Rule Hierarchy : Rules are applied in priority order, with higher priority rules taking precedence over lower priority ones when conflicts arise.
Performance Optimization : Use filtering parameters to retrieve only the specific rules you need, especially when dealing with stores that have extensive rule configurations.
Use Cases
Common Menu Rule Applications
Rule Structure Details
Understanding Rule Components
Rule Metadata
rule_id: Unique identifier for the rule
rule_name: Human-readable name for management purposes
rule_type: Category of rule (availability, pricing, display, operational)
is_active: Whether the rule is currently enabled
priority: Execution order when multiple rules apply
Condition Configuration
time_range: Specific time periods when the rule applies
days_of_week: Specific days when the rule is active
date_range: Specific date periods for seasonal or event rules
inventory_conditions: Stock level thresholds that trigger the rule
weather_conditions: Weather-based triggers for rule activation
customer_segments: Specific customer types the rule applies to
Action Specification
set_availability: Control item or menu availability
adjust_pricing: Modify pricing with specific calculations
update_display_order: Change item positioning and visibility
apply_promotions: Activate or modify promotional campaigns
send_notifications: Trigger staff or system notifications
Scope and Targeting
apply_to_items: Specific items affected by the rule
apply_to_categories: Categories affected by the rule
apply_to_menus: Specific menus where the rule applies
exclude_items: Items to exclude from rule application
Rule Types and Examples
Detailed Rule Type Examples
Availability Rules {
"rule_type" : "availability" ,
"conditions" : {
"time_range" : { "start" : "23:00" , "end" : "06:00" },
"inventory_threshold" : { "min" : 5 }
},
"actions" : {
"set_availability" : false ,
"apply_to_categories" : [ "alcohol" , "complex_preparations" ]
}
}
Pricing Rules {
"rule_type" : "pricing" ,
"conditions" : {
"time_range" : { "start" : "15:00" , "end" : "17:00" },
"days_of_week" : [ "monday" , "tuesday" , "wednesday" ]
},
"actions" : {
"adjust_pricing" : { "type" : "percentage" , "value" : -20 },
"apply_to_categories" : [ "beverages" , "appetizers" ]
}
}
Display Rules {
"rule_type" : "display" ,
"conditions" : {
"customer_segment" : "health_conscious" ,
"time_range" : { "start" : "11:00" , "end" : "14:00" }
},
"actions" : {
"update_display_order" : { "promote" : true },
"apply_to_items" : [ "salads" , "low_calorie_options" ]
}
}
Operational Rules {
"rule_type" : "operational" ,
"conditions" : {
"weather_condition" : "rain" ,
"staff_count" : { "min" : 3 }
},
"actions" : {
"set_availability" : true ,
"apply_to_categories" : [ "comfort_food" , "hot_beverages" ]
}
}
Rule Evaluation Process
Evaluation Sequence
Condition Assessment : All rule conditions are evaluated against current context
Priority Sorting : Applicable rules are sorted by priority (highest first)
Conflict Resolution : Higher priority rules override lower priority ones
Action Execution : Rule actions are applied in priority order
Result Validation : Final menu state is validated for consistency
Context Evaluation
Current date and time are compared against rule conditions
Inventory levels are checked against rule thresholds
Weather data is evaluated for weather-dependent rules
Customer segment information is used for targeted rules
Staff and operational data is considered for operational rules
Conflict Resolution
Rules with the same priority are processed in creation order
Explicit exclusions override general inclusions
Availability rules take precedence over display rules
Safety and compliance rules have highest priority
Performance Optimization
Rules are cached and evaluated efficiently
Only applicable rules are processed based on current context
Rule evaluation results are cached for consistent application
System monitors rule performance and execution times
Rule Management Insights
Rule Analysis and Optimization
Rule Performance Analysis
Track rule activation frequency and patterns
Monitor rule impact on sales and customer behavior
Analyze rule conflict frequency and resolution
Measure rule execution performance and system impact
Business Impact Assessment
Evaluate rule effectiveness in achieving business goals
Monitor customer satisfaction impact of rule applications
Analyze operational efficiency improvements from automation
Assess revenue impact of pricing and availability rules
Rule Optimization Opportunities
Identify redundant or conflicting rules
Optimize rule conditions for better targeting
Simplify complex rule hierarchies
Improve rule performance through better condition design
Compliance and Audit Support
Track rule changes and modifications over time
Maintain audit trails for regulatory compliance
Document rule rationale and business justification
Support compliance reporting and verification
Error Handling
Store Not Found {
"error" : "Store not found" ,
"message" : "The specified store ID does not exist or is not accessible"
}
Invalid Filter Parameters {
"error" : "Invalid filter" ,
"message" : "The specified rule_type is not valid" ,
"valid_types" : [ "availability" , "pricing" , "display" , "operational" ]
}
Permission Denied {
"error" : "Permission denied" ,
"message" : "Insufficient permissions to view menu rules for this store"
}
System Error {
"error" : "System error" ,
"message" : "Unable to retrieve menu rules due to system maintenance" ,
"retry_after" : "2024-01-15T11:00:00Z"
}
Best Practices
Menu Rule Management Best Practices
Integration Patterns
System Integration for Menu Rules
Rule Creation and Testing
Design rules with clear business objectives
Test rules in staging environments before production deployment
Validate rule logic and expected outcomes
Document rule purpose and expected behavior
Active Rule Monitoring
Monitor rule activation and performance regularly
Track business impact and customer response
Identify opportunities for rule optimization
Address any unintended consequences promptly
Rule Optimization and Updates
Regularly review rule effectiveness and relevance
Update rules based on business changes and new requirements
Optimize rule performance and execution efficiency
Maintain rule documentation and rationale
Rule Retirement and Cleanup
Identify and remove obsolete or redundant rules
Archive historical rule data for analysis
Document lessons learned for future rule development
Maintain clean and efficient rule configurations