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

# Actualizar un documento

Actualiza los datos de emisión de un documento declarado. type, id e isPrimary son inmutables.

* Cambiar los datos de un documento restablece a PENDING sus pruebas APPROVED: Localpayment las revisa de nuevo.
* Para cambiar el tipo o el número, agrega un documento nuevo y elimina el anterior.

Los errores usan `application/problem+json` con un `code` estable. Catálogo completo: [Entity Statuses and Error Codes](https://docs.localpayment.com/es/reference/entity-statuses-and-error-codes.md).


## OpenAPI

````yaml openapi/es/localpayment.json PATCH /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}:
    patch:
      summary: Actualizar un documento
      operationId: update-entity-document
      parameters:
        - name: Authorization
          in: header
          description: >-
            Token de acceso Bearer para la autenticación. Este token se obtiene
            de los endpoints [Get Access Token](/es/reference/get-token) o
            [Refresh Access Token](/es/reference/refresh-token). Tu cuenta de
            comerciante y el usuario que actúa se determinan a partir de él.
          required: true
          schema:
            type: string
            examples:
              - Bearer <your_access_token>
        - name: X-Correlation-ID
          in: header
          description: >-
            Identificador de seguimiento (UUID). Se incluye en la respuesta;
            Localpayment lo genera si no está presente.
          required: false
          schema:
            type: string
            examples:
              - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
        - name: entityId
          in: path
          description: internalId de la entidad.
          required: true
          schema:
            type: string
            examples:
              - 5aced5da-40c1-4bec-85ff-c8cd1bcb4526
            format: uuid
        - name: docId
          in: path
          description: documentId del documento.
          required: true
          schema:
            type: string
            format: uuid
            examples:
              - e0ea9515-442e-4bc5-bc82-b8d278255c37
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                issuingCountry:
                  type: string
                  description: ISO 3166-1 alfa-3.
                  examples:
                    - BRA
                issueDate:
                  type: string
                  format: date
                  description: AAAA-MM-DD.
                  examples:
                    - '2024-01-15'
                expirationDate:
                  type: string
                  format: date
                  description: >-
                    AAAA-MM-DD. Una fecha pasada marca el documento como
                    EXPIRED.
                  examples:
                    - '2034-01-15'
                metadata:
                  type: object
                  description: >-
                    Metadatos de formato libre (sustituyen al objeto
                    almacenado).
            examples:
              Example 1:
                value:
                  issueDate: '2024-01-15'
                  expirationDate: '2034-01-15'
                  metadata:
                    tin: formatted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                type: object
                properties:
                  documentId:
                    type: string
                    examples:
                      - 5ca3e868-2b76-4390-b25a-5d10c0db8516
                    format: uuid
                    description: >-
                      Identificador del documento (docId). Úsalo para cargar y
                      listar pruebas.
                  entityId:
                    type: string
                    examples:
                      - 7c9e6679-7425-40de-944b-e07fc1f90ae7
                    format: uuid
                    description: Entidad propietaria.
                  type:
                    type: string
                    examples:
                      - TAX_ID
                    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:
                      - 00.000.000/0001-00
                    description: Número de documento según lo declarado.
                  issuingCountry:
                    type: string
                    examples:
                      - BRA
                    description: Emisión de datos según lo declarado.
                  issueDate:
                    type: string
                    examples:
                      - '2024-01-15'
                    format: date
                    description: Emisión de datos según lo declarado.
                  expirationDate:
                    type: string
                    examples:
                      - '2034-01-15'
                    format: date
                    description: Emisión de datos según lo declarado.
                  isPrimary:
                    type: boolean
                    examples:
                      - false
                    description: Documento identificativo de la entidad.
                  status:
                    type: string
                    examples:
                      - PENDING
                    enum:
                      - PENDING
                      - VERIFIED
                      - REJECTED
                      - EXPIRED
                    description: >-
                      Estado derivado del documento: EXPIRED si expirationDate
                      ha pasado, REJECTED si alguna prueba activa está
                      rechazada, VERIFIED si todas las pruebas activas están
                      aprobadas; de lo contrario, PENDING.
                  metadata:
                    type: object
                    properties:
                      tin:
                        type: string
                        examples:
                          - formatted
                    description: Metadatos de formato libre.
                  proofs:
                    type: array
                    items:
                      type: object
                    description: >-
                      Pruebas vigentes del documento (los archivos reemplazados
                      no se muestran).
                  createdAt:
                    type: string
                    examples:
                      - '2024-01-15T17:18:54Z'
                    format: date-time
                  updatedAt:
                    type: string
                    examples:
                      - '2024-01-15T17:19:32Z'
                    format: date-time
              examples:
                Example 1:
                  value:
                    documentId: 5ca3e868-2b76-4390-b25a-5d10c0db8516
                    entityId: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                    type: TAX_ID
                    id: 00.000.000/0001-00
                    issuingCountry: BRA
                    issueDate: '2024-01-15'
                    expirationDate: '2034-01-15'
                    isPrimary: false
                    status: PENDING
                    metadata:
                      tin: formatted
                    proofs: []
                    createdAt: '2024-01-15T17:18:54Z'
                    updatedAt: '2024-01-15T17:19:32Z'
        '400':
          description: >-
            Solicitud incorrecta. VALIDATION_ERROR: Falta un campo, encabezado,
            ruta o parámetro de consulta, es desconocido o no válido. details[]
            muestra el campo y el problema.
          content:
            application/problem+json:
              schema:
                type: object
                description: >-
                  Detalles del problema según RFC 9457
                  (application/problem+json).
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: Breve resumen del problema.
                  status:
                    type: integer
                    description: Código de estado HTTP.
                  detail:
                    type: string
                    description: Explicación comprensible para el ser humano.
                  instance:
                    type: string
                    description: Ruta de solicitud.
                  code:
                    type: string
                    description: >-
                      Código de error estable legible por máquina. Basa tu
                      lógica de ramificación en este valor.
                  correlationId:
                    type: string
                    format: uuid
                    description: >-
                      Identificador de la solicitud. Indícalo cuando te pongas
                      en contacto con el servicio de asistencia.
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: Campos problemáticos, cuando corresponda.
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - VALIDATION_ERROR:
                  value:
                    type: about:blank
                    title: Validation error
                    status: 400
                    detail: >-
                      A field, header, path or query parameter is missing,
                      unknown or invalid. details[] lists field and issue.
                    instance: >-
                      /api/entity/v1/entities/5aced5da-40c1-4bec-85ff-c8cd1bcb4526/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37
                    code: VALIDATION_ERROR
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details:
                      - field: externalId
                        issue: REQUIRED
        '401':
          description: >-
            No autorizado. UNAUTHORIZED: Falta el token de acceso o no es
            válido.
          content:
            application/problem+json:
              schema:
                type: object
                description: >-
                  Detalles del problema según RFC 9457
                  (application/problem+json).
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: Breve resumen del problema.
                  status:
                    type: integer
                    description: Código de estado HTTP.
                  detail:
                    type: string
                    description: Explicación comprensible para el ser humano.
                  instance:
                    type: string
                    description: Ruta de solicitud.
                  code:
                    type: string
                    description: >-
                      Código de error estable legible por máquina. Basa tu
                      lógica de ramificación en este valor.
                  correlationId:
                    type: string
                    format: uuid
                    description: >-
                      Identificador de la solicitud. Indícalo cuando te pongas
                      en contacto con el servicio de asistencia.
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: Campos problemáticos, cuando corresponda.
                    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: >-
            No encontrado. ENTITY_NOT_FOUND: La entidad no existe o pertenece a
            otro comerciante. DOCUMENT_NOT_FOUND: El documento no existe, fue
            eliminado o pertenece a otro comerciante.
          content:
            application/problem+json:
              schema:
                type: object
                description: >-
                  Detalles del problema según RFC 9457
                  (application/problem+json).
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: Breve resumen del problema.
                  status:
                    type: integer
                    description: Código de estado HTTP.
                  detail:
                    type: string
                    description: Explicación comprensible para el ser humano.
                  instance:
                    type: string
                    description: Ruta de solicitud.
                  code:
                    type: string
                    description: >-
                      Código de error estable legible por máquina. Basa tu
                      lógica de ramificación en este valor.
                  correlationId:
                    type: string
                    format: uuid
                    description: >-
                      Identificador de la solicitud. Indícalo cuando te pongas
                      en contacto con el servicio de asistencia.
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: Campos problemáticos, cuando corresponda.
                    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: []
        '409':
          description: >-
            Conflicto. ENTITY_NOT_EDITABLE: La entidad está REJECTED, BLOCKED o
            CLOSED, o la operación eliminaría el documento principal o el único
            documento. ENTITY_IN_REVIEW: La entidad está IN_REVIEW: sus datos,
            documentos, archivos y vínculos UBO están congelados hasta que
            Localpayment Compliance lo resuelva.
          content:
            application/problem+json:
              schema:
                type: object
                description: >-
                  Detalles del problema según RFC 9457
                  (application/problem+json).
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: Breve resumen del problema.
                  status:
                    type: integer
                    description: Código de estado HTTP.
                  detail:
                    type: string
                    description: Explicación comprensible para el ser humano.
                  instance:
                    type: string
                    description: Ruta de solicitud.
                  code:
                    type: string
                    description: >-
                      Código de error estable legible por máquina. Basa tu
                      lógica de ramificación en este valor.
                  correlationId:
                    type: string
                    format: uuid
                    description: >-
                      Identificador de la solicitud. Indícalo cuando te pongas
                      en contacto con el servicio de asistencia.
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: Campos problemáticos, cuando corresponda.
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - ENTITY_NOT_EDITABLE:
                  value:
                    type: about:blank
                    title: Conflict
                    status: 409
                    detail: >-
                      The entity is REJECTED, BLOCKED or CLOSED, or the
                      operation would remove the primary document or the only
                      document.
                    instance: >-
                      /api/entity/v1/entities/5aced5da-40c1-4bec-85ff-c8cd1bcb4526/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37
                    code: ENTITY_NOT_EDITABLE
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
                Example 2 - ENTITY_IN_REVIEW:
                  value:
                    type: about:blank
                    title: Conflict
                    status: 409
                    detail: >-
                      The entity is IN_REVIEW: its data, documents, files and
                      UBO links are frozen until Localpayment Compliance
                      resolves it.
                    instance: >-
                      /api/entity/v1/entities/5aced5da-40c1-4bec-85ff-c8cd1bcb4526/documents/84f3b6db-7b74-4def-968d-cbb5bf90cab7
                    code: ENTITY_IN_REVIEW
                    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.