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

  • Maximum length: 32 characters
  • Characters not allowed: special characters such as @ # ?

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.

  • Maximum length: 255 characters

"000000032"

name

String

No

Indicates the name of the store.

  • Maximum length: 255 characters

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:

  • RESTAURANT: Full-service restaurant
  • HAWKER: Hawker in a hawker center

"HAWKER"

address

String

No

Indicates the address of the store.

  • Maximum length: 1024 characters

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.

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

-

storeStatus

String

No

Indicates the status of the store.

Valid values are:

  • OPEN: The store is open.
  • CLOSED: The store is closed.

"OPEN"

announcement

Array<ContentModel>

No

Indicates the announcement of the store.

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

[

{

"ContentType": "TEXT",

"value": "We are open!"

},

{

"ContentType": "IMAGE",

"value": "https://wdsas/dsad.jpg"

}

]

description

String

No

Indicates the description of the store.

  • Maximum length: 1024 characters

Note: This field should be in English. If multi-language is needed, refer to MultiLanguageDetail.

"We sell Chinese Food!"

location

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.

  • Maximum size: 20 elements

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.

  • 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 store's location.

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

-

cuisine

String

No

Indicates the cuisine type of the store.

  • Maximum length: 100 characters

"Chinese food"

contactPhoneNos

Array<String>

No

Indicates the contact phone numbers of the store.

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

["18376545678"]

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"

banners

Array<BannerModel>

No

Indicates the banner attribute.

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

-

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.

-

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:

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

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

"DELETED"

extInfo

String

No

Indicates the extended information of the store.

  • Maximum length: 4096 characters

Note:

  • Specify the mccType parameter that indicates the category of the merchant's business type, for example, "5814".
  • Specify the inQueueScopes parameter, which indicates the scopes that support in-queue orders. This parameter is in JSON format containing an Array<String> object (Maximum size: 3 elements). Valid values are:
    • PICKUP: Food that is picked up by users themselves.
    • DINEIN: Food that is eaten in the restaurant where it is ordered.
    • DELIVERY: Food that requests delivery to a specific destination.
  • Specify the reservationScopes parameter, which indicates the scopes that support scheduled orders. This parameter is in JSON format containing an Array<String> object (Maximum size: 3 elements). Valid values are:
    • PICKUP: Food that is picked up by users themselves.
    • DINEIN: Food that is eaten in the restaurant where it is ordered.
    • DELIVERY: Food that requests delivery to a specific destination.

-

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 store is updated successfully.

The corresponding result.resultCode is SUCCESS and result.resultMessage is SUCCESS.

U

The status of the request to update the store 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 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:

Samples

Request

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

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

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

copy
{
    "businessRule": [
        {
            "scene": "PICKUP_RULE",
            "ruleData": "[{\"minimumOrderAmount\":{\"currency\":\"SGD\",\"amountValue\":1800}}]"
        }
    ]
}

Specify pickup schedule

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

copy
{
    "businessRule": [
        {
            "scene": "DINE_IN_ORDER",
            "ruleData": "{\"isTableNoRequired\": false,\"serviceType\": \"SERVE_TO_TABLE\"}"
        }
    ]
}

Specify dine-in schedule

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

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