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

# Obtenha um documento

Retorna um documento declarado com seu status derivado e suas provas ativas.

* O primeiro exemplo mostra um documento VERIFIED (sua única prova ativa é APPROVED); o segundo, um REJECTED, com o motivo na prova.

Erros usam `application/problem+json` com um `code` estável. Catálogo completo: [Status de Entidades e Códigos de Erro](https://docs.localpayment.com/pt-br/reference/entity-statuses-and-error-codes.md).


## OpenAPI

````yaml openapi/pt-br/localpayment.json GET /api/entity/v1/entities/{entityId}/documents/{docId}
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/entity/v1/entities/{entityId}/documents/{docId}:
    get:
      summary: Obtenha um documento
      operationId: get-entity-document
      parameters:
        - name: Authorization
          in: header
          description: >-
            Token de acesso Bearer para autenticação. Este token é obtido nos
            endpoints [Obter token de acesso](/pt-br/reference/get-token) ou
            [Renovar token de acesso](/pt-br/reference/refresh-token). Sua conta
            de comerciante e o usuário que realiza a ação são identificados a
            partir dele.
          required: true
          schema:
            type: string
            examples:
              - Bearer <your_access_token>
        - name: X-Correlation-ID
          in: header
          description: >-
            Identificador de rastreamento (UUID). Exibido na resposta; gerado
            pelo Localpayment se ausente.
          required: false
          schema:
            type: string
            examples:
              - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
        - name: entityId
          in: path
          description: ID interno da entidade.
          required: true
          schema:
            type: string
            examples:
              - 5aced5da-40c1-4bec-85ff-c8cd1bcb4526
            format: uuid
        - name: docId
          in: path
          description: ID do documento.
          required: true
          schema:
            type: string
            format: uuid
            examples:
              - e0ea9515-442e-4bc5-bc82-b8d278255c37
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                type: object
                properties:
                  documentId:
                    type: string
                    examples:
                      - 2e16d844-4fa9-4295-9a21-83ec32ef241a
                    format: uuid
                    description: >-
                      Identificador do documento (docId). Use-o para carregar e
                      listar comprovantes.
                  entityId:
                    type: string
                    examples:
                      - 5aced5da-40c1-4bec-85ff-c8cd1bcb4526
                    format: uuid
                    description: Entidade proprietária.
                  type:
                    type: string
                    examples:
                      - CPF
                    enum:
                      - DNI
                      - NATIONAL_ID
                      - DRIVER_LICENSE
                      - PASSPORT
                      - CE
                      - CC
                      - CUIT
                      - CUIL
                      - RFC
                      - CURP
                      - CPF
                      - CNPJ
                      - RUC
                      - NIT
                      - TAX_ID
                      - ARTICLES_OF_INCORPORATION
                      - POWER_OF_ATTORNEY
                      - TAX_CERTIFICATE
                      - PAYSLIP
                      - ARCA_REGISTRATION
                      - PROOF_OF_ADDRESS
                      - PROOF_OF_FUNDS
                      - OTHER
                    description: Tipo de documento.
                  id:
                    type: string
                    examples:
                      - '00000000000'
                    description: Número do documento conforme declarado.
                  issuingCountry:
                    type: string
                    examples:
                      - BRA
                    description: Emitindo dados conforme declarado.
                  issueDate:
                    type:
                      - string
                      - 'null'
                    format: date
                    description: Emitindo dados conforme declarado.
                  expirationDate:
                    type:
                      - string
                      - 'null'
                    format: date
                    description: Emitindo dados conforme declarado.
                  isPrimary:
                    type: boolean
                    examples:
                      - true
                    description: Documento de identificação da entidade.
                  status:
                    type: string
                    examples:
                      - VERIFIED
                    enum:
                      - PENDING
                      - VERIFIED
                      - REJECTED
                      - EXPIRED
                    description: >-
                      Status derivado do documento: EXPIRED se a expirationDate
                      tiver passado, REJECTED se alguma prova ativa for
                      rejeitada, VERIFIED se todas as provas ativas forem
                      aprovadas, caso contrário PENDING.
                  metadata:
                    type:
                      - object
                      - 'null'
                    description: Metadados de formato livre.
                  proofs:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          examples:
                            - 2c4c2f74-7179-4113-83fb-f11dbce9e07d
                          description: Número do documento conforme declarado.
                        documentId:
                          type: string
                          examples:
                            - 2e16d844-4fa9-4295-9a21-83ec32ef241a
                          format: uuid
                          description: >-
                            Identificador do documento (docId). Use-o para
                            carregar e listar comprovantes.
                        proofType:
                          type: string
                          examples:
                            - FRONT
                          enum:
                            - FRONT
                            - BACK
                            - SELFIE
                            - DOCUMENT
                            - OTHER
                        fileName:
                          type: string
                          examples:
                            - id_front.jpg
                        mimeType:
                          type: string
                          examples:
                            - image/jpeg
                        sizeBytes:
                          type: integer
                          examples:
                            - 102400
                        verificationStatus:
                          type: string
                          examples:
                            - APPROVED
                          enum:
                            - PENDING
                            - IN_REVIEW
                            - APPROVED
                            - REJECTED
                        verifiedBy:
                          type: string
                          examples:
                            - '67890'
                        verifiedAt:
                          type: string
                          examples:
                            - '2024-01-15T17:03:20Z'
                          format: date-time
                        verificationReason:
                          type:
                            - string
                            - 'null'
                        uploadedBy:
                          type: string
                          examples:
                            - '12345'
                        uploadedAt:
                          type: string
                          examples:
                            - '2024-01-15T17:03:13Z'
                          format: date-time
                        status:
                          type: string
                          examples:
                            - CURRENT
                          enum:
                            - CURRENT
                            - SUPERSEDED
                            - DELETED
                          description: >-
                            Ciclo de vida da prova: CURRENT (ativa), SUPERSEDED
                            (substituída por um upload mais recente do mesmo
                            proofType) ou DELETED. Independente de
                            verificationStatus.
                        supersededAt:
                          type:
                            - string
                            - 'null'
                          format: date-time
                        supersededBy:
                          type:
                            - string
                            - 'null'
                        replacedByProofId:
                          type:
                            - string
                            - 'null'
                          format: uuid
                        deletedAt:
                          type:
                            - string
                            - 'null'
                          format: date-time
                        deletedBy:
                          type:
                            - string
                            - 'null'
                        inVerification:
                          type: boolean
                          examples:
                            - false
                    description: >-
                      Comprovantes ativos do documento (os arquivos substituídos
                      não são listados).
                  createdAt:
                    type: string
                    examples:
                      - '2024-01-15T17:03:10Z'
                    format: date-time
                  updatedAt:
                    type: string
                    examples:
                      - '2024-01-15T17:03:15Z'
                    format: date-time
              examples:
                Example 1:
                  value:
                    documentId: 2e16d844-4fa9-4295-9a21-83ec32ef241a
                    entityId: 5aced5da-40c1-4bec-85ff-c8cd1bcb4526
                    type: CPF
                    id: '00000000000'
                    issuingCountry: BRA
                    issueDate: null
                    expirationDate: null
                    isPrimary: true
                    status: VERIFIED
                    metadata: null
                    proofs:
                      - id: 2c4c2f74-7179-4113-83fb-f11dbce9e07d
                        documentId: 2e16d844-4fa9-4295-9a21-83ec32ef241a
                        proofType: FRONT
                        fileName: id_front.jpg
                        mimeType: image/jpeg
                        sizeBytes: 102400
                        verificationStatus: APPROVED
                        verifiedBy: '67890'
                        verifiedAt: '2024-01-15T17:03:20Z'
                        verificationReason: null
                        uploadedBy: '12345'
                        uploadedAt: '2024-01-15T17:03:13Z'
                        status: CURRENT
                        supersededAt: null
                        supersededBy: null
                        replacedByProofId: null
                        deletedAt: null
                        deletedBy: null
                        inVerification: false
                    createdAt: '2024-01-15T17:03:10Z'
                    updatedAt: '2024-01-15T17:03:15Z'
                Example 2 - A document whose file was rejected:
                  value:
                    documentId: 0266257c-a2aa-49ac-99fe-b3882a51d750
                    entityId: 8f5b2c9a-1caf-4b2c-b085-82bbaead6ddd
                    type: NATIONAL_ID
                    id: 00.000.000-0
                    issuingCountry: BRA
                    issueDate: null
                    expirationDate: null
                    isPrimary: false
                    status: REJECTED
                    metadata: null
                    proofs:
                      - id: 931398af-9c77-4958-abf8-4c749147c508
                        documentId: 0266257c-a2aa-49ac-99fe-b3882a51d750
                        proofType: BACK
                        fileName: id_back.jpg
                        mimeType: image/jpeg
                        sizeBytes: 98304
                        verificationStatus: REJECTED
                        verifiedBy: '67890'
                        verifiedAt: '2024-01-15T17:20:34Z'
                        verificationReason: Illegible image
                        uploadedBy: '12345'
                        uploadedAt: '2024-01-15T17:19:49Z'
                        status: CURRENT
                        supersededAt: null
                        supersededBy: null
                        replacedByProofId: null
                        deletedAt: null
                        deletedBy: null
                        inVerification: false
                    createdAt: '2024-01-15T17:19:46Z'
                    updatedAt: '2024-01-15T17:19:46Z'
        '401':
          description: 'Não autorizado. UNAUTHORIZED: Token de acesso ausente ou inválido.'
          content:
            application/problem+json:
              schema:
                type: object
                description: >-
                  Detalhes do problema segundo a RFC 9457
                  (application/problem+json).
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: Breve resumo do problema.
                  status:
                    type: integer
                    description: Código de status HTTP.
                  detail:
                    type: string
                    description: Explicação em linguagem acessível a humanos.
                  instance:
                    type: string
                    description: Caminho da solicitação.
                  code:
                    type: string
                    description: >-
                      Código de erro estável e legível por máquina. Faça a
                      ramificação da lógica com base nesse valor.
                  correlationId:
                    type: string
                    format: uuid
                    description: >-
                      Identificador da solicitação. Informe-o ao entrar em
                      contato com o suporte.
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: Campos problemáticos, quando aplicável.
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - UNAUTHORIZED:
                  value:
                    type: about:blank
                    title: Unauthorized
                    status: 401
                    detail: Missing or invalid access token.
                    instance: >-
                      /api/entity/v1/entities/5aced5da-40c1-4bec-85ff-c8cd1bcb4526/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37
                    code: UNAUTHORIZED
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
        '404':
          description: >-
            Não encontrado. ENTITY_NOT_FOUND: A entidade não existe ou pertence
            a outro comerciante. DOCUMENT_NOT_FOUND: O documento não existe, foi
            excluído ou pertence a outro comerciante.
          content:
            application/problem+json:
              schema:
                type: object
                description: >-
                  Detalhes do problema segundo a RFC 9457
                  (application/problem+json).
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: Breve resumo do problema.
                  status:
                    type: integer
                    description: Código de status HTTP.
                  detail:
                    type: string
                    description: Explicação em linguagem acessível a humanos.
                  instance:
                    type: string
                    description: Caminho da solicitação.
                  code:
                    type: string
                    description: >-
                      Código de erro estável e legível por máquina. Faça a
                      ramificação da lógica com base nesse valor.
                  correlationId:
                    type: string
                    format: uuid
                    description: >-
                      Identificador da solicitação. Informe-o ao entrar em
                      contato com o suporte.
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: Campos problemáticos, quando aplicável.
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - ENTITY_NOT_FOUND:
                  value:
                    type: about:blank
                    title: Not found
                    status: 404
                    detail: The entity does not exist or belongs to another merchant.
                    instance: >-
                      /api/entity/v1/entities/5aced5da-40c1-4bec-85ff-c8cd1bcb4526/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37
                    code: ENTITY_NOT_FOUND
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
                Example 2 - DOCUMENT_NOT_FOUND:
                  value:
                    type: about:blank
                    title: Not found
                    status: 404
                    detail: >-
                      The document does not exist, was deleted, or belongs to
                      another merchant.
                    instance: >-
                      /api/entity/v1/entities/5aced5da-40c1-4bec-85ff-c8cd1bcb4526/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37
                    code: DOCUMENT_NOT_FOUND
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
      security:
        - token: []
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.