Update store information
This topic demonstrates the implementations of the syncStore API for updating information about an existing store, menu, category, or item.
Overview
You can update an existing store, menu, category, or item that has been synchronized via the syncStore API, for example, changing a store's name or hiding a menu.
Things to know before updating:
- To update store information, menus, categories, items, or modifier groups, specify new values for the relevant parameters you want to update in the request body. If an existing field is not explicitly specified, the field remains unchanged. For example, to update a store's name, pass the store object with the storeId parameter to identify the store and the newly specified name parameter.
- To update an object or array, pass the entire object or array that includes existing and newly-specified parameters. The existing parameters and associated values that are not included in the request will be deleted.
Use cases
Update a store
To update an existing store, pass the storeId parameter and make sure the store information has been synchronized via the syncStore API.
Change store name
When changing a store's name, pass the name parameter with a new MultipleLanguageText object to support multiple languages, which will overwrite the data in the previous object.
See the following example:
{
"requestId": "2022112221****",
"appId": "21020101154****",
"store": {
"storeId": "20221017storeid01",
"name": {
"value": {
"en-US": "store01",
"zh-CN": "店铺1"
}
}
}
}
Change display content
To change the display content of a store, pass a new contents array, which will overwrite the data in the previous array.
See the following example:
- The store (
20221017storeid01
) contains an announcement, a description, and a background image. - To change the store's description, specify a new value for the value parameter (scene:
DESCRIPTION
) and remain the data for the announcement and background image unchanged.copy{ "requestId": "2022112221****", "appId": "21020101154****", "store": { "storeId": "20221017storeid01", "contents": [ { "type": "TEXT", "scene": "ANNOUNCEMENT", "value": "{\"value\":{\"en-US\":\"store01\"}}" }, { "type": "IMAGE", "scene": "BACKGROUND", "value": "https://omni.posplus-crm.com/Omni_FnbItem/storeabc/NSDLX_DBBF_AC.png" }, { "type": "TEXT", "scene": "DESCRIPTION", "value": "{\"value\":{\"en-US\":\"store01 update description test\"}}" } ] } }
Change opening hours
To change a store's opening hours, pass a new serviceSchedules array, which will overwrite the data in the previous array.
The service schedules have the following rules:
- When multiple schedule rules in the serviceSchedules array are hit, the valid rule with the largest index shall prevail.
- If no date range is specified for a service schedule, that is, the startTime and endTime parameters are not specified, the service schedule takes effect immediately and continuously.
Note:
- To schedule exceptional opening hours, see Set exceptional opening hours.
- To specify when a service (pickup, dine-in, or delivery) is not available to users, see Set service availability.
Set daily opening hours
To set a regular schedule with the same opening hours every day, specify the value of the scheduleType parameter as DAILY
to indicate a fixed schedule that takes effect every day.
For example, the store (20221017storeid01
) is open from 08:00 to 21:00 every day:
{
"requestId": "2022112221****",
"appId": "21020101154****",
"store": {
"storeId": "20221017storeid01",
"serviceSchedules": [
{
"scheduleType": "DAILY",
"schedules": {
"FIXED": [
{
"startTime": "08:00+08:00",
"endTime": "21:00+08:00"
}
]
}
}
]
}
}
Set weekly opening hours
To set regular opening hours for each day of the week:
- Specify the value of the scheduleType parameter as
WEEKLY
to indicate a weekly schedule. You need to specify opening hours from Monday to Sunday. - If no schedule is set on a certain day, the specified schedule does not apply on that day, which means the store is closed on that day. For example, if no schedule is set on Saturday and Sunday, the store is closed every Saturday and Sunday.
For example, the store (20221017storeid01
) has the following opening hours every week:
- Monday: 08:00-21:00
- Tuesday: 07:00-21:00
- Wednesday to Sunday: 00:00-23:59
{
"requestId": "2022112221****",
"appId": "21020101154****",
"store": {
"storeId": "20221017storeid01",
"serviceSchedules": [
{
"scheduleType": "WEEKLY",
"schedules": {
"MONDAY": [
{
"startTime": "08:00+08:00",
"endTime": "21:00+08:00"
}
],
"TUESDAY": [
{
"startTime": "07:00+08:00",
"endTime": "21:00+08:00"
}
],
"WEDNESDAY": [
{
"startTime": "00:00+08:00",
"endTime": "23:59+08:00"
}
],
"THURSDAY": [
{
"startTime": "00:00+08:00",
"endTime": "23:59+08:00"
}
],
"SUNDAY": [
{
"startTime": "00:00+08:00",
"endTime": "23:59+08:00"
}
],
"FRIDAY": [
{
"startTime": "00:00+08:00",
"endTime": "23:59+08:00"
}
],
"SATURDAY": [
{
"startTime": "00:00+08:00",
"endTime": "23:59+08:00"
}
]
}
}
]
}
}
Set exceptional opening hours
When a store's opening hours change for a brief period of time, such as a holiday, you can schedule exceptional hours so that your regular opening hours don't change.
See the following example:
- The regular opening hours of the store are 08:00-21:00.
- Specify a schedule for the National Day holiday in the last index of the serviceSchedules array. So the regular opening hours are still valid for the store until September 30, 2022. During the National Day holiday (from
2022-10-01T00:00:01+08:00
to2022-10-07T23:59:59+08:00
), the store is open from 07:00 to 22:00. - After the holiday, the store is back to normal business hours (08:00-21:00).
{
"requestId": "2022112221****",
"appId": "21020101154****",
"store": {
"storeId": "20221017storeid01",
"serviceSchedules": [
{
"scheduleType": "DAILY",
"schedules": {
"FIXED": [
{
"startTime": "08:00+08:00",
"endTime": "21:00+08:00"
}
]
}
},
{
"scheduleType": "DAILY",
"startTime": "2022-10-01T00:00:01+08:00",
"endTime": "2022-10-07T23:59:59+08:00",
"schedules": {
"FIXED": [
{
"startTime": "07:00+08:00",
"endTime": "22:00+08:00"
}
]
}
}
]
}
}
Change store business rules
Specify the bizRules parameter to set the business rules of a store, including the delivery, dine-in, or pickup business rules.
To change a store's business rules, pass a new bizRules array, which will overwrite the data in the previous array.
Things to know:
- If you need to display a service schedule in segments, specify the segmented time slots.
- It is recommended to specify the service schedule for each service type during the store's opening hours. The service time slots beyond the opening hours will be excluded.
- Specify the supportDays parameter for the service schedule of each service type (value range: 1-30), which indicates the number of days the schedule is applied to, for example, 1 for today, 2 for today and tomorrow, etc.
Note: For relevant configurations and use cases for each service type, check the following links:
The following example demonstrates a store (20221017storeid01
) that supports all business rules:
{
"requestId": "2022112221****",
"appId": "21020101154****",
"store": {
"storeId": "20221017storeid01",
"bizRules": [
{
"scene": "DINE_IN_SCHEDULE",
"ruleData": "[{\"scheduleType\":\"DAILY\",\"supportDays\":1,\"schedules\":{\"FIXED\":[{\"startTime\":\"00:00+08:00\",\"endTime\":\"12:00+08:00\"},{\"startTime\":\"12:10+08:00\",\"endTime\":\"23:50+08:00\"}]}}]"
},
{
"scene": "DINE_IN_ORDER",
"ruleData": "{\"isTableNoRequired\":\"false\",\"serviceType\":\"SERVE_TO_TABLE\"}"
},
{
"scene": "DELIVERY_SCHEDULE",
"ruleData": "[{\"scheduleType\":\"DAILY\",\"supportDays\":6,\"schedules\":{\"FIXED\":[{\"startTime\":\"10:00+08:00\",\"endTime\":\"11:00+08:00\"},{\"startTime\":\"12:00+08:00\",\"endTime\":\"13:00+08:00\"}]}},{\"startTime\":\"2022-10-01T00:00:01+08:00\",\"endTime\":\"2022-10-10T00:00:01+08:00\",\"scheduleType\":\"DAILY\",\"supportDays\":6,\"schedules\":{\"FIXED\":[{\"startTime\":\"11:00+08:00\",\"endTime\":\"12:00+08:00\"},{\"startTime\":\"13:00+08:00\",\"endTime\":\"14:00+08:00\"}]}}]"
},
{
"scene": "DELIVERY_DISTANCE",
"ruleData": "[{\"from\":0,\"to\":5000,\"fee\":{\"currency\":\"SGD\",\"value\":500},\"minimumOrderAmount\":{\"currency\":\"SGD\",\"value\":1000},\"discounts\":[{\"discountType\":\"REDUCE\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"value\":1000},\"discountValue\":\"{\\\"currency\\\": \\\"SGD\\\", \\\"value\\\":1000}\"},{\"discountType\":\"PERCENTAGE\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"value\":100},\"discountValue\":\"20\"},{\"discountType\":\"EXEMPTION\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"value\":3000}}]},{\"from\":5000,\"to\":10000,\"fee\":{\"currency\":\"SGD\",\"value\":1000},\"minimumOrderAmount\":{\"currency\":\"SGD\",\"value\":2000},\"discounts\":[{\"discountType\":\"REDUCE\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"value\":2000},\"discountValue\":\"{\\\"currency\\\": \\\"SGD\\\", \\\"value\\\":1000}\"},{\"discountType\":\"PERCENTAGE\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"value\":3000},\"discountValue\":\"20\"},{\"discountType\":\"EXEMPTION\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"value\":4000}}]},{\"from\":10000,\"to\":100000,\"fee\":{\"currency\":\"SGD\",\"value\":2000},\"minimumOrderAmount\":{\"currency\":\"SGD\",\"value\":5000},\"discounts\":[{\"discountType\":\"REDUCE\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"value\":5000},\"discountValue\":\"{\\\"currency\\\": \\\"SGD\\\", \\\"value\\\":1000}\"},{\"discountType\":\"PERCENTAGE\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"value\":6000},\"discountValue\":\"20\"},{\"discountType\":\"EXEMPTION\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"value\":7000}}]}]"
},
{
"scene": "PICKUP_SCHEDULE",
"ruleData": "[{\"scheduleType\":\"DAILY\",\"supportDays\":10,\"schedules\":{\"FIXED\":[{\"startTime\":\"11:00+08:00\",\"endTime\":\"12:00+08:00\"},{\"startTime\":\"12:00+08:00\",\"endTime\":\"13:00+08:00\"}]}},{\"scheduleType\":\"DAILY\",\"supportDays\":10,\"startTime\":\"2022-10-08T00:00:01+08:00\",\"endTime\":\"2022-10-10T00:00:01+08:00\",\"schedules\":{\"FIXED\":[{\"startTime\":\"10:00+08:00\",\"endTime\":\"11:00+08:00\"},{\"startTime\":\"12:00+08:00\",\"endTime\":\"13:00+08:00\"},{\"startTime\":\"13:00+08:00\",\"endTime\":\"14:00+08:00\"}]}}]"
},
{
"scene": "PICKUP_RULE",
"ruleData": "[{\"minimumOrderAmount\":{\"value\":1000,\"currency\":\"SGD\"},\"pickUpContactDetails\":[{\"name\":{\"value\":{\"en-US\":\"Sample Brand @ Braddell\"}},\"phoneNo\":\"+6562539198\"}],\"pickUpAddress\":{\"value\":{\"en-US\":\"123 Braddell Tech, Lorong 8 Toa Payoh #12-14, 319123, Singapore\"}}}]"
}
]
}
}
Change tags
To change the tags of a store, pass a new tags array, which will overwrite the data in the previous array.
Note:
- The maximum number of tags is 10 in a store.
- For the valid values, see Valid values for tags.
{
"requestId": "202211030****",
"appId": "210201013379****",
"store": {
"storeId": "QATest102611",
"extendInfo": {
"tags": [
"CU_CAKES_BAKERY",
"CU_DIM_SUM",
"CU_CHINESE"
]
}
}
}
Change banners
To change the banners of a store, pass a new banners array, which will overwrite the data in the previous array.
{
"requestId": "2022112221****",
"appId": "21020101154****",
"store": {
"storeId": "20221017storeid01",
"extendInfo": {
"banners": [
{
"imageUrl": "https://s3-ap-southeast-1.example.com/test0(2).png",
"landingUrl": "https://s3-ap-southeast-1.example.com"
}
]
}
}
}
Hide a store
To hide a store, specify the value of the status parameter as OFFLINE
and the store will be invisible to users:
{
"requestId": "2022112221123****",
"appId": "21020101154****",
"store": {
"storeId": "20221017storeid01",
"status": "OFFLINE"
}
}
Update a menu
To update an existing menu, pass the storeId and menuId parameters. Make sure the store information and menu information have been synchronized via the syncStore API.
Change menu name
When changing a menu's name, pass the name parameter with a new MultipleLanguageText object to support multiple languages, which will overwrite the data in the previous object.
{
"requestId": "20221122211***",
"appId": "21020101154****",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"name": {
"value": {
"en-US": "Breakfast",
"zh-CN": "早餐"
}
}
}
]
}
}
Change minimum preparation time
To change the minimum preparation time for an order, specify the minPrepareMinutes parameter with a new value:
{
"requestId": "20221122211***",
"appId": "21020101154****",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"minPrepareMinutes": 15
}
]
}
}
Hide a menu
To hide a menu, specify the value of the status parameter as INVALID
and the menu will be invisible to users:
{
"requestId": "20221122211***",
"appId": "21020101154****",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"status": "INVALID"
}
]
}
}
Update a category
To update an existing category, pass the storeId, menuId, and categoryId parameters. Make sure the store information, menu, and category have been synchronized via the syncStore API.
Change category name
When changing a category's name, pass the name parameter with a new MultipleLanguageText object to support multiple languages, which will overwrite the data in the previous object.
{
"requestId": "20221122211***",
"appId": "21020101154***",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"categories": [
{
"categoryId": "category_id_01",
"name": {
"value": {
"en-US": "Main",
"zh-CN": "主食"
}
}
}
]
}
]
}
}
Change category sequence
To change the sequence of a category in a menu, specify the sequence parameter with a new value:
{
"requestId": "20221122211***",
"appId": "21020101154***",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"categories": [
{
"categoryId": "category_id_01",
"sequence": 10
}
]
}
]
}
}
Note: For more information about sorting categories, see Set category sequence.
Hide a category
To hide a category, specify the value of the status parameter as INACTIVE
and the category will be invisible to users:
{
"requestId": "20221122211***",
"appId": "21020101154***",
"store": {
"storeId": "20221001storeid01",
"menus": [
{
"menuId": "menu_id_01",
"categories": [
{
"categoryId": "category_id_01",
"status": "INACTIVE"
}
]
}
]
}
}
Update an item
Update a single item
To update an existing single item, pass the storeId, menuId, categoryId, and itemId parameters. Make sure the store information, menu, category, and item have been synchronized via the syncStore API.
For example, to change an item's price, pass the saleAmount parameter with a new Amount object, which will overwrite the data in the previous object:
{
"requestId": "20221122211***",
"appId": "21020101154***",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"categories": [
{
"categoryId": "category_id_01",
"items": [
{
"itemId": "item_01",
"saleAmount": {
"currency": "SGD",
"value": "2000"
}
}
]
}
]
}
]
}
}
Update a modifier group
To update an existing modifier group, pass the storeId, menuId, categoryId, and itemId parameters. Make sure the store information, menu, category, and item have been synchronized via the syncStore API.
Things to know:
- For the existing modifier groups that haven't changed, pass at least the group IDs, otherwise, they will be removed from the item (still exist in other items).
- For the modifier group to update, pass the newly specified information.
See the following example:
- The item (
item_01
) contains two modifier groups:MODIFIERGROUP01
andMODIFIERGROUP02
. - For the modifier group (
MODIFIERGROUP01
) to update, pass the newly specified information. For the modifier group (MODIFIERGROUP02
) that hasn't changed, pass only the group ID.
{
"requestId": "20221122211***",
"appId": "21020101154***",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"categories": [
{
"categoryId": "category_id_01",
"items": [
{
"itemId": "item_01",
"modifierGroups": [
{
"groupId": "MODIFIERGROUP01",
"name": {
"value": {
"en-US": "Add-On111"
}
},
"quantityRule": {
"min": 0,
"max": 12
},
"childItems": [
{
"itemId": "addonitem1",
"name": {
"value": {
"en-US": "Add Beef Patty"
}
},
"saleType": "ADDON",
"originAmount": {
"currency": "SGD",
"value": 0
},
"saleAmount": {
"currency": "SGD",
"value": 350
}
}
]
},
{
"groupId": "MODIFIERGROUP02",
"name": {
"value": {
"en-US": "Add-On2"
}
},
"childItems": [
{
"itemId": "addonitem2",
"name": {
"value": {
"en-US": "Add Beef Patty"
}
},
"saleType": "ADDON",
"originAmount": {
"currency": "SGD",
"value": 0
},
"saleAmount": {
"currency": "SGD",
"value": 350
}
}
]
}
]
}
]
}
]
}
]
}
}
Remove an existing modifier group
To remove an existing modifier group from an item, pass the storeId, menuId, categoryId, and itemId parameters. Make sure the store information, menu, category, and item have been synchronized via the syncStore API.
Then specify the modifierGroups array to include all existing modifier groups (at least the group IDs), except the target modifier group to remove.
See the following example:
- Before updating, the item (
item_01
) contains three modifier groups:MODIFIERGROUP01
,MODIFIERGROUP02
, andMODIFIERGROUP03
. - The existing modifier group (
MODIFIERGROUP03
) that is not included in the request is removed from the item.
{
"requestId": "20221122211***",
"appId": "21020101154***",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"categories": [
{
"categoryId": "category_id_01",
"items": [
{
"itemId": "item_01",
"modifierGroups": [
{
"groupId": "MODIFIERGROUP01"
},
{
"groupId": "MODIFIERGROUP02"
}
]
}
]
}
]
}
]
}
}
Update an add-on item
To update an add-on item, pass the storeId, menuId, categoryId, itemId (for the single item), and groupId (for the modifier group) parameters. Make sure the store, menu, category, item, and modifier group information have been synchronized via the syncStore API.
Things to know:
- Pass all existing modifier groups (at least the group IDs) for the single item, otherwise, they will be removed from the item.
- For the target modifier group with an add-on item to change, pass all existing add-on items (at least the item IDs) and the newly specified add-on item information.
See the following example:
{
"requestId": "20221122211***",
"appId": "21020101154***",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"categories": [
{
"categoryId": "category_id_01",
"items": [
{
"itemId": "item_01",
"modifierGroups": [
{
"groupId": "MODIFIERGROUP01",
"childItems": [
{
"itemId": "addonitem1",
"name": {
"value": {
"en-US": "Add Beef Patty"
}
},
"saleType": "ADDON"
}
]
},
{
"groupId": "MODIFIERGROUP02",
"name": {
"value": {
"en-US": "Add-On2"
}
},
"quantityRule": {
"min": 0,
"max": 12
},
"childItems": [
{
"itemId": "addonitem2",
"name": {
"value": {
"en-US": "Add Beef Patty"
}
},
"saleType": "ADDON",
"originAmount": {
"currency": "SGD",
"value": 0
},
"saleAmount": {
"currency": "SGD",
"value": 350
}
}
]
}
]
}
]
}
]
}
]
}
}
Remove an existing add-on item
To remove an existing add-on item from a modifier group, pass the storeId, menuId, categoryId, itemId (for the single item), and groupId (for the modifier group) parameters. Make sure the store, menu, category, item, and modifier group information have been synchronized via the syncStore API.
Things to know:
- Pass all existing modifier groups (at least the group IDs) for the single item, otherwise, they will be removed from the item.
- For the target modifier group with an add-on item to remove, pass all existing add-on items (at least the item IDs), except the target add-on item to remove.
See the following example:
- The item (
item_01
) contains two modifier groups:MODIFIERGROUP01
andMODIFIERGROUP02
. - Before updating, the modifier group (
MODIFIERGROUP01
) contains two add-on items:addonitem1
andaddonitem2
. - The existing add-on item (
addonitem2
) that is not included in the request is removed from the modifier group.
{
"requestId": "20221122211***",
"appId": "21020101154***",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"categories": [
{
"categoryId": "category_id_01",
"items": [
{
"itemId": "item_01",
"modifierGroups": [
{
"groupId": "MODIFIERGROUP01",
"childItems": [
{
"itemId": "addonitem1"
}
]
},
{
"groupId": "MODIFIERGROUP02"
}
]
}
]
}
]
}
]
}
}
Change skus or skuPropertyGroups
To change skus or skuPropertyGroups in an item, pass a new skus or skuPropertyGroups array, which will overwrite the data in the previous array.
Things to know:
- Pass both the skus and skuPropertyGroups arrays no matter which one to update.
- The size of the properties array needs to be exactly equal to the size of the skuPropertyGroups array.
- For each key-value pair (specified in the skus.skuPropertyPairs parameter):
- Key is specified according to skuPropertyGroups.skuGroupId.
- Value is specified according to SkuProperty.propertyId.
See the following example:
{
"requestId": "20221122211***",
"appId": "21020101154***",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"categories": [
{
"categoryId": "category_id_01",
"items": [
{
"itemId": "item_01",
"skuPropertyGroups": [
{
"name": {
"value": {
"en-US": "size"
}
},
"skuGroupId": "27731",
"properties": [
{
"name": {
"value": {
"en-US": "Small"
}
},
"propertyId": "Small"
},
{
"name": {
"value": {
"en-US": "Large"
}
},
"propertyId": "Large"
}
]
},
{
"skuGroupId": "27733",
"name": {
"value": {
"en-US": "Level of Spiciness"
}
},
"properties": [
{
"name": {
"value": {
"en-US": "No Chili"
}
},
"propertyId": "No Chili"
},
{
"name": {
"value": {
"en-US": "less Chili"
}
},
"propertyId": "Less Chili"
},
{
"name": {
"value": {
"en-US": "Normal Chili"
}
},
"propertyId": "Normal Spicy"
}
]
}
],
"skus": [
{
"skuId": "tsku2121",
"skuPropertyPairs": {
"27731": "Small",
"27733": "Normal Spicy"
},
"originAmount": {
"currency": "SGD",
"value": 100
},
"saleAmount": {
"currency": "SGD",
"value": 90
},
"contents": [
{
"type": "IMAGE",
"scene": "BACKGROUND",
"value": "https://www.example.com/images/uploads/meals/test.JPG"
}
]
},
{
"skuId": "tsku2122",
"skuPropertyPairs": {
"27731": "Large",
"27733": "Normal Spicy"
},
"originAmount": {
"currency": "SGD",
"value": 100
},
"saleAmount": {
"currency": "SGD",
"value": 80
},
"contents": [
{
"type": "IMAGE",
"scene": "BACKGROUND",
"value": "https://wwww.example.com/images/uploads/meals/test.png"
}
]
}
]
}
]
}
]
}
]
}
}
Change item business rules
To change an item's business rules, specify the items.bizRules.scene parameter as ITEM_STATUS_RULE
or PRICE_SCHEDULE
and the ruleData parameter with a new value.
Note:
- To specify seasonal pricing for an item, see Set seasonal item pricing.
- To specify item availability, see Set item availability.
See the following example:
{
"requestId": "20221122211***",
"appId": "21020101154***",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"categories": [
{
"categoryId": "category_id_01",
"items": [
{
"itemId": "item_01",
"bizRules": [
{
"scene": "ITEM_STATUS_RULE",
"ruleData": "[{\"from\":\"2022-09-01T00:00:01+08:00\",\"to\": \"2022-12-31T23:59:59+08:00\",\"weekDays\": [\"MONDAY\",\"WEDNESDAY\",\"TUESDAY\"],\"timeSlot\": {\"startTime\": \"10:00+08:00\",\"endTime\": \"14:00+08:00\"},\"itemStatus\":\"AVAILABLE\"}]"
},
{
"scene": "PRICE_SCHEDULE",
"ruleData": "[{\"from\": \"2022-09-21T00:00:01+08:00\",\"to\": \"2022-12-31T01:00:01+08:00\",\"weekDays\": [\"MONDAY\",\"WEDNESDAY\",\"TUESDAY\"],\"timeSlot\": {\"startTime\": \"10:00+08:00\",\"endTime\": \"14:00+08:00\"},\"originAmount\":200,\"saleAmount\":180,\"currency\": \"SGD\"}]"
}
]
}
]
}
]
}
]
}
}
Change SKU business rules
To change an SKU's business rules, pass a new skus array, which will overwrite the data in the previous array. Specify the skus.bizRules.scene parameter as SKU_STATUS_RULE
or PRICE_SCHEDULE
and the ruleData parameter with a new value.
Notes:
- Pass both the skus and skuPropertyGroups arrays no matter which one to update.
- To specify seasonal pricing for an SKU, see Set seasonal SKU pricing.
- To specify SKU availability, see Set SKU availability.
See the following example:
{
"requestId": "20221122211***",
"appId": "21020101154***",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"categories": [
{
"categoryId": "category_id_01",
"items": [
{
"itemId": "item_01",
"skuPropertyGroups": [
{
"name": {
"value": {
"en-US": "size"
}
},
"skuGroupId": "27731",
"properties": [
{
"name": {
"value": {
"en-US": "Small"
}
},
"propertyId": "Small"
},
{
"name": {
"value": {
"en-US": "Large"
}
},
"propertyId": "Large"
}
]
},
{
"skuGroupId": "27733",
"name": {
"value": {
"en-US": "Level of Spiciness"
}
},
"properties": [
{
"name": {
"value": {
"en-US": "No Chili"
}
},
"propertyId": "No Chili"
},
{
"name": {
"value": {
"en-US": "less Chili"
}
},
"propertyId": "Less Chili"
},
{
"name": {
"value": {
"en-US": "Normal Chili"
}
},
"propertyId": "Normal Spicy"
}
]
}
],
"skus": [
{
"skuId": "tsku2121",
"skuPropertyPairs": {
"27731": "Small",
"27733": "Normal Spicy"
},
"bizRules": [
{
"scene": "PRICE_SCHEDULE",
"ruleData": "[{\"from\": \"2022-09-21T00:00:01+08:00\",\"to\": \"2022-12-31T01:00:01+08:00\",\"weekDays\": [\"MONDAY\",\"WEDNESDAY\",\"TUESDAY\"],\"timeSlot\": {\"startTime\": \"10:00+08:00\",\"endTime\": \"14:00+08:00\"},\"originAmount\":200,\"saleAmount\":180,\"currency\": \"SGD\"}]"
},
{
"scene": "SKU_STATUS_RULE",
"ruleData": "[{\"from\":\"2022-09-01T00:00:01+08:00\",\"to\": \"2022-12-31T01:00:01+08:00\",\"weekDays\": [\"MONDAY\",\"WEDNESDAY\",\"TUESDAY\"],\"timeSlot\": {\"startTime\": \"10:00+08:00\",\"endTime\": \"14:00+08:00\"},\"skuStatus\":\"AVAILABLE\"}]"
}
],
"originAmount": {
"currency": "SGD",
"value": 100
},
"saleAmount": {
"currency": "SGD",
"value": 90
},
"contents": [
{
"type": "IMAGE",
"scene": "BACKGROUND",
"value": "https://www.example.com/images/uploads/meals/test.JPG"
}
]
},
{
"skuId": "tsku2122",
"skuPropertyPairs": {
"27731": "Large",
"27733": "Normal Spicy"
},
"originAmount": {
"currency": "SGD",
"value": 100
},
"saleAmount": {
"currency": "SGD",
"value": 80
},
"contents": [
{
"type": "IMAGE",
"scene": "BACKGROUND",
"value": "https://wwww.example.com/images/uploads/meals/test.png"
}
]
}
]
}
]
}
]
}
]
}
}
Hide an item
To hide an item, specify the value of the status parameter as REMOVED
and the item will be invisible to users:
{
"requestId": "20221122211***",
"appId": "21020101154***",
"store": {
"storeId": "20221017storeid01",
"menus": [
{
"menuId": "menu_id_01",
"categories": [
{
"categoryId": "category_id_01",
"items": [
{
"itemId": "item_01",
"status": "REMOVED"
}
]
}
]
}
]
}
}