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:
  • 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.

  • Maximum length: 255 characters

"20220112115009000116419747301498"

address

String

No

Indicates the address of the shopping area.

  • Maximum length: 1024 characters

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.

  • Maximum size: 5 elements
  • Element maximum length: 255 characters

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.

  • Maximum length: 64 characters

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.

  • Maximum length: 1024 characters

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.

  • Maximum size: 20 elements

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 : The shopping area is open and available for users to place orders.
  • CLOSED: The shopping area is closed and not available for users to place orders.

"OPEN"

location

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.

  • Maximum size: 20 elements

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.

  • GMT+8:00 or GMT-8:00

-

contactPhoneNos

Array<String>

No

Indicates the contact phone numbers of the shopping area.

  • Maximum size: 3 elements
  • Element maximum length: 64 characters

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.

  • Maximum length: 1024 characters

"178 Street"

pickUpContactDetails

Array<ContactDetail>

No

Indicates the contact information of the pickup location.

  • Maximum length: 255 characters

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.

  • Maximum size: 20 elements
  • Element maximum length: 255 characters

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, the comments are available for the shopping area, otherwise, the comments are not available.

true

deliveryFee

Amount

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.

  • Maximum size: 400 elements
  • Element maximum length: 6 characters

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.

  • Maximum size: 3 elements

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.
  • When the value of ruleType is FIXED:
    • If this array's size is 1 element, you can configure up to 90 timeslots.
    • If this array's size is 2 elements, you can configure up to 40 timeslots for each element.
    • If this array's size is 3 elements, you can configure up to 25 timeslots for each element.

[{

"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:

  • DELETED: The shopping area is deleted and not visible to users. Once deleted, the shopping area cannot be retrieved. Call the addShoppingArea API to add it back.

Note: If the value you set is DELETED but the area ID does not exist, S is returned, which means the request to delete the shopping area is successful.

"DELETED"

Response parameters

Field

Data type

Required

Description

result

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 SUCCESS and result.resultMessage is SUCCESS.

U

The status of the request to update the shopping area is unknown.

The corresponding result.resultCode is UNKNOWN_EXCEPTION and result.resultMessage is "An API calling is failed, which is caused by unknown reasons.".

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:

Samples

Request

copy
{
    "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

copy
{
    "result": {
        "resultCode": "SUCCESS",
        "resultStatus": "S",
        "resultMessage": "success"
    }
}