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

# Criar variação do produto



## OpenAPI

````yaml https://erp.olist.com/public-api/v3/swagger/swagger-mintlify.json post /produtos/{idProduto}/variacoes
openapi: 3.0.0
info:
  title: Olist ERP API v3
  description: >-
    Documentação completa: <a href="https://api-docs.erp.olist.com"
    target="_blank">https://api-docs.erp.olist.com</a>
  version: '3.1'
servers:
  - url: https://api.tiny.com.br/public-api/v3
security: []
paths:
  /produtos/{idProduto}/variacoes:
    post:
      tags:
        - Produtos
      summary: Criar variação do produto
      operationId: CriarProdutoVariacaoAction
      parameters:
        - $ref: '#/components/parameters/post_produtos_idProduto_variacoes_idProduto'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariacaoProdutoRequestModel'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CriarProdutoResponseModel'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDTO'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
        '503':
          description: Service Unavailable
      security:
        - bearerAuth: []
components:
  parameters:
    post_produtos_idProduto_variacoes_idProduto:
      name: idProduto
      in: path
      description: Identificador do produto
      required: true
      schema:
        type: integer
  schemas:
    VariacaoProdutoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            sku:
              type: string
              nullable: false
            gtin:
              type: string
              nullable: true
            precos:
              $ref: '#/components/schemas/PrecoVariacaoRequestModel'
            estoque:
              $ref: '#/components/schemas/EstoqueVariacaoRequestModel'
            grade:
              description: >-
                Grade da variação. Cada item deve conter 'chave' e 'valor'. As
                chaves devem corresponder exatamente às chaves informadas na
                grade do produto. A quantidade de itens deve ser igual à
                quantidade de chaves na grade do produto.
              type: array
              items:
                $ref: '#/components/schemas/GradeVariacaoRequestModel'
              nullable: false
          type: object
    CriarProdutoResponseModel:
      title: ' '
      description: ' '
      properties:
        id:
          type: integer
        codigo:
          type: string
        descricao:
          type: string
      type: object
    ErrorDTO:
      title: ' '
      description: ' '
      properties:
        mensagem:
          description: Mensagem de erro geral
          type: string
          example: Ocorreram erros de validação
        detalhes:
          description: Detalhes específicos do erro
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetailDTO'
          example:
            - campo: codigo
              mensagem: O campo código é obrigatório
          nullable: true
      type: object
    PrecoVariacaoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            preco:
              type: number
              format: float
              nullable: true
            precoPromocional:
              type: number
              format: float
              nullable: true
          type: object
    EstoqueVariacaoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            inicial:
              type: number
              format: float
              nullable: true
          type: object
    GradeVariacaoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            chave:
              type: string
              nullable: false
            valor:
              type: string
              nullable: false
          type: object
    ErrorDetailDTO:
      title: ' '
      description: ' '
      properties:
        campo:
          description: Campo que gerou o erro
          type: string
          example: codigo
        mensagem:
          description: Mensagem de erro específica do campo
          type: string
          example: O campo código é obrigatório
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: Bearer

````