> ## 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 ordem de serviço



## OpenAPI

````yaml https://erp.olist.com/public-api/v3/swagger/swagger-mintlify.json post /ordem-servico
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:
  /ordem-servico:
    post:
      tags:
        - Ordem de Serviço
      summary: Criar ordem de serviço
      operationId: CriarOrdemServicoAction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CriarOrdemServicoRequestModel'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CriarOrdemServicoResponseModel'
        '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:
  schemas:
    CriarOrdemServicoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - $ref: '#/components/schemas/OrdemServicoRequestModel'
        - required:
            - cliente
          properties:
            cliente:
              $ref: '#/components/schemas/ContatoRequestModel'
          type: object
    CriarOrdemServicoResponseModel:
      title: ' '
      description: ' '
      properties:
        id:
          type: integer
        numero:
          type: integer
      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
    OrdemServicoRequestModel:
      title: ' '
      description: ' '
      properties:
        listaPreco:
          $ref: '#/components/schemas/ListaPrecoRequestModel'
        descricao:
          type: string
          nullable: true
        consideracaoFinal:
          type: string
          nullable: true
        dataInicio:
          type: string
          example: '2024-01-01'
          nullable: true
        dataPrevista:
          type: string
          example: '2024-01-01 00:00:00'
          nullable: true
        dataConclusao:
          type: string
          example: '2024-01-01'
          nullable: true
        valorDesconto:
          type: number
          format: float
          nullable: true
        observacao:
          type: string
          nullable: true
        observacaoInterna:
          type: string
          nullable: true
        servicos:
          type: array
          items:
            $ref: '#/components/schemas/ItemOrdemServicoRequestModel'
          nullable: true
        vendedor:
          $ref: '#/components/schemas/VendedorOrdemServicoRequestModel'
        tecnico:
          type: string
          nullable: true
        marcadores:
          type: array
          items:
            $ref: '#/components/schemas/CriarMarcadorRequestModel'
          nullable: true
        anexos:
          type: array
          items:
            $ref: '#/components/schemas/AnexoOrdemServicoRequestModel'
          nullable: true
        pagamento:
          $ref: '#/components/schemas/OrdemServicoPagamentoRequestModel'
        assistenciaTecnica:
          $ref: '#/components/schemas/OrdemServicoAssistenciaTecnicaRequestModel'
        deposito:
          $ref: '#/components/schemas/DepositoRequestModel'
      type: object
    ContatoRequestModel:
      title: ' '
      description: ' '
      properties:
        id:
          type: integer
          nullable: true
      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
    ListaPrecoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
          type: object
    ItemOrdemServicoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            servico:
              $ref: '#/components/schemas/ServicoRequestModel'
            quantidade:
              type: number
              format: float
              nullable: true
            valorUnitario:
              type: number
              format: float
              nullable: true
            porcentagemDesconto:
              type: number
              format: float
              nullable: true
            orcar:
              type: boolean
          type: object
    VendedorOrdemServicoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - $ref: '#/components/schemas/VendedorRequestModel'
        - properties:
            porcentagemComissao:
              type: number
              format: float
              nullable: true
          type: object
    CriarMarcadorRequestModel:
      title: ' '
      description: ' '
      allOf:
        - $ref: '#/components/schemas/BaseMarcadorModel'
        - properties: {}
          type: object
    AnexoOrdemServicoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            url:
              type: string
              nullable: true
          type: object
    OrdemServicoPagamentoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - $ref: '#/components/schemas/PagamentoRequestModel'
        - properties:
            categoria:
              $ref: '#/components/schemas/CategoriaRequestModel'
          type: object
    OrdemServicoAssistenciaTecnicaRequestModel:
      title: ' '
      description: ' '
      properties:
        equipamento:
          type: string
          nullable: true
        numeroSerieEquipamento:
          type: string
          nullable: true
        pecas:
          type: array
          items:
            $ref: '#/components/schemas/PecaOrdemServicoRequestModel'
          nullable: true
      type: object
    DepositoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
          type: object
    ServicoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
          type: object
    VendedorRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
          type: object
    BaseMarcadorModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            descricao:
              type: string
              nullable: true
          type: object
    PagamentoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            formaRecebimento:
              $ref: '#/components/schemas/FormaRecebimentoRequestModel'
            meioPagamento:
              $ref: '#/components/schemas/MeioPagamentoRequestModel'
            parcelas:
              type: array
              items:
                $ref: '#/components/schemas/ParcelaModelRequest'
              nullable: true
          type: object
    CategoriaRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
          type: object
    PecaOrdemServicoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            produto:
              $ref: '#/components/schemas/ProdutoRequestModel'
            quantidade:
              type: number
              format: float
              nullable: true
            valorUnitario:
              type: number
              format: float
              nullable: true
            unidade:
              type: string
              nullable: true
            porcentagemDesconto:
              type: number
              format: float
              nullable: true
          type: object
    FormaRecebimentoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
          type: object
    MeioPagamentoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
          type: object
    ParcelaModelRequest:
      title: ' '
      description: ' '
      type: object
      allOf:
        - $ref: '#/components/schemas/ParcelaModel'
        - properties:
            formaRecebimento:
              $ref: '#/components/schemas/FormaRecebimentoRequestModel'
            meioPagamento:
              $ref: '#/components/schemas/MeioPagamentoRequestModel'
          type: object
    ProdutoRequestModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: false
            tipo:
              description: |-

                - P - Produto
                - S - Servico
              type: string
              enum:
                - P
                - S
              nullable: true
              x-enumDescriptions:
                - P - Produto
                - S - Servico
          type: object
    ParcelaModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            dias:
              type: integer
              nullable: true
            data:
              type: string
              example: '2024-01-01'
              nullable: true
            valor:
              type: number
              format: float
              nullable: true
            observacoes:
              type: string
              nullable: true
          type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: Bearer

````