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

# 12 - Consultar Documento

Por meio deste endpoint o sistema transmite uma chamada na URL definida pelo parceiro e em seguida obtém um retorno onde constará o documento a ser anexado na API de Pessoa.


## OpenAPI

````yaml post /Pessoa/ConsultarDocumento
openapi: 3.0.1
info:
  title: BMPDigitalCore.ApiExterna.Pessoa.API
  version: '1.0'
servers:
  - url: https://api.bmpdigital.moneyp.dev.br/
    description: Localhost
security:
  - Bearer: []
paths:
  /Pessoa/ConsultarDocumento:
    post:
      tags:
        - Pessoa
      parameters:
        - name: IdempotencyKey
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsultarDocumentoCommand'
          text/json:
            schema:
              $ref: '#/components/schemas/ConsultarDocumentoCommand'
          application/*+json:
            schema:
              $ref: '#/components/schemas/ConsultarDocumentoCommand'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/DocumentoResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentoResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/DocumentoResponse'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseBase'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBase'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseBase'
components:
  schemas:
    ConsultarDocumentoCommand:
      type: object
      properties:
        dto:
          $ref: '#/components/schemas/FindPessoaDTO'
        busca:
          $ref: '#/components/schemas/BuscarDocumentoDTO'
      additionalProperties: false
    DocumentoResponse:
      type: object
      properties:
        msg:
          type: string
          nullable: true
        result:
          type: boolean
          writeOnly: true
        hasError:
          type: boolean
        messages:
          type: array
          items:
            $ref: '#/components/schemas/Message'
          nullable: true
        codigo:
          type: string
          format: uuid
          nullable: true
        tipoDocumento:
          type: integer
          format: int32
        nomeArquivo:
          type: string
          nullable: true
        extensao:
          type: string
          nullable: true
        dtValidade:
          type: string
          format: date-time
          nullable: true
        arquivo:
          type: string
          format: byte
          nullable: true
      additionalProperties: false
    ResponseBase:
      type: object
      properties:
        msg:
          type: string
          nullable: true
        result:
          type: boolean
          writeOnly: true
        hasError:
          type: boolean
        messages:
          type: array
          items:
            $ref: '#/components/schemas/Message'
          nullable: true
      additionalProperties: false
    FindPessoaDTO:
      required:
        - documentoCliente
      type: object
      properties:
        documentoCliente:
          maxLength: 20
          minLength: 0
          type: string
          description: Documento federal do cliente
          nullable: true
      additionalProperties: false
    BuscarDocumentoDTO:
      type: object
      properties:
        authHeaderName:
          type: string
          description: Parâmetro para autenticação na URL do parceiro
          nullable: true
        authHeaderValue:
          type: string
          description: Valor do parâmetro para autenticação na URL do parceiro
          nullable: true
        method:
          type: string
          description: GET/POST/PUT
          nullable: true
        contentType:
          type: string
          description: >-
            Indica o formato desejado pela URL, Exemplo: text/plain,
            application/json
          nullable: true
        url:
          type: string
          description: Url definida pelo parceiro que deverá devolver como resposta o DTO
          nullable: true
        body:
          type: string
          description: >-
            Corpo da mensagem que a URL deve receber. Exemplo: Parâmetros para
            que localize o documento na base do parceiro.
          nullable: true
      additionalProperties: false
    Message:
      type: object
      properties:
        messageType:
          $ref: '#/components/schemas/ErrorType'
        code:
          type: string
          nullable: true
        context:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        field:
          type: string
          nullable: true
      additionalProperties: false
    ErrorType:
      enum:
        - 1
        - 2
        - 3
      type: integer
      format: int32
  securitySchemes:
    Bearer:
      type: apiKey
      description: Informe o token
      name: Authorization
      in: header

````