Skip to main content
PUT
/
stores
/
{store_id}
/
menu?menu_id=
{menu_id}
This endpoint allows you to update an existing menu or create a new one if it doesn’t exist, providing flexibility for menu management operations.
Upsert operations are ideal for menu synchronization and bulk updates, allowing you to maintain consistent menu configurations across multiple stores or update existing menus with new operating hours.

Path Parameters

store_id
string
required
The unique identifier of the store for which to upsert the menu

Query Parameters

menu_id
string
required
The unique identifier of the menu to update, or leave empty to create a new menu

Request Body

menu_name
string
required
Display name for the menu
is_default
boolean
required
Whether this menu should be the default menu for the store
status
string
required
Menu status: “active” or “inactive”
menu_hours
array
required
Array of operating hours for each day of the week, including existing IDs for updates

Request Example

{
  "menu_name": "Lula item schoping test menu",
  "is_default": false,
  "status": "active",
  "menu_hours": [
    {
      "day_of_week": 0,
      "open_time": "00:00",
      "close_time": "01:00",
      "is_closed": false,
      "id": "6445fd02-ba77-49c9-9147-914520c46cfb",
      "menu_id": "17137644-0017-4284-b15d-4605b092f063"
    },
    {
      "day_of_week": 0,
      "open_time": "10:00",
      "close_time": "12:00",
      "is_closed": false,
      "id": "ca60d563-098a-4353-bac5-76c92b01d85c",
      "menu_id": "17137644-0017-4284-b15d-4605b092f063"
    },
    {
      "day_of_week": 1,
      "open_time": "01:00",
      "close_time": "03:59",
      "is_closed": false,
      "id": "3c699321-aa44-4e6a-9a30-e801d61b511a",
      "menu_id": "17137644-0017-4284-b15d-4605b092f063"
    },
    {
      "day_of_week": 1,
      "open_time": "10:00",
      "close_time": "17:00",
      "is_closed": false,
      "id": "9cc1f27d-0b60-41ae-8a7c-88e163af9d74",
      "menu_id": "17137644-0017-4284-b15d-4605b092f063"
    },
    {
      "day_of_week": 2,
      "open_time": "00:00",
      "close_time": "03:59",
      "is_closed": false,
      "id": "e334adad-c4ea-47c9-8b89-70f3d382b44f",
      "menu_id": "17137644-0017-4284-b15d-4605b092f063"
    },
    {
      "day_of_week": 2,
      "open_time": "10:00",
      "close_time": "17:00",
      "is_closed": false,
      "id": "d5de2e83-f6a8-4a3b-969b-8f021fcb7b8c",
      "menu_id": "17137644-0017-4284-b15d-4605b092f063"
    },
    {
      "day_of_week": 3,
      "open_time": "00:00",
      "close_time": "03:59",
      "is_closed": false,
      "id": "b7d7470a-20bf-447f-8fb3-166d605d8817",
      "menu_id": "17137644-0017-4284-b15d-4605b092f063"
    },
    {
      "day_of_week": 3,
      "open_time": "10:00",
      "close_time": "17:00",
      "is_closed": false,
      "id": "4ca9ce73-7c51-4529-8ed3-1d968d24d6a9",
      "menu_id": "17137644-0017-4284-b15d-4605b092f063"
    },
    {
      "day_of_week": 4,
      "open_time": "10:00",
      "close_time": "17:00",
      "is_closed": false,
      "id": "94bc7141-f44f-44e4-bfe4-062d6cb9b6e5",
      "menu_id": "17137644-0017-4284-b15d-4605b092f063"
    },
    {
      "day_of_week": 5,
      "open_time": "10:00",
      "close_time": "17:00",
      "is_closed": false,
      "id": "fb1b46d6-3c81-46fc-b45b-6ec9f1a4ad87",
      "menu_id": "17137644-0017-4284-b15d-4605b092f063"
    },
    {
      "day_of_week": 6,
      "open_time": "10:00",
      "close_time": "17:00",
      "is_closed": false,
      "id": "bc421e4a-5b9f-49c3-867e-56114a0912c2",
      "menu_id": "17137644-0017-4284-b15d-4605b092f063"
    }
  ]
}
Create Mode (New Menu)
  • When menu_id is not provided or doesn’t exist
  • Creates a new menu with all provided configuration
  • Generates new IDs for menu and menu hours
  • Sets creation timestamps and user information
