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

# Obter ordem de compra



## OpenAPI

````yaml https://erp.olist.com/public-api/v3/swagger/swagger-mintlify.json get /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}:
    get:
      tags:
        - Ordem de Compra
      summary: Obter ordem de compra
      operationId: ObterOrdemCompraAction
      parameters:
        - $ref: '#/components/parameters/get_ordem_compra_idOrdemCompra_idOrdemCompra'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObterOrdemCompraModelResponse'
        '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:
    get_ordem_compra_idOrdemCompra_idOrdemCompra:
      name: idOrdemCompra
      in: path
      required: true
      schema:
        type: integer
  schemas:
    ObterOrdemCompraModelResponse:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
            numeroPedido:
              type: string
              nullable: true
            data:
              type: string
              example: '2024-01-01'
            situacao:
              description: |-

                - 0 - Em Aberto
                - 1 - Atendido
                - 2 - Cancelado
                - 3 - Em Andamento
              type: string
              enum:
                - 0
                - 1
                - 2
                - 3
              nullable: true
              x-enumDescriptions:
                - 0 - Em Aberto
                - 1 - Atendido
                - 2 - Cancelado
                - 3 - Em Andamento
            desconto:
              type: string
            frete:
              type: number
              format: float
            totalProdutos:
              type: number
              format: float
            totalPedidoCompra:
              type: number
              format: float
            dataPrevista:
              type: string
              example: '2024-01-01'
            itens:
              type: array
              items:
                $ref: '#/components/schemas/OrdemCompraItemModelResponse'
            contato:
              $ref: '#/components/schemas/ContatoModelResponse'
            categoria:
              $ref: '#/components/schemas/CategoriaResponseModel'
            notaFiscal:
              $ref: '#/components/schemas/OrdemCompraNotaFiscalModelResponse'
            parcelas:
              type: array
              items:
                $ref: '#/components/schemas/OrdemCompraParcelaModelResponse'
            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
            observacoes:
              type: string
            observacoesInternas:
              type: string
              nullable: true
            pvFrete:
              type: number
              format: float
          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
    OrdemCompraItemModelResponse:
      title: ' '
      description: ' '
      properties:
        produto:
          $ref: '#/components/schemas/ProdutoResponseModel'
        gtin:
          type: string
          nullable: true
        quantidade:
          type: number
          format: float
        preco:
          type: number
          format: float
        ipi:
          type: number
          format: float
      type: object
    ContatoModelResponse:
      title: ' '
      description: ' '
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseContatoModel'
        - properties:
            id:
              type: integer
          type: object
    CategoriaResponseModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
            nome:
              type: string
              nullable: true
            caminhoCompleto:
              type: string
              nullable: true
          type: object
    OrdemCompraNotaFiscalModelResponse:
      title: ' '
      description: ' '
      properties:
        id:
          type: integer
        numero:
          type: string
        dataEmissao:
          type: string
          example: '2024-01-01'
        valor:
          type: string
        natureza:
          type: string
      type: object
    OrdemCompraParcelaModelResponse:
      title: ' '
      description: ' '
      properties:
        id:
          type: integer
        numero:
          type: integer
        dias:
          type: integer
        dataVencimento:
          type: string
        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
    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
    ProdutoResponseModel:
      title: ' '
      description: ' '
      properties:
        id:
          type: integer
          nullable: true
        sku:
          type: string
          nullable: true
        descricao:
          type: string
          nullable: true
        tipo:
          description: |-

            - P - Produto
            - S - Servico
          type: string
          enum:
            - P
            - S
          nullable: true
          x-enumDescriptions:
            - P - Produto
            - S - Servico
      type: object
    BaseContatoModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            nome:
              type: string
              nullable: true
            codigo:
              type: string
              nullable: true
            fantasia:
              type: string
              nullable: true
            tipoPessoa:
              description: |-

                - J - Juridica
                - F - Fisica
                - E - Estrangeiro
                - X - Estrangeiro No Brasil
              type: string
              enum:
                - J
                - F
                - E
                - X
              nullable: true
              x-enumDescriptions:
                - J - Juridica
                - F - Fisica
                - E - Estrangeiro
                - X - Estrangeiro No Brasil
            cpfCnpj:
              type: string
              nullable: true
            inscricaoEstadual:
              type: string
              nullable: true
            rg:
              type: string
              nullable: true
            telefone:
              type: string
              nullable: true
            celular:
              type: string
              nullable: true
            email:
              type: string
              nullable: true
            endereco:
              $ref: '#/components/schemas/EnderecoModel'
          type: object
    ContaContabilModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            id:
              type: integer
              nullable: true
          type: object
    EnderecoModel:
      title: ' '
      description: ' '
      type: object
      allOf:
        - properties:
            endereco:
              type: string
              nullable: true
            numero:
              type: string
              nullable: true
            complemento:
              type: string
              nullable: true
            bairro:
              type: string
              nullable: true
            municipio:
              type: string
              nullable: true
            cep:
              type: string
              nullable: true
            uf:
              type: string
              nullable: true
            pais:
              type: string
              nullable: true
          type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: Bearer

````