updateCategory
POST /v2/pds/store/updateCategory
With this API call, the SaaS provider or ISV can update an existing category that has been synchronized via the initializeStore or addCategory API, such as making small edits or deleting the category.
- To update a category, categoryId is required. Determine which category to update with categoryId, storeId, menuId, 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 addCategory 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 |
categoryId | String | Yes | Indicates the category ID.
Note: Passing only the category ID will update multiple categories with the same category ID. | "0000000004" |
storeId | String | No | Indicates the ID assigned by the SaaS provider or ISV to identify a store.
Note: Pass this field to update a specific category 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" |
menuId | String | No | Indicates the ID of the menu to which the category belongs.
Note: Pass this field to update a specific category for the specified menu. Before that, make sure the Menu object has been synchronized via the initializeStore or addMenu API and is not deleted. | "0000000003" |
menuType | String | No | Indicates the type of the menu. Valid values are:
Note:
| "PICKUP" |
title | String | No | Indicates the title of the category.
Note: This field should be in English. If multi-language is needed, refer to MultiLanguageDetail. | "Hamburger" |
subTitle | String | No | Indicates the subtitle of the category.
Note: This field should be in English. If multi-language is needed, refer to MultiLanguageDetail. | "Big Hamburger" |
icon | String | No | Indicates the icon of the menu.
| - |
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. | - |
isDeleted | String | No | Indicates whether the category 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 category is updated successfully. The corresponding result.resultCode is |
U | The status of the request to update the category is unknown. The corresponding result.resultCode is For details, see the Common error codes section. |
F | Failed to update the category. 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
{
"storeId": "lzteststore75772345",
"menuId": "M1110",
"menuType": "PICKUP",
"categoryId": "100",
"title": "Others",
"subTitle": "",
"icon": "http://www.example.com/iamges/cdZOWIR73/00ACicon.jpg"
}
Response
{
"result": {
"resultCode": "SUCCESS",
"resultStatus": "S",
"resultMessage": "success"
}
}