Menu rule upserts provide powerful automation capabilities, enabling businesses to implement complex business logic that automatically adjusts menus based on time, inventory, weather, customer segments, and operational conditions.
Path Parameters
The unique identifier of the store to create or update menu rules for
Request Body
Unique identifier for the rule (if updating existing rule)
Human-readable name for the rule for management purposes
Type of rule: availability, pricing, display, or operational
Whether the rule should be active upon creation/update
Rule execution priority (higher numbers execute first)
Rule activation conditions and triggers
Actions to execute when rule conditions are met
Items, categories, or menus the rule applies to
Start and end dates for rule effectiveness
Request Example
Response
Unique identifier of the created or updated rule
Confirmation message indicating the operation result
Whether the upsert operation completed successfully
Complete configuration of the created or updated rule
Response Example
Rule Configuration Strategies
Rule Configuration Strategies
Time-Based Automation
- Schedule automatic menu changes throughout the day
- Implement seasonal availability and pricing
- Handle special events and holiday modifications
- Coordinate with business hours and operational schedules
- Automatically adjust availability based on stock levels
- Implement dynamic pricing based on inventory costs
- Handle supply chain disruptions automatically
- Optimize inventory turnover through menu adjustments
- Personalize menus based on customer segments
- Implement loyalty program benefits automatically
- Adjust offerings based on customer behavior patterns
- Optimize for customer satisfaction and engagement
- Adjust menus based on staffing levels
- Handle equipment maintenance and capacity constraints
- Optimize for kitchen efficiency and preparation times
- Coordinate with delivery and pickup operations
Rule Conflicts: When multiple rules affect the same items, rules with higher priority values take precedence. Design your rule hierarchy carefully to avoid unintended conflicts.
Testing Strategy: Use effective date ranges and the is_active flag to test new rules safely before full deployment. Start with specific date ranges and limited scope for validation.
Rule Types and Examples
Comprehensive Rule Type Examples
Comprehensive Rule Type Examples
Availability RulesDynamic Pricing RulesDisplay Optimization RulesOperational Rules
Condition Configuration
Rule Condition Options
Rule Condition Options
Time-Based Conditions
time_range
: Specific hours of the daydays_of_week
: Specific days when rule appliesdate_range
: Specific calendar periodsdate_exceptions
: Specific dates to excluderecurring_schedule
: Complex recurring patterns
inventory_threshold
: Stock level triggerscost_variance
: Pricing based on cost changessupplier_availability
: Supply chain statusexpiration_proximity
: Perishable item management
weather_condition
: Weather-based triggerstemperature_range
: Temperature-specific rulesseasonal_conditions
: Season-based automationexternal_events
: Special event considerations
staff_count
: Staffing level requirementsequipment_status
: Equipment availabilityorder_volume
: Current demand levelsdelivery_capacity
: Delivery operation status
customer_segment
: Specific customer typesloyalty_tier
: Customer loyalty levelsorder_history
: Customer behavior patternsdemographic_data
: Customer demographic information
Action Configuration
Rule Action Options
Rule Action Options
Availability Actions
set_availability
: Enable or disable items/categoriesadjust_availability_window
: Modify time-based availabilityinventory_reserve
: Reserve inventory for specific purposescapacity_limit
: Limit order quantities
adjust_pricing
: Percentage or fixed amount changesapply_discount
: Specific discount configurationssurge_pricing
: Demand-based price increasesbundling_offers
: Create promotional bundles
update_display_order
: Change item positioningfeature_items
: Highlight specific itemscategory_promotion
: Promote entire categoriespersonalized_recommendations
: Customer-specific suggestions
send_notification
: Alert staff or customersupdate_descriptions
: Modify item descriptionsapply_promotional_tag
: Add marketing tagssocial_media_post
: Automated social media updates
update_external_systems
: Sync with third-party platformstrigger_workflow
: Initiate business processeslog_analytics_event
: Track business intelligence datainventory_adjustment
: Automatic inventory management
Validation Rules
Rule Validation Requirements
Rule Validation Requirements
Structure Validation
- Rule name must be unique within the store
- Rule type must be from approved list
- Priority must be a positive integer
- Conditions and actions must have valid structure
- Condition logic must be evaluable
- Action specifications must be executable
- Scope definitions must reference valid items/categories
- Date ranges must be logically consistent
- Pricing adjustments must be within allowed ranges
- Availability changes must comply with business policies
- Promotional actions must align with marketing guidelines
- Operational rules must respect safety and compliance requirements
- Referenced items and categories must exist
- Integration endpoints must be accessible
- Notification channels must be configured
- External data sources must be available
Error Handling
Common Error Scenarios
Common Error Scenarios
Invalid Rule ConfigurationBusiness Rule ViolationConflicting Rule PriorityInvalid Scope Reference
Best Practices
Menu Rule Development Best Practices
Menu Rule Development Best Practices
Rule Management Strategies
Strategic Rule Implementation
Strategic Rule Implementation
Phased Implementation
- Start with simple availability and pricing rules
- Gradually add operational and display optimization rules
- Implement customer segmentation rules after data collection
- Build complex multi-condition rules based on experience
- Align rules with overall business strategy and goals
- Coordinate rule development with marketing and operations teams
- Ensure rules support customer experience objectives
- Integrate rules with loyalty and promotional programs
- Regularly review rule effectiveness and business impact
- Optimize rules based on performance data and customer feedback
- Retire outdated rules that no longer serve business needs
- Evolve rule complexity as business needs mature
- Ensure rules comply with regulatory requirements
- Implement approval processes for high-impact rules
- Maintain audit trails for rule changes and impacts
- Document rule governance and change management procedures
Integration Considerations
System Integration for Menu Rules
System Integration for Menu Rules
Rule Lifecycle Management
Managing Rule Evolution
Managing Rule Evolution
Rule Development Lifecycle
- Planning: Define business objectives and rule requirements
- Design: Create rule logic and validate against requirements
- Testing: Validate rule behavior in controlled environments
- Deployment: Implement rules with appropriate safeguards
- Monitoring: Track rule performance and business impact
- Optimization: Refine rules based on data and feedback
- Retirement: Remove obsolete rules and archive historical data
- Maintain version history for all rule changes
- Implement approval workflows for rule modifications
- Document change rationale and expected impact
- Coordinate rule changes with business operations
- Monitor rule execution performance and system impact
- Optimize rule logic for efficiency and accuracy
- Balance rule complexity with system performance
- Continuously improve rule effectiveness and business value