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

# Criar Produto

> Cadastra um novo Produto Mestre no catálogo base do sistema OmniDom.

### Body

<ParamField body="sku" type="string" required>SKU único interno.</ParamField>
<ParamField body="commercialName" type="string" required>Nome comercial do produto.</ParamField>
<ParamField body="brand" type="string">Opcional. Marca.</ParamField>
<ParamField body="type" type="string" required>Mapeamento de tipo de produto (`SIMPLE`, `KIT`, ou `MANUFACTURED`).</ParamField>
<ParamField body="unitOfMeasure" type="string" default="UN">Unidade de Medida Comercial.</ParamField>

### Response

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "cffbca85-da89-4b2a-aecf-31422abcb34a",
    "tenantId": "e305e9a4-585e-49b8-bc88-9fba992c6326",
    "sku": "PROD-123",
    "commercialName": "Cabo USB-C",
    "brand": "Apple",
    "type": "SIMPLE",
    "status": "APPROVED",
    "createdAt": "2024-02-15T10:00:00.000Z"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml post /products
openapi: 3.0.0
info:
  title: Hub Marketplace API
  description: API for managing marketplace listings and keys
  version: '1.0'
  contact: {}
servers: []
security: []
tags:
  - name: listings
    description: ''
paths:
  /products:
    post:
      tags:
        - Products
      summary: Create a new product
      operationId: ProductController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProductDto'
      responses:
        '201':
          description: The product has been successfully created.
        '400':
          description: Bad Request.
