# Create ChoiceGroups(in batch)

1. if the ChoiceGroupSku.name is the same as Spu.name, normally they will bound.
2. ChoiceGroup.maxNumber should greater than or equals to ChoiceGroup.minNumber and ChoiceGroup.maxNumber should greater than 0.
3. ChoiceGroupSku.price is required, status is required.

**Rate limit:** 10 QPS by appId dimension.

Endpoint: POST /product/choicegroup/batchcreate
Version: v.1.0.0

## Request fields (application/json):

  - `shopId` (integer, required)
    store id in KeeTa
    Example: 25381

  - `choiceGroupList` (array, required)
    ChoiceGroup data model

  - `choiceGroupList.id` (integer)
    Unique ChoiceGroup ID generated by Keeta system. Not required in OpenItemCode-based APIs. Required for updates in Keeta ID-based APIs.
    Example: 0

  - `choiceGroupList.name` (string, required)
    Display name of the ChoiceGroup
    Example: Sauces

  - `choiceGroupList.sourceLanguageType` (string, required)
    Language code for name field (refer to Menu Integration Guide)
    Example: en

  - `choiceGroupList.nameTranslation` (string)
    Localized name translation
    Example: 選擇醬料

  - `choiceGroupList.targetLanguageType` (string)
    Language code for nameTranslation (required if translation exists), please refer to [Menu API Integration Guide](/apis/standard/docs/menuintegrationguide)
    Example: zh-HK

  - `choiceGroupList.nameTranslateType` (integer)
    Source of name translation. When the value equals 1, it indicates that the name translation was provided by the merchant.
    Example: 1

  - `choiceGroupList.minNumber` (integer, required)
    Minimum number of ChoiceGroupSkus that must be selected
    Example: 0

  - `choiceGroupList.maxNumber` (integer, required)
    Maximum number of ChoiceGroupSkus that can be selected
    Example: 3

  - `choiceGroupList.choiceGroupSkuList` (array, required)
    List of available ChoiceGroupSkus in this ChoiceGroup

  - `choiceGroupList.choiceGroupSkuList.id` (integer)
    Primary key for ChoiceGroupSku, mainly used for order API alignment. Changes when names are modified. Not required in OpenItemCode-based APIs. Required for updates in Keeta ID-based APIs.
    Example: 0

  - `choiceGroupList.choiceGroupSkuList.name` (string, required)
    Display name of the ChoiceGroupSku. Should match SPU name when representing the same product for internal correlation.
    Example: Ketchup

  - `choiceGroupList.choiceGroupSkuList.sourceLanguageType` (string, required)
    Language code for name field (refer to Menu Integration Guide)
    Example: en

  - `choiceGroupList.choiceGroupSkuList.nameTranslation` (string)
    Localized name translation
    Example: 番茄醬

  - `choiceGroupList.choiceGroupSkuList.targetLanguageType` (string)
    Language code for nameTranslation (required if translation exists), please refer to [Menu API Integration Guide](/apis/standard/docs/menuintegrationguide)
    Example: zh-HK

  - `choiceGroupList.choiceGroupSkuList.nameTranslateType` (integer)
    Source of name translation. When the value equals 1, it indicates that the name translation was provided by the merchant.
    Example: 1

  - `choiceGroupList.choiceGroupSkuList.price` (string)
    Delivery price (supports 2 decimal places)
    Example: 12.33

  - `choiceGroupList.choiceGroupSkuList.pickPrice` (string)
    Pickup price (supports 2 decimal places)
    Example: 12.33

  - `choiceGroupList.choiceGroupSkuList.canteenPrice` (string)
    Dine-in price (supports 2 decimal places)
    Example: 12.33

  - `choiceGroupList.choiceGroupSkuList.currency` (string)
    Currency code (refer to "Currency Symbols" enum). Defaults to merchant's currency.
    Example: HKD

  - `choiceGroupList.choiceGroupSkuList.status` (integer, required)
    Availability status:
