updateShoppingArea
POST /v2/pds/store/updateShoppingArea
With this API call, the SaaS provider or ISV can update an existing shopping area that has been synchronized via the initializeShoppingArea or addShoppingArea API, such as making small edits or deleting the shopping area.
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 initializeShoppingArea or addShoppingArea 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 |
areaId | String | Yes | Indicates the unique ID assigned by the SaaS provider or ISV to identify a shopping area, such as a hawker center.
| "20220112115009000116419747301498" |
address | String | No | Indicates the address of the shopping area.
Note: This field should be in English. If multi-language is needed, refer to MultiLanguageDetail. | "Toy Hawker Centre,Road C,District B,City A,Country Z" |
images | Array<String> | No | Indicates a list of image URLs of the shopping area.
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. | - |
name | String | No | Indicates the name of the shopping area.
Note: This field should be in English. If multi-language is needed, refer to MultiLanguageDetail. | "Toy Hawker Centre" |
description | String | No | Indicates the description of the shopping area.
Note: This field should be in English. If multi-language is needed, refer to MultiLanguageDetail. | "Toy Hawker Centre, the largest hawker with long history in Singapore" |
serviceAvailabilityList | Array<ServiceAvailability> | No | Indicates the business hours of the shopping area.
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. | - |
shoppingAreaStatus | String | No | Indicates the status of the shopping area. Valid values are:
| "OPEN" |
location | No | Indicates the geographic location of the shopping area. | { "latitude": 40.659569, "longitude": -73.851524 } Or: { "postCode": "310000" } | |
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 shopping area's location.
| - |
contactPhoneNos | Array<String> | No | Indicates the contact phone numbers of the shopping area.
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. | - |
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" |
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. | - |
commentFlag | Boolean | No | Specifies whether comments are available for the shopping area. If the value is | true |
deliveryFee | No | Indicates the delivery fee to be charged. | { "currency": "SGD", "amountValue": 100 } | |
deliveryPostCodes | Array<String> | No | Indicates a list of postcodes for the delivery service.
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. | [ "123456", "23456" ] |
deliveryTimeRules | Array<DeliveryTimeRule> | No | Indicates the time rule that specifies when the delivery service is available.
Note:
| [{ "ruleType": "FIXED", "supportDays": 2, "timeSlots": [ { "startTime": "11:30", "endTime": "12:15" }, { "startTime": "12:30", "endTime": "13:15" } ] }] |
isDeleted | String | No | Indicates whether the shopping area is deleted. The valid value is:
Note: If the value you set is | "DELETED" |
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 shopping area is updated successfully. The corresponding result.resultCode is |
U | The status of the request to update the shopping area is unknown. The corresponding result.resultCode is For details, see the Common error codes section. |
F | Failed to update the shopping area. 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
{
"name": "Toy Hawker",
"areaId": "12321312312",
"address": "Toy Centre,Road C,District B,City A,Country Z",
"description": "",
"images": [
"https://wwww.example.com/images/uploads/meals/2cf2dfssdmgkeqec1c.png"
],
"shoppingAreaStatus": "CLOSED",
"pickUpAddress": "the second door",
"recommendItemIds": [
"singleItem3333"
],
"PickUpContactDetails": [
{
"name": "Will",
"phoneNo": "999999999"
}
],
"timeZone": "GMT+9:00",
"location": {
"latitude": "12.153535353",
"longitude": "125.23535353",
"postCode": "9999999"
},
"contactPhoneNos": [
"9999999999"
],
"commentFlag": false
}
Response
{
"result": {
"resultCode": "SUCCESS",
"resultStatus": "S",
"resultMessage": "success"
}
}