components:
  schemas:
    CreateProductDto:
      type: object
      properties:
        commercialName:
          type: string
          description: Commercial Product Name
          example: Wireless Mouse
        fiscalName:
          type: string
          description: Fiscal Product Name (for invoices)
          example: Mouse Sem Fio Wireless USB
        suggestedPrice:
          type: number
          description: Suggested Price (Price Ceiling)
          example: 149.9
        marginPercentage:
          type: number
          description: Margin Percentage
          example: 30.5
        volumesCount:
          type: number
          description: Number of Volumes
          example: 1
          default: 1
        supplierId:
          type: string
          description: Supplier ID
        groupId:
          type: string
          description: Product Group ID
        defaultWarehouseId:
          type: string
          description: Default Warehouse ID
        externalSku:
          type: string
          description: External SKU (Supplier SKU)
        supplierProductName:
          type: string
          description: Supplier Product Name
        sku:
          type: string
          description: SKU (Stock Keeping Unit)
          example: MOUSE-001
        type:
          type: string
          description: Product Type
          enum:
            - SIMPLE
            - KIT
            - MANUFACTURED
          default: SIMPLE
        status:
          type: string
          description: Product Status
          enum:
            - ACTIVE
            - INACTIVE
          default: ACTIVE
        isVariationTemplate:
          type: boolean
          description: Is Variation Template (Parent)
          default: false
        price:
          type: number
          description: Price
          example: 99.9
          default: 0
        category:
          type: string
          description: Category
          example: Electronics
        ean:
          type: string
          description: EAN / GTIN
          example: '7890000000000'
        ncm:
          type: string
          description: NCM Code
          example: '85072000'
        cfop:
          type: string
          description: CFOP Code
          example: '5102'
        cst:
          type: string
          description: CST/CSOSN Code
          example: '102'
        fiscal:
          description: Fiscal Data (Complete)
          allOf:
            - $ref: '#/components/schemas/ProductFiscalDto'
        components:
          description: Kit Components (only for KIT/MANUFACTURED)
          type: array
          items:
            $ref: '#/components/schemas/ProductComponentDto'
        weight:
          type: number
          description: Weight (kg)
        height:
          type: number
          description: Height (cm)
        width:
          type: number
          description: Width (cm)
        length:
          type: number
          description: Length (cm)
        costAvg:
          type: number
          description: Average Cost
        costManual:
          type: number
          description: Manual Cost
        parentProductId:
          type: string
          description: Parent Product ID (if variant)
        variationAttributes:
          type: object
          description: 'Variation Attributes (e.g. { color: "Red" })'
        variations:
          description: Product Variations
          type: array
          items:
            $ref: '#/components/schemas/ProductVariationDto'
      required:
        - commercialName
        - fiscalName
        - volumesCount
        - sku
        - type
        - status
        - isVariationTemplate
        - price
    ProductFiscalDto:
      type: object
      properties:
        ncm:
          type: string
          maxLength: 8
        cest:
          type: string
          maxLength: 7
        origin:
          type: string
          maxLength: 1
        cfopEntry:
          type: string
          maxLength: 4
        cfopExit:
          type: string
          maxLength: 4
        cstIcms:
          type: string
          maxLength: 3
        cstIpi:
          type: string
          maxLength: 2
        cstPis:
          type: string
          maxLength: 2
        cstCofins:
          type: string
          maxLength: 2
        pIcms:
          type: number
        pIpi:
          type: number
        pPis:
          type: number
        pCofins:
          type: number
        cClassTrib:
          type: string
          maxLength: 6
        cstIbsCbs:
          type: string
          maxLength: 2
        pIbsUf:
          type: number
        pIbsMun:
          type: number
        pCbs:
          type: number
        isSubjectToSelectiveTax:
          type: boolean
          default: false
        taxRuleNotes:
          type: string
    ProductComponentDto:
      type: object
      properties:
        componentId:
          type: string
          description: ID of the component product
          example: uuid-v4
        quantity:
          type: number
          description: Quantity of the component in the kit
          example: 1
          minimum: 1
        lossPercentage:
          type: number
          description: Loss percentage for manufacturing
          example: 0
        isMainItem:
          type: boolean
          description: Whether this is the main item in the kit
          default: false
        displayInDescription:
          type: boolean
          description: Whether to display this component in the marketplace description
          default: true
        affectsPrice:
          type: boolean
          description: Whether this component affects the final price
          default: true
      required:
        - componentId
        - quantity
    ProductVariationDto:
      type: object
      properties:
        commercialName:
          type: string
          description: Commercial Product Name
          example: Wireless Mouse
        fiscalName:
          type: string
          description: Fiscal Product Name (for invoices)
          example: Mouse Sem Fio Wireless USB
        suggestedPrice:
          type: number
          description: Suggested Price (Price Ceiling)
          example: 149.9
        marginPercentage:
          type: number
          description: Margin Percentage
          example: 30.5
        volumesCount:
          type: number
          description: Number of Volumes
          example: 1
          default: 1
        supplierId:
          type: string
          description: Supplier ID
        groupId:
          type: string
          description: Product Group ID
        defaultWarehouseId:
          type: string
          description: Default Warehouse ID
        externalSku:
          type: string
          description: External SKU (Supplier SKU)
        supplierProductName:
          type: string
          description: Supplier Product Name
        sku:
          type: string
          description: SKU (Stock Keeping Unit)
          example: MOUSE-001
        type:
          type: string
          description: Product Type
          enum:
            - SIMPLE
            - KIT
            - MANUFACTURED
          default: SIMPLE
        status:
          type: string
          description: Product Status
          enum:
            - ACTIVE
            - INACTIVE
          default: ACTIVE
        isVariationTemplate:
          type: boolean
          description: Is Variation Template (Parent)
          default: false
        price:
          type: number
          description: Price
          example: 99.9
          default: 0
        category:
          type: string
          description: Category
          example: Electronics
        ean:
          type: string
          description: EAN / GTIN
          example: '7890000000000'
        ncm:
          type: string
          description: NCM Code
          example: '85072000'
        cfop:
          type: string
          description: CFOP Code
          example: '5102'
        cst:
          type: string
          description: CST/CSOSN Code
          example: '102'
        fiscal:
          description: Fiscal Data (Complete)
          allOf:
            - $ref: '#/components/schemas/ProductFiscalDto'
        components:
          description: Kit Components (only for KIT/MANUFACTURED)
          type: array
          items:
            $ref: '#/components/schemas/ProductComponentDto'
        weight:
          type: number
          description: Weight (kg)
        height:
          type: number
          description: Height (cm)
        width:
          type: number
          description: Width (cm)
        length:
          type: number
          description: Length (cm)
        costAvg:
          type: number
          description: Average Cost
        costManual:
          type: number
          description: Manual Cost
        parentProductId:
          type: string
          description: Parent Product ID (if variant)
        variationAttributes:
          type: object
          description: 'Variation Attributes (e.g. { color: "Red" })'
        variations:
          description: Product Variations
          type: array
          items:
            $ref: '#/components/schemas/ProductVariationDto'
        id:
          type: string
          description: ID of existing variation (optional for new ones)
        _deleted:
          type: boolean
          description: Flag to delete variation
          default: false
      required:
        - commercialName
        - fiscalName
        - volumesCount
        - sku
        - type
        - status
        - isVariationTemplate
        - price

````