> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.teez.kz/llms.txt
> Use this file to discover all available pages before exploring further.

# Создание и редактирование товаров

> Создает товары и редактирует информацию о них.

* **Чтобы создать карточку товара**, в поле запроса`productId`напишите `null`.
* **Чтобы редактировать карточку товара**, в поле запроса`productId`укажите ID товара. Например, если вы хотите исправить информацию в текстовом поле карточки, изменить основную категорию товара и т. п.
* **Чтобы создать новый SKU**, в поле запроса`skuId`напишите`null`.
* **Чтобы редактировать SKU**, в поле запроса`productId`укажите ID товара. Например, если вы хотите выбрать другое значение характеристики или изменить цену.

<Info>
  В **одном запросе** можно создать или редактировать **30** карточек товара.
</Info>

<RequestExample>
  ```bash Пример запроса theme={null}
  {
    "products": [
      {
        "shopId": 1,
        "productId": 7,
        "categoryId": 7639,
        "brandId": 254,
        "isLocalMade": true,
        "name": {
          "rus": "Мёд акациевый",
          "kaz": "Акация бал"
        },
        "description": {
          "rus": "<p><strong>Акациевый мёд</strong> — натуральный продукт с мягким ароматом и приятным вкусом.</p><p>Подходит для чая, выпечки и ежедневного употребления.</p>",
          "kaz": "<p><strong>Акация балы</strong> — жұмсақ хош иісті және жағымды дәмі бар табиғи өнім.</p><p>Шайға, тәттілерге және күнделікті қолдануға жарайды.</p>"
        },
        "vat": 0,
        "attributes": [
          {
            "code": "AROMAT",
            "valueCodes": [
              "авокадо",
              "акация"
            ]
          },
          {
            "code": "DENSITY_DEN",
            "valueCodes": [
              "400",
              "480"
            ]
          }
        ],
        "skus": [
          {
            "skuId": 15,
            "attributeValueCodes": [
              "авокадо",
              "400"
            ],
            "price": 102,
            "barcode": "1000000000061"
          },
          {
            "skuId": 16,
            "attributeValueCodes": [
              "авокадо",
              "480"
            ],
            "price": 120,
            "barcode": "1000000000078"
          },
          {
            "skuId": 18,
            "attributeValueCodes": [
              "акация",
              "480"
            ],
            "price": 130,
            "barcode": "1000000000085"
          },
          {
            "skuId": 17,
            "attributeValueCodes": [
              "акация",
              "400"
            ],
            "price": 140,
            "barcode": "1000000000092"
          }
        ]
      }
    ]
  }
  ```
</RequestExample>


## OpenAPI

````yaml POST /api/seller/v1/products/import
openapi: 3.0.1
info:
  title: Teez Seller API — Combined
  version: v1.0
servers:
  - url: https://seller-api.teez.kz
security:
  - oauth2: []
paths:
  /api/seller/v1/products/import:
    post:
      tags:
        - Products
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalImportProductApiRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalImportProductApiResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtendedProblemDetails'
components:
  schemas:
    ExternalImportProductApiRequest:
      type: object
      properties:
        products:
          type: array
          items:
            $ref: '#/components/schemas/ImportProductDto'
          nullable: true
      additionalProperties: false
      description: Запрос на импорт или обновление товара
    ExternalImportProductApiResponse:
      type: object
      properties:
        jobId:
          type: integer
          description: Id задания на импорт
          format: int64
        receivedItems:
          type: integer
          description: Количество полученных товаров
          format: int32
        queuedAt:
          type: string
          description: Время постановки в очередь
          format: date-time
        infoUrl:
          type: string
          description: Ссылка для получения статуса задачи
          nullable: true
      additionalProperties: false
      description: Ответ на импорт товаров
    ExtendedProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        errorCode:
          type: string
          description: Код ошибки
          nullable: true
        errorMessage:
          type: string
          description: Сообщение об ошибке
          nullable: true
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/ErrorDetail'
          description: Детализация ошибок валидации по полям
          nullable: true
      additionalProperties: {}
    ImportProductDto:
      type: object
      properties:
        shopId:
          type: integer
          description: Id магазина (опционально)
          format: int64
          nullable: true
        productId:
          type: integer
          description: Id товара (null — создание нового, иначе — обновление)
          format: int64
          nullable: true
        categoryId:
          type: integer
          description: Id категории (обязательно)
          format: int64
        brandId:
          type: integer
          description: Id бренда (обязательно)
          format: int64
        isLocalMade:
          type: boolean
          description: Сделано в Казахстане
        name:
          $ref: '#/components/schemas/ImportProductMultiLang'
        description:
          $ref: '#/components/schemas/ImportProductMultiLang'
        vat:
          type: integer
          description: Ставка НДС (0 или 12)
          format: int32
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/ImportProductAttribute'
          description: Характеристики товара
          nullable: true
        skus:
          type: array
          items:
            $ref: '#/components/schemas/ImportProductSku'
          description: Массив SKU
          nullable: true
      additionalProperties: false
    ErrorDetail:
      type: object
      properties:
        code:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
      additionalProperties: false
    ImportProductMultiLang:
      type: object
      properties:
        rus:
          type: string
          description: На русском языке (обязательное)
          nullable: true
        kaz:
          type: string
          description: На казахском языке
          nullable: true
      additionalProperties: false
    ImportProductAttribute:
      type: object
      properties:
        code:
          type: string
          description: Id характеристики
          nullable: true
        valueCodes:
          type: array
          items:
            type: string
          description: Id значений характеристики
          nullable: true
      additionalProperties: false
    ImportProductSku:
      type: object
      properties:
        skuId:
          type: integer
          description: Id SKU (null — создание)
          format: int64
          nullable: true
        attributeValueCodes:
          type: array
          items:
            type: string
          description: Значения характеристик
          nullable: true
        price:
          type: number
          description: Цена
          format: double
        barcode:
          type: string
          description: Штрихкод
          nullable: true
        photos:
          type: array
          items:
            $ref: '#/components/schemas/ImportProductPhoto'
          description: Фотографии SKU
          nullable: true
      additionalProperties: false
    ImportProductPhoto:
      type: object
      properties:
        mediaFile:
          type: string
          description: Ссылка на файл
          nullable: true
        order:
          type: integer
          description: Очередность
          format: int32
      additionalProperties: false
  securitySchemes:
    oauth2:
      type: http
      description: Please enter valid JWT token
      scheme: Bearer
      bearerFormat: JWT

````