updateModifierGroup

POST /v2/pds/item/updateModifierGroup

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

Note:

  • To update a modifier group, groupId is required. Determine which modifier group to update with groupId and storeId. 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 addModifierGroup 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

groupId

String

Yes

Indicates the ID assigned by the SaaS provider or ISV to identify a modifier group. A modifier group can belong to multiple items.

  • Maximum length: 255 characters

Note: Passing only the group ID will update multiple modifier groups with the same group ID.

"1000000gr23"

storeId

String

No

Indicates the ID assigned by the SaaS provider or ISV to identify a store to which the modifier group belongs.

  • Maximum length: 255 characters

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

"1000000gr23"

groupName

String

No

Indicates the name of the modifier group.

  • Maximum length: 255 characters

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

"main food"

childItemIds

Array<String>

No

Indicates a list of add-on item IDs in the modifier group.

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

Note:

  • The item ID must belong to an add-on item, otherwise the verification will fail.
  • 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.
  • The child item IDs and the groud ID must belong to the same store.
  • If a child item ID is removed from the modifier group, the item object still exists. To delete a specific item object, call the updateItem API.

["100000it21","200000it24"]

quantityRule

QuantityRule

No

Indicates the quantity rule that constrains the total number of add-on items that can be ordered within a modifier group. For example, {"max":4,"min":1} means that within a modifier group, users are required to purchase at least 1 add-on item, and they can purchase 4 add-on items at most.

Note: To update the quantity rule, pass the entire new quantity rule. We will replace the old rule with the new one.

{"max":4,"min":0}

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.

[{"column":"groupName","languageKey":"en","value":"main food"},

{"column":"groupName","languageKey":"zh_cn","value":"主食"}]

isDeleted

String

No

Indicates whether the modifier group is deleted.

The valid value is:

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

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

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

U

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

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
{
    "groupId": "tpgroup123",
    "storeId": "lzteststore879856",
    "groupName": "extra dish",
    "childItemIds": [
        "addonItem256"
    ],
    "quantityRule": {
        "min": 1,
        "max": 4
    }
}

Response

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