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.
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.
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.
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.
Note:
| ["100000it21","200000it24"] |
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.
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:
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 modifier group is updated successfully. The corresponding result.resultCode is |
U | The status of the request to update the modifier group is unknown. The corresponding result.resultCode is 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:
- Common error codes are common for F&B mini program OpenAPIs. Â
Samples
Request
{
"groupId": "tpgroup123",
"storeId": "lzteststore879856",
"groupName": "extra dish",
"childItemIds": [
"addonItem256"
],
"quantityRule": {
"min": 1,
"max": 4
}
}
Response
{
"result": {
"resultCode": "SUCCESS",
"resultStatus": "S",
"resultMessage": "success"
}
}