> 0:  indicates the ChoiceGroupSku is unavailable /
1:  indicates ChoiceGroupSku is available
    Example: 1

  - `choiceGroupList.choiceGroupSkuList.openItemCode` (string, required)
    Third-party ChoiceGroupSku identifier. Mandatory and unique in OpenItemCode-based APIs.
    Example: CHOICE#10001

  - `choiceGroupList.choiceGroupSkuList.allergens` (array)
    Allergen information (refer to Menu API Integration Guide - 4.4 Allergen Information Specification)

  - `choiceGroupList.choiceGroupSkuList.choiceGroupOpenItemCodeList` (array)
    OpenItemCodes of associated nested ChoiceGroups. Using this field for addons (items not sold separately on the menu, and cannot share the same name as any other SPU on the menu) with nested selection needs.

  - `choiceGroupList.choiceGroupSkuList.pictureList` (array)
    ChoiceGroupSku image URLs

  - `choiceGroupList.choiceGroupSkuList.pictureList.url` (string, required)
    ChoiceGroupSku image URLs
    Example: https://img-ap-hongkong.mykeeta.net/sailorproduct/9c760595674b395e330cf94b0e5068b09999.jpg

  - `choiceGroupList.choiceGroupSkuList.relatedSpuOpenItemCode` (string)
    Third-party SPU identifier this ChoiceGroupSku should bind to. Using this to explicitly bind the ChoiceGroupSku to the given SPU.

  - `choiceGroupList.choiceGroupSkuList.relatedSkuOpenItemCode` (string)
    Third-party SKU identifier this ChoiceGroupSku should bind to. Using this to explicitly bind the ChoiceGroupSku to the given SKU. When a ChoiceGroupSku bind to a SKU, it will use the bounded SKU's ChoiceGroups to form a multi-layer ChoiceGroup structure.

  - `choiceGroupList.openItemCode` (string, required)
    Developer-provided ChoiceGroup identifier. Mandatory and unique in OpenItemCode-based APIs.
    Example: GROUP#10001

  - `choiceGroupList.repeatable` (integer)
    Multiple selection flag:
    Example: 0

## Response 200 fields (application/json):

  - `code` (integer, required)
    A numeric status identifier indicating the result of the interface call, used to determine whether the operation executed successfully.
    Example: 0

  - `message` (string, required)
    Text description corresponding to the status code, explaining the operation result or error cause to users.
    Example: Success

  - `data` (array)
    Successful ChoiceGroup data model

  - `data.id` (integer)
    Unique ChoiceGroup ID generated by Keeta system. Not required in OpenItemCode-based APIs. Required for updates in Keeta ID-based APIs.
    Example: 0

  - `data.name` (string, required)
    Display name of the ChoiceGroup
    Example: Sauces

  - `data.sourceLanguageType` (string, required)
    Language code for name field (refer to Menu Integration Guide)
    Example: en

  - `data.nameTranslation` (string)
    Localized name translation
    Example: 選擇醬料

  - `data.targetLanguageType` (string)
    Language code for nameTranslation (required if translation exists), please refer to [Menu API Integration Guide](/apis/standard/docs/menuintegrationguide)
    Example: zh-HK

  - `data.nameTranslateType` (integer)
    Source of name translation. When the value equals 1, it indicates that the name translation was provided by the merchant.
    Example: 1

  - `data.minNumber` (integer, required)
    Minimum number of ChoiceGroupSkus that must be selected
    Example: 0

  - `data.maxNumber` (integer, required)
    Maximum number of ChoiceGroupSkus that can be selected
    Example: 3

  - `data.choiceGroupSkuList` (array, required)
    List of available ChoiceGroupSkus in this ChoiceGroup

  - `data.choiceGroupSkuList.id` (integer)
    Primary key for ChoiceGroupSku, mainly used for order API alignment. Changes when names are modified. Not required in OpenItemCode-based APIs. Required for updates in Keeta ID-based APIs.
    Example: 0

  - `data.choiceGroupSkuList.name` (string, required)
    Display name of the ChoiceGroupSku. Should match SPU name when representing the same product for internal correlation.
    Example: Ketchup

  - `data.choiceGroupSkuList.sourceLanguageType` (string, required)
    Language code for name field (refer to Menu Integration Guide)
    Example: en

  - `data.choiceGroupSkuList.nameTranslation` (string)
    Localized name translation
    Example: 番茄醬

  - `data.choiceGroupSkuList.targetLanguageType` (string)
    Language code for nameTranslation (required if translation exists), please refer to [Menu API Integration Guide](/apis/standard/docs/menuintegrationguide)
    Example: zh-HK

  - `data.choiceGroupSkuList.nameTranslateType` (integer)
    Source of name translation. When the value equals 1, it indicates that the name translation was provided by the merchant.
    Example: 1

  - `data.choiceGroupSkuList.price` (string)
    Delivery price (supports 2 decimal places)
    Example: 12.33

  - `data.choiceGroupSkuList.pickPrice` (string)
    Pickup price (supports 2 decimal places)
    Example: 12.33

  - `data.choiceGroupSkuList.canteenPrice` (string)
    Dine-in price (supports 2 decimal places)
    Example: 12.33

  - `data.choiceGroupSkuList.currency` (string)
    Currency code (refer to "Currency Symbols" enum). Defaults to merchant's currency.
    Example: HKD

  - `data.choiceGroupSkuList.status` (integer, required)
    Availability status:
