---
# System prepended metadata

title: EC1-386 - Create API for add sku in SSC
tags: [SSC, Ecommerce 1, Sprint 24]

---

# EC1-386 - Create API for add sku in SSC


## API Test Scenarios
#### Test Scenario 1
```gherkin
Scenario Outline: As an Admin, I should get error message due to add SKU with blank mandatory field
    Given the user has logged in as Admin
    When the user input <mandatoryField> with blank
        And the user hit add catalogue endpoint
    Then show error message
    Examples:
    | mandatoryField           |
    | ------------------------ |
    | externalId               |
    | name                     |
    | brandId                  |
    | firstCatalogueCategoryId |
    | lastCatalogueCategoryId  |
    | unitOfMeasureId          |
    | catalogueKeywords        |
    | retailBuyingPrice        |
    | catalogueImages          |
    | catalogueDimension       |
    | catalogueWeight          |
    | packagedQty              |
    | segmentationWarehouseIds |
```

#### Test Scenario 2
```gherkin
Scenario Outline: As an Admin, I should get error message due to input wrong format value to fields
    Given the user has logged in as Admin
    When the user input <inputField> with <wrongInput>
        And the user hit add catalogue endpoint
    Then show error message
    Examples:
    | inputField                  | wrongInput |
    | --------------------------- | ---------- |
    | externalId                  | alphabet   |
    | brandId                     | alphabet   |
    | firstCatalogueCategoryId    | alphabet   |
    | lastCatalogueCategoryId     | alphabet   |
    | stock                       | alphabet   |
    | unitOfMeasureId             | alphabet   |
    | discountedRetailBuyingPrice | alphabet   |
    | retailBuyingPrice           | alphabet   |
    | catalogueDimension          | alphabet   |
    | catalogueWeight             | alphabet   |
    | packagedDimension           | alphabet   |
    | packagedWeight              | alphabet   |
    | dangerItem                  | number     |
    | packagedQty                 | alphabet   |
    | minQty                      | alphabet   |
    | minQtyType                  | alphabet   |
    | multipleQty                 | alphabet   |
    | multipleQtyType             | alphabet   |
    | displayStock                | number     |
    | catalogueTaxId              | alphabet   |
    | unlimitedStock              | number     |
    | status                      | number     |
    | isBonus                     | number     |
    | segmentationWarehouseIds    | alphabet   |
    | segmentationTypeIds         | alphabet   |
    | segmentationGroupIds        | alphabet   |
    | segmentationChannelIds      | alphabet   |
    | segmentationClusterIds      | alphabet   |
    
```

#### Test Scenario 3
```gherkin
Scenario: As an Admin, I should get error message due to duplicate external_id
    Given the user has logged in as Admin
    When the user input existing external_id
        And the user hit add catalogue endpoint
    Then show error message
```

#### Test Scenario 4
```gherkin
Scenario: As an Admin, I want to add SKU as bonus SKU
    Given the user has logged in as Admin
    When the user input is_Bonus value as true
        And the user input other fields
        And the user hit add catalogue endpoint
    Then SKU successfully added as Bonus SKU
```

#### Test Scenario 5
```gherkin
Scenario: As an Admin, I want to add SKU as regular SKU
    Given the user has logged in as Admin
    When the user input is_Bonus value as false
        And the user input other fields
        And the user hit add catalogue endpoint
    Then SKU successfully added as Regular SKU
```

#### Test Scenario 6
```gherkin
Scenario: As an Admin, I want to add SKU using new store segmentation type
    Given the user has logged in as Admin
    When the user input segmentation fields with new store segmentation type
        And the user input other fields
        And the user hit add catalogue endpoint
    Then SKU successfully added
        And automatically create the store segmentation as new store segmentation type
```

#### Test Scenario 7
```gherkin
Scenario: As an Admin, I want to add SKU using existing store segmentation type
    Given the user has logged in as Admin
        And segmentation <A> already exist
    When the user input segmentation fields with segmentation <A> type
        And the user input other fields
        And the user hit add catalogue endpoint
    Then SKU successfully added
        And automatically assign created SKU to segmentation <A>
```

###### tags: `Sprint 24` `Ecommerce 1` `SSC`