> ## 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.

# Atualizar ordem de compra



## OpenAPI

````yaml https://erp.olist.com/public-api/v3/swagger/swagger-mintlify.json put /ordem-compra/{idOrdemCompra}
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-compra/{idOrdemCompra}:
    put:
      tags:
        - Ordem de Compra
      summary: Atualizar ordem de compra
      operationId: AtualizarOrdemCompraAction
      parameters:
        - $ref: '#/components/parameters/put_ordem_compra_idOrdemCompra_idOrdemCompra'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AtualizarOrdemCompraModelRequest'
      responses:
        '204':
          description: No Content
        '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:
    put_ordem_compra_idOrdemCompra_idOrdemCompra:
      name: idOrdemCompra
      in: path
      description: Identificador da ordem de compra
      required: true
      schema:
        type: integer
  schemas:
    AtualizarOrdemCompraModelRequest:
      title: ' '
      description: ' '
      allOf:
        - $ref: '#/components/schemas/CriarAtualizarOrdemCompraModelRequest'
        - properties: {}
          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
    CriarAtualizarOrdemCompraModelRequest:
      title: ' '
      description: ' '
      properties:
        data:
          type: string
          example: '2024-01-01'
          nullable: true
        dataPrevista:
          type: string
          example: '2024-01-01'
          nullable: true
        desconto:
          type: number
          format: float
          nullable: true
        condicao:
          type: string
          nullable: true
        observacoes:
          type: string
          nullable: true
        observacoesInternas:
          type: string
          nullable: true
        fretePorConta:
          description: |-

            - R - Remetente
            - D - Destinatario
            - T - Terceiros
            - 3 - Proprio Remetente
            - 4 - Proprio Destinatario
            - S - Sem Transporte
          type: string
          enum:
            - R
            - D
            - T
            - '3'
            - '4'
            - S
          nullable: true
          x-enumDescriptions:
            - R - Remetente
            - D - Destinatario
            - T - Terceiros
            - 3 - Proprio Remetente
            - 4 - Proprio Destinatario
            - S - Sem Transporte
        transportador:
          type: string
          nullable: true
        parcelas:
          type: array
          items:
            $ref: '#/components/schemas/OrdemCompraParcelaModelRequest'
      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
    OrdemCompraParcelaModelRequest:
      title: ' '
      description: ' '
      properties:
        dias:
          type: integer
        dataVencimento:
          type: string
          example: '2024-01-01'
        valor:
          type: number
          format: float
        contaContabil:
          $ref: '#/components/schemas/ContaContabilModel'
        meioPagamento:
          description: |-

            - 1 - Dinheiro
            - 2 - Cheque
            - 3 - Cartao Credito
            - 4 - Cartao Debito
            - 5 - Credito Loja
            - 10 - Vale Alimentacao
            - 11 - Vale Refeicao
            - 12 - Vale Presente
            - 13 - Vale Combustivel
            - 14 - Duplicata Mercantil
            - 15 - Boleto
            - 16 - Deposito Bancario
            - 17 - Pix
            - 18 - Transferencia Bancaria Carteira Digital
            - 19 - Fidelidade Cashback Credito Virtual
            - 20 - Pix Estatico
            - 90 - Sem Pagamento
            - 99 - Outros
          type: string
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
            - 10
            - 11
            - 12
            - 13
            - 14
            - 15
            - 16
            - 17
            - 18
            - 19
            - 20
            - 90
            - 99
          nullable: true
          x-enumDescriptions:
            - 1 - Dinheiro
            - 2 - Cheque
            - 3 - Cartao Credito
            - 4 - Cartao Debito
            - 5 - Credito Loja
            - 10 - Vale Alimentacao
            - 11 - Vale Refeicao
            - 12 - Vale Presente
            - 13 - Vale Combustivel
            - 14 - Duplicata Mercantil
            - 15 - Boleto
            - 16 - Deposito Bancario
            - 17 - Pix
            - 18 - Transferencia Bancaria Carteira Digital
            - 19 - Fidelidade Cashback Credito Virtual
            - 20 - Pix Estatico
            - 90 - Sem Pagamento
            - 99 - Outros
        observacoes:
          type: string
      type: object
    ContaContabilModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
          type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: Bearer

````