updateStore
POST /v2/pds/store/updateStore
With this API call, the SaaS provider or ISV can update an existing store that has been synchronized via the initializeStore or addStore API, such as making small edits or deleting the store.
Note:
- To update a store, make sure one of the following conditions are met:
- The ShoppingArea object has been synchronized via the initializeShoppingArea or addShoppingArea API, if the store belongs to a shopping area.
- The Brand object has been synchronized via the initializeBrand or addBrand API, if the store belongs to a brand.
- To learn how the update works, check below:
- To update a field, pass the field with a new value.
- To delete a field, pass the field with an empty object, for example, "" for String, {} for Object, [] for Array. The required fields in the initializeStore or addStore API cannot be deleted with this API call.
- If you do not pass a field, it will not be updated.
Structure
A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:
Request parameters
Field | Data type | Required | Description | Example |
appId | String | No | Indicates the unique ID assigned by Mini Program Platform to identify a mini program.
Note: Obtain this field via the my.getAppIdSync JSAPI or Mini Program Platform. | "2102010113769***" |
storeId | String | Yes | Indicates the unique ID assigned by the SaaS provider or ISV to identify a store.
| "000000032" |
name | String | No | Indicates the name of the store.
Note: This field should be in English. If multi-language is needed, refer to MultiLanguageDetail. | "MOM FOOD" |
storeType | String | No | Indicates the type of the store. Valid values are:
| "HAWKER" |
address | String | No | Indicates the address of the store.
Note: This field should be in English. If multi-language is needed, refer to MultiLanguageDetail. | "311 New Upper Changi Rd, Singapore 467360" |
images | Array<String> | No | Indicates a list of image URLs of the store.
Note: To add or update an element of this array, pass the entire new list. We will replace the old list of elements with the new list. | - |
storeStatus | String | No | Indicates the status of the store. Valid values are:
| "OPEN" |
announcement | Array<ContentModel> | No | Indicates the announcement of the store.
Note: To add or update an element of this array, pass the entire new list. We will replace the old list of elements with the new list. | [ { "ContentType": "TEXT", "value": "We are open!" }, { "ContentType": "IMAGE", "value": "https://wdsas/dsad.jpg" } ] |
description | String | No | Indicates the description of the store.
Note: This field should be in English. If multi-language is needed, refer to MultiLanguageDetail. | "We sell Chinese Food!" |
location | No | Indicates the geographic location of the store. | {"latitude":40.659569, "longitude": -73.851524} or {"postCode":"310000"} | |
serviceAvailabilityList | Array<ServiceAvailability> | No | Indicates the business hours of the store.
Note: To add or update any ServiceAbility object, pass the entire new list. We will replace the old list with the new one. | - |
multiLanguageDetails | Array<MultiLanguageDetail> | No | Indicates the details of the multi-language content.
Note: If the MultiLanguageDetail object you pass already exists, it will be updated, otherwise, it will be added. | - |
timeZone | String | No | Indicates the time zone of the store's location.
| - |
cuisine | String | No | Indicates the cuisine type of the store.
| "Chinese food" |
contactPhoneNos | Array<String> | No | Indicates the contact phone numbers of the store.
Note: To add or update an element of this array, pass the entire new list. We will replace the old list of elements with the new list. | ["18376545678"] |
pickUpAddress | String | No | Indicates the location for users to pick up their food.
| "178 Street" |
pickUpContactDetails | Array<ContactDetail> | No | Indicates the contact information of the pickup location.
Note: To add or update an element of this array, pass the entire new list. We will replace the old list of elements with the new list. | "john" |
banners | Array<BannerModel> | No | Indicates the banner attribute.
Note: To add or update an element of this array, pass the entire new list. We will replace the old list of elements with the new list. | - |
recommendItemIds | Array<String> | No | Indicates a list of IDs to identify the recommended items.
Note: To add or update an element of this array, pass the entire new list. We will replace the old list of elements with the new list. | - |
businessRules | Array<BusinessRule> | No | Indicates the business rules, for example, the delivery fee rules, the pickup schedule rules, etc. Maximum size: 20 elements Note: For the sample implementations to specify a store's business rules, see Business rules for Store. | - |
isDeleted | String | No | Indicates whether the store is deleted. The valid value is:
Note: If the value you set is | "DELETED" |
extInfo | String | No | Indicates the extended information of the store.
Note:
| - |
Response parameters
Field | Data type | Required | Description |
result | Yes | Indicates the request result, such as status and error codes. |
Result process logic
In the response, the result.resultStatus field indicates the result of processing a request. The following table describes each result status:
Result status | Description |
S | The store is updated successfully. The corresponding result.resultCode is |
U | The status of the request to update the store is unknown. The corresponding result.resultCode is For details, see the Common error codes section. |
F | Failed to update the store. The corresponding result.resultCode and result.resultMessage may vary based on different situations. For details, see the following Error codes section. |
Error codes
Error codes are usually classified into the following categories:
- Common error codes are common for F&B mini program OpenAPIs. Â
Samples
Request
{
"appId": "2102010113769***",
"storeId": "lzteststore879856",
"name": "Store D",
"storeType": "HAWKER",
"address": "Toy Centre,Road C,District B,City A,Country Z",
"images": [
"https://www.example.com/iamges/cdZOWIR73/0011icon.jpg"
],
"storeStatus": "OPEN",
"announcement": [
{
"contentType": "TEXT",
"value": "introduce"
}
],
"description": "",
"location": {
"latitude": "1.3548791",
"longitude": "103.8308643",
"postCode": "999999"
},
"serviceAvailabilityList": [
{
"dayOfWeek": "SUNDAY",
"timePeriods": [
{
"startTime": "07:00",
"endTime": "09:00",
"description": "timePeriod desc"
}
]
},
{
"dayOfWeek": "MONDAY",
"timePeriods": [
{
"startTime": "07:00",
"endTime": "09:00",
"description": "timePeriod desc"
}
]
},
{
"dayOfWeek": "TUESDAY",
"timePeriods": [
{
"startTime": "07:00",
"endTime": "09:00",
"description": "timePeriod desc"
}
]
},
{
"dayOfWeek": "WEDNESDAY",
"timePeriods": [
{
"startTime": "07:00",
"endTime": "09:00",
"description": "timePeriod desc"
}
]
},
{
"dayOfWeek": "THURSDAY",
"timePeriods": [
{
"startTime": "07:00",
"endTime": "09:00",
"description": "timePeriod desc"
}
]
}
],
"timeZone": "GMT+8:00",
"cuisine": "ethnic food",
"contactPhoneNos": [
"99999999"
],
"pickUpAddress": "door one",
"pickUpContactDetails": [
{
"name": "Will",
"phoneNo": "999999999"
}
],
"banners": [
{
"imageUrl": "https://www.example.com/images/antfincdn/dPRmkkfWX/0161icon.jpg",
"landingUrl": "https://www.example.com"
}
],
"recommendItemIds": [
"singleItem1234"
]
}
Business rules for Store
The following code excerpts demonstrate the business rules of a store:
Specify delivery distance rule
{
"businessRule": [
{
"scene": "DELIVERY_DISTANCE",
"ruleData": "[{\"from\":0,\"to\":5000,\"fee\":{\"currency\":\"SGD\",\"amountValue\":500},\"minimumOrderAmount\":{\"currency\":\"SGD\",\"amountValue\":1000},\"discounts\":[{\"discountType\":\"REDUCE\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"amountValue\":1000},\"discountValue\":\"{\\\"currency\\\": \\\"SGD\\\", \\\"amountValue\\\":1000}\"},{\"discountType\":\"PERCENTAGE\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"amountValue\":100},\"discountValue\":\"20\"},{\"discountType\":\"EXEMPTION\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"amountValue\":3000}}]},{\"from\":5000,\"to\":10000,\"fee\":{\"currency\":\"SGD\",\"amountValue\":1000},\"minimumOrderAmount\":{\"currency\":\"SGD\",\"amountValue\":2000},\"discounts\":[{\"discountType\":\"REDUCE\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"amountValue\":2000},\"discountValue\":\"{\\\"currency\\\": \\\"SGD\\\", \\\"amountValue\\\":1000}\"},{\"discountType\":\"PERCENTAGE\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"amountValue\":3000},\"discountValue\":\"20\"},{\"discountType\":\"EXEMPTION\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"amountValue\":4000}}]},{\"from\":10000,\"to\":100000,\"fee\":{\"currency\":\"SGD\",\"amountValue\":2000},\"minimumOrderAmount\":{\"currency\":\"SGD\",\"amountValue\":5000},\"discounts\":[{\"discountType\":\"REDUCE\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"amountValue\":5000},\"discountValue\":\"{\\\"currency\\\": \\\"SGD\\\", \\\"amountValue\\\":1000}\"},{\"discountType\":\"PERCENTAGE\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"amountValue\":6000},\"discountValue\":\"20\"},{\"discountType\":\"EXEMPTION\",\"orderThresholdAmount\":{\"currency\":\"SGD\",\"amountValue\":7000}}]}]"
}
]
}
Specify delivery schedule
{
"businessRule": [
{
"scene": "DELIVERY_SCHEDULE",
"ruleData": "[{\"scheduleType\":\"WEEKLY\",\"supportDays\":30,\"schedules\":{\"MONDAY\":[{\"startTime\":\"10:00\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"TUESDAY\":[{\"startTime\":\"10:10\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"WEDNESDAY\":[{\"startTime\":\"10:20\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"THURSDAY\":[{\"startTime\":\"10:30\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"FRIDAY\":[{\"startTime\":\"10:40\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"SATURDAY\":[{\"startTime\":\"10:50\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"SUNDAY\":[{\"startTime\":\"11:00\",\"endTime\":\"11:30\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}]}}]"
}
]
}
Specify pickup rule
{
"businessRule": [
{
"scene": "PICKUP_RULE",
"ruleData": "[{\"minimumOrderAmount\":{\"currency\":\"SGD\",\"amountValue\":1800}}]"
}
]
}
Specify pickup schedule
{
"businessRule": [
{
"scene": "PICKUP_SCHEDULE",
"ruleData": "[{\"scheduleType\":\"WEEKLY\",\"supportDays\":30,\"schedules\":{\"MONDAY\":[{\"startTime\":\"10:00\",\"endTime\":\"12:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"TUESDAY\":[{\"startTime\":\"10:10\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"WEDNESDAY\":[{\"startTime\":\"10:20\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"THURSDAY\":[{\"startTime\":\"10:30\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"FRIDAY\":[{\"startTime\":\"10:40\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"SATURDAY\":[{\"startTime\":\"10:50\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"SUNDAY\":[{\"startTime\":\"11:00\",\"endTime\":\"11:30\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}]}}]"
}
]
}
Specify dine-in order rule
{
"businessRule": [
{
"scene": "DINE_IN_ORDER",
"ruleData": "{\"isTableNoRequired\": false,\"serviceType\": \"SERVE_TO_TABLE\"}"
}
]
}
Specify dine-in schedule
{
"businessRule": [
{
"scene": "DINE_IN_SCHEDULE",
"ruleData": "[{\"scheduleType\":\"WEEKLY\",\"supportDays\":31,\"schedules\":{\"MONDAY\":[{\"startTime\":\"09:00\",\"endTime\":\"12:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"TUESDAY\":[{\"startTime\":\"10:10\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"WEDNESDAY\":[{\"startTime\":\"10:20\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"THURSDAY\":[{\"startTime\":\"10:30\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"FRIDAY\":[{\"startTime\":\"10:40\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"SATURDAY\":[{\"startTime\":\"10:50\",\"endTime\":\"11:00\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}],\"SUNDAY\":[{\"startTime\":\"11:00\",\"endTime\":\"11:30\"},{\"startTime\":\"12:00\",\"endTime\":\"13:00\"},{\"startTime\":\"14:00\",\"endTime\":\"15:00\"},{\"startTime\":\"18:00\",\"endTime\":\"20:00\"},{\"startTime\":\"21:00\",\"endTime\":\"22:00\"}]}}]"
}
]
}
Response
{
"result": {
"resultCode": "SUCCESS",
"resultStatus": "S",
"resultMessage": "success"
}
}