> 0:  indicates the ChoiceGroupSku is unavailable /
1:  indicates ChoiceGroupSku is available
    Example: 1

  - `data.choiceGroupSkuList.openItemCode` (string, required)
    Third-party ChoiceGroupSku identifier. Mandatory and unique in OpenItemCode-based APIs.
    Example: CHOICE#10001

  - `data.choiceGroupSkuList.allergens` (array)
    Allergen information (refer to Menu API Integration Guide - 4.4 Allergen Information Specification)

  - `data.choiceGroupSkuList.choiceGroupOpenItemCodeList` (array)
    OpenItemCodes of associated nested ChoiceGroups. Using this field for addons (items not sold separately on the menu, and cannot share the same name as any other SPU on the menu) with nested selection needs.

  - `data.choiceGroupSkuList.pictureList` (array)
    ChoiceGroupSku image URLs

  - `data.choiceGroupSkuList.pictureList.url` (string, required)
    ChoiceGroupSku image URLs
    Example: https://img-ap-hongkong.mykeeta.net/sailorproduct/9c760595674b395e330cf94b0e5068b09999.jpg

  - `data.choiceGroupSkuList.relatedSpuOpenItemCode` (string)
    Third-party SPU identifier this ChoiceGroupSku should bind to. Using this to explicitly bind the ChoiceGroupSku to the given SPU.

  - `data.choiceGroupSkuList.relatedSkuOpenItemCode` (string)
    Third-party SKU identifier this ChoiceGroupSku should bind to. Using this to explicitly bind the ChoiceGroupSku to the given SKU. When a ChoiceGroupSku bind to a SKU, it will use the bounded SKU's ChoiceGroups to form a multi-layer ChoiceGroup structure.

  - `data.openItemCode` (string, required)
    Developer-provided ChoiceGroup identifier. Mandatory and unique in OpenItemCode-based APIs.
    Example: GROUP#10001

  - `data.repeatable` (integer)
    Multiple selection flag:
    Example: 0

  - `errorList` (array)
    Failed ChoiceGroup informations

  - `errorList.id` (integer)
    Unique identifier for the Choicegroup (Standard Product Unit), generated by Keeta's system
    Example: 45676543

  - `errorList.name` (string)
    Display name of the Choicegroup

  - `errorList.openItemCode` (string)
    Developer-provided external identifier that maintains a one-to-one mapping with Keeta's internal Choicegroup ID. Refer to the "Menu Development Guide" for implementation details.
    Example: SET-11001000005-3

  - `errorList.code` (integer)
    A numeric status identifier indicating the result of the interface call, used to determine whether the operation executed successfully. **A code value of 0** indicates that **the request was executed successfully**. **Any non-zero code value** indicates that **request execution failed**. **Specific error details** can be viewed in the *message* field.
    Example: 107000104

  - `errorList.message` (string)
    Text description corresponding to the status code, explaining the operation result or error cause to users.
    Example: Data does not exist