Update Mode (Existing Menu)
  • When menu_id matches an existing menu
  • Updates menu configuration and operating hours
  • Preserves existing IDs where provided
  • Updates modification timestamps
Hybrid Operations
  • Can add new menu hours while updating existing ones
  • Removes menu hours not included in the request
  • Supports partial updates of operating schedules
  • Maintains data integrity during complex changes
Multiple Time Slots: This endpoint supports multiple opening/closing periods for the same day, allowing for complex scheduling like lunch breaks or split shifts.
Efficient Updates: Include existing IDs in menu_hours objects to update existing entries rather than recreating them, which preserves audit trails and related data.

Use Cases

Menu Synchronization
  • Sync menu configurations across multiple store locations
  • Maintain consistent operating hours across franchise locations
  • Update multiple menus with new corporate policies
Schedule Adjustments
  • Modify operating hours for seasonal changes
  • Add special hours for holidays or events
  • Implement temporary schedule modifications
Complex Operating Hours
  • Configure multiple opening periods per day
  • Set up lunch break closures or split shifts
  • Handle 24-hour operations with midnight transitions
Menu Template Application
  • Apply standardized menu templates to new stores
  • Update existing menus to match new corporate standards
  • Implement brand-wide menu changes efficiently

Split-Day Operations

Multiple Time Periods per Day
  • Early morning hours (00:00-01:00)
  • Regular business hours (10:00-17:00)
  • Late evening service (22:00-23:59)
Lunch Break Management
  • Morning hours (09:00-12:00)
  • Afternoon hours (13:00-17:00)
  • Closed period for lunch (12:00-13:00)
24-Hour Operations
  • Continuous service across midnight
  • Day 0: 22:00-23:59
  • Day 1: 00:00-06:00
Special Event Scheduling
  • Extended hours for promotions
  • Limited hours for maintenance
  • Holiday-specific operating schedules

Data Validation

Time Format Validation
  • Times must be in HH:MM format (24-hour)
  • Opening time must be before closing time (within the same day)
  • Times must be valid (00:00 to 23:59)
Day of Week Validation
  • Must be integers between 0 and 6
  • 0 = Sunday, 6 = Saturday
  • Each day can have multiple time periods
Menu Configuration Validation
  • Menu name must be non-empty and unique within the store
  • Status must be “active” or “inactive”
  • is_default must be boolean
ID Validation
  • Existing IDs must reference valid menu hours
  • menu_id in query parameter must match existing menu for updates
  • Invalid IDs will be ignored and new entries created

Error Handling

Invalid Menu ID
{
  "error": "Menu not found",
  "message": "The specified menu_id does not exist for this store"
}
Time Validation Errors
{
  "error": "Invalid time range",
  "message": "Opening time must be before closing time",
  "field": "menu_hours[0]"
}
Conflicting Default Menus
{
  "error": "Multiple default menus",
  "message": "Cannot set multiple menus as default for the same store"
}
Missing Required Fields
{
  "error": "Validation failed",
  "message": "menu_name is required",
  "field": "menu_name"
}
Data Overwrite: Upsert operations can overwrite existing menu configurations. Ensure you include all desired menu hours in the request, as missing entries may be removed.

Best Practices

Data Preparation
  • Always retrieve current menu configuration before updating
  • Include existing IDs to preserve data relationships
  • Validate time ranges before submitting requests
  • Test complex schedules in staging environment
Error Prevention
  • Check for time conflicts before submitting
  • Validate day_of_week values are within range
  • Ensure only one menu per store is set as default
  • Handle timezone considerations for multi-location businesses
Performance Optimization
  • Batch multiple menu updates when possible
  • Use existing IDs to minimize database operations
  • Consider the impact of frequent menu changes on customer experience
  • Implement proper error handling and retry logic
Audit and Compliance
  • Track who makes menu changes and when
  • Maintain history of menu modifications
  • Document business justification for schedule changes
  • Review menu performance after updates
I