updateMenu

POST /v2/pds/store/updateMenu

With this API call, the SaaS provider or ISV can update an existing menu that has been synchronized via the initializeStore or addMenu API, such as making small edits or deleting the menu.

Note:

  • To update a menu, menuId is required. Determine which menu to update with menuId, storeId, and menuType. For more information, refer to Request parameters.
  • 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 addMenu 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

menuId

String

Yes

Indicates the ID assigned by the SaaS provider or ISV to identify a menu.

  • Maximum length: 255 characters

Note: Passing only the menu ID will update multiple menus with the same menu ID.

"000000032"

storeId

String

No

Indicates the ID of the store to which the menu belongs.

  • Maximum length: 255 characters

Note: Pass this field to update a specific menu for the specified store. Before that, make sure the Store object has been synchronized via the initializeStore or addStore API and is not deleted.

"000000032"

menuType

String

No

Indicates the type of the menu.

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.

Note:

  • Pass this field to update a specific menu for the specified menu type.
  • If you pass menuId and menuType, make sure the menu information for these two fields has been synchronized via the initializeStore or addMenu API.

"PICKUP"

title

String

No

Indicates the title of the menu.

  • Maximum length: 255 characters

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

"COMBO"

subTitle

String

No

Indicates the subtitle of the menu.

  • Maximum length: 255 characters

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

"DRINKS"

menuStatus

String

No

Indicates the status of the menu.

Valid values are:

  • VALID: The menu is valid.
  • INVALID: The menu is invalid.

"VALID"

pickUpRules

Array<PickUpRule>

No

Indicates the available pickup time range.

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

-

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.

-

minPrepareMinutes

Integer

No

Indicates at least how many minutes in advance users can order.

  • In minutes.
  • Value range: 1-600

15

isDeleted

String

No

Indicates whether the menu is deleted.

The valid value is:

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

Note: If the value you set is DELETED but the menu ID does not exist, S is returned, which means the request to delete the menu 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 menu is updated successfully.

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

U

The status of the request to update the menu 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 menu.

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
{
    "menuId": "M1110",
    "storeId": "lzteststore879856",
    "menuType": "PICKUP",
    "title": "Breakfast",
    "subTitle": "",
    "menuStatus": "VALID",
    "pickUpRules": [
        {
            "startTime": "08:00",
            "endTime": "09:30",
            "step": "30",
            "supportDays": 2,
            "minPrepareMinutes": 15
        }
    ],
    "description": "Breakfast menu"
}

Response

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