PUT
/
stores
/
{store_id}
/
menu-rules
{
  "rule_id": "<string>",
  "message": "<string>",
  "success": true,
  "rule_details": {}
}
This endpoint enables comprehensive menu rule management through upsert operations, allowing businesses to create new rules or update existing ones with sophisticated automation logic for menu behavior and business policy enforcement.
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

store_id
string
required
The unique identifier of the store to create or update menu rules for

Request Body

rule_id
string
Unique identifier for the rule (if updating existing rule)
rule_name
string
required
Human-readable name for the rule for management purposes
rule_type
string
required
Type of rule: availability, pricing, display, or operational
is_active
boolean
default:"true"
Whether the rule should be active upon creation/update
priority
integer
required
Rule execution priority (higher numbers execute first)
conditions
object
required
Rule activation conditions and triggers
actions
object
required
Actions to execute when rule conditions are met
scope
object
Items, categories, or menus the rule applies to
effective_date_range
object
Start and end dates for rule effectiveness

Request Example

{
    "rule_name": "Happy Hour Beverage Pricing",
    "rule_type": "pricing",
    "is_active": true,
    "priority": 10,
    "conditions": {
        "time_range": {
            "start": "15:00",
            "end": "18:00"
        },
        "days_of_week": ["monday", "tuesday", "wednesday", "thursday", "friday"],
        "date_exceptions": ["2024-12-25", "2024-01-01"]
    },
    "actions": {
        "adjust_pricing": {
            "type": "percentage",
            "value": -25,
            "round_to": 0.05
        },
        "apply_promotional_tag": "happy_hour"
    },
    "scope": {
        "apply_to_categories": ["beverages", "appetizers"],
        "exclude_items": ["premium_wine", "specialty_cocktails"]
    },
    "effective_date_range": {
        "start_date": "2024-02-01",
        "end_date": "2024-03-31"
    }
}

Response

rule_id
string
Unique identifier of the created or updated rule
message
string
Confirmation message indicating the operation result
success
boolean
Whether the upsert operation completed successfully
rule_details
object
Complete configuration of the created or updated rule

Response Example

{
    "rule_id": "rule_456",
    "message": "Menu rule created successfully",
    "success": true,
    "rule_details": {
        "rule_id": "rule_456",
        "rule_name": "Happy Hour Beverage Pricing",
        "rule_type": "pricing",
        "is_active": true,
        "priority": 10,
        "created_at": "2024-01-15T10:30:00Z",
        "next_evaluation": "2024-01-15T15:00:00Z"
    }
}
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

Condition Configuration

Action Configuration

Validation Rules

Error Handling

Best Practices

Rule Management Strategies

Integration Considerations

Rule Lifecycle Management