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

# Delete the external voucher info of an expense report

> Clears the external voucher reference from the report (`externalVoucherId`, `externalVoucherInformation`, `externalVoucherNumber`, `externalVoucherErrorInformation`), and `externalVoucherId`, `externalVoucherNumber`, `externalVoucherUrl` and `externalVoucherErrorInformation` from every expense record in it. With `recipientId`, and if the report has a send chain, the voucher numbers of that recipient's step are cleared as well and a REMOVED_VOUCHER_REFERENCE change log entry is written; without it, only the report and its records are cleared. The report must belong to the organization in the path and must not be deleted.
It replaces the deprecated `PUT /organizations/{organizationId}/reports/{reportId}?action=deleteExternalVoucherInfo`.
It requires the `adminApiExpenseReports:deleteExternalVoucher` permission, which is given to the same roles as `adminApiExpenseReports:updateExpenseReport`. The caller must also be allowed to modify reports in the organization, so a consultant with the read-only report viewer role is denied.




## OpenAPI

````yaml /openapi/findity-admin-api.json delete /organizations/{organizationId}/reports/{reportId}/externalvoucher
openapi: 3.1.0
info:
  title: Findity Admin API
  description: Findity Admin API
  version: 1.0.0
servers:
  - url: https://stage-api.findity.com/api/v1/admin
  - url: https://api.findity.com/api/v1/admin
security:
  - bearerAuth: []
paths:
  /organizations/{organizationId}/reports/{reportId}/externalvoucher:
    delete:
      tags:
        - Expense Reports
      summary: Delete the external voucher info of an expense report
      description: >
        Clears the external voucher reference from the report
        (`externalVoucherId`, `externalVoucherInformation`,
        `externalVoucherNumber`, `externalVoucherErrorInformation`), and
        `externalVoucherId`, `externalVoucherNumber`, `externalVoucherUrl` and
        `externalVoucherErrorInformation` from every expense record in it. With
        `recipientId`, and if the report has a send chain, the voucher numbers
        of that recipient's step are cleared as well and a
        REMOVED_VOUCHER_REFERENCE change log entry is written; without it, only
        the report and its records are cleared. The report must belong to the
        organization in the path and must not be deleted.

        It replaces the deprecated `PUT
        /organizations/{organizationId}/reports/{reportId}?action=deleteExternalVoucherInfo`.

        It requires the `adminApiExpenseReports:deleteExternalVoucher`
        permission, which is given to the same roles as
        `adminApiExpenseReports:updateExpenseReport`. The caller must also be
        allowed to modify reports in the organization, so a consultant with the
        read-only report viewer role is denied.
      operationId: deleteOrganizationExpenseReportExternalVoucher
      parameters:
        - $ref: '#/components/parameters/organizationIdOrExternalIdInPath'
        - $ref: '#/components/parameters/expenseReportId'
        - name: recipientId
          in: query
          required: false
          description: >
            Recipient whose voucher numbers are also cleared from the report's
            send chain. String, UUID format (32-character hexadecimal).
            Optional; when omitted the send chain keeps its voucher numbers. A
            recipient that does not belong to the organization is answered with
            400 INVALID_PARAMETER and nothing is cleared.
          schema:
            $ref: '#/components/schemas/Uuid'
          example: 3f2b1a0c9d8e7f6a5b4c3d2e1f0a9b8c
      responses:
        '204':
          description: The external voucher info was cleared. No response body.
        '400':
          description: Invalid recipient
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400Error-2'
              examples:
                unknownRecipient:
                  summary: A recipient of another organization
                  value:
                    result: error
                    code: INVALID_PARAMETER
                    description: >-
                      Recipient 3f2b1a0c9d8e7f6a5b4c3d2e1f0a9b8c does not belong
                      to organization 05b8daba9ba14a49846fe77883248cf0
        '403':
          description: >
            Forbidden — the caller lacks the
            `adminApiExpenseReports:deleteExternalVoucher` permission, or may
            not modify reports in the organization (for example a report viewer
            consultant).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403Error'
              examples:
                missingPermission:
                  summary: The caller lacks the permission
                  value:
                    result: error
                    description: Not allowed
                cannotModifyReports:
                  summary: The caller may not modify reports in the organization
                  value:
                    result: error
                    description: Insufficient rights
        '404':
          description: >
            Not found — the organization does not exist, the caller is not an
            administrator of it (for the developer role: the organization was
            not created by the caller's client application), or the caller's
            token is scoped to another organization; or the expense report does
            not exist, is deleted or belongs to another organization than the
            one in the path. Like `DELETE
            /organizations/{organizationId}/reports/{reportId}`, a missing or
            inaccessible organization or report answers 404 rather than 403, so
            both cases look the same and the ids can't be probed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Error'
              examples:
                unknownOrganization:
                  summary: Unknown organization id
                  value:
                    result: error
                    code: ORGANIZATION_NOT_FOUND
                    description: >-
                      Organization not found for
                      id='05b8daba9ba14a49846fe77883248cf0'
                organizationNotFound:
                  summary: The caller may not access the organization
                  value:
                    result: error
                    code: ORGANIZATION_NOT_FOUND
                    description: Organization not found
                expenseReportNotFound:
                  summary: >-
                    Expense report not found (unknown id, deleted, or it belongs
                    to another organization)
                  value:
                    result: error
                    code: EXPENSE_REPORT_NOT_FOUND
                    description: Expense report not found
components:
  parameters:
    organizationIdOrExternalIdInPath:
      in: path
      name: organizationId
      required: true
      description: >-
        Unique identifier of the organization. String in UUID without dashes
        (32-character hex string) if access is done via values from Findity
        system otherwise, id of external system can be used
      schema:
        type: string
      examples:
        Findity unique id:
          value: 05b8daba9ba14a49846fe77883248cf0
        External system unique id:
          value: a31a7372-3397-3924-ffcd-b7b4795e42eb
    expenseReportId:
      in: path
      name: reportId
      required: true
      description: >-
        The unique identifier of the expense report. String, UUID format
        (32-character hexadecimal). Required.
      schema:
        $ref: '#/components/schemas/Uuid'
      example: f328e47d595c40ad80f27f52626c5b92
  schemas:
    Uuid:
      type: string
      pattern: ^[0-9a-fA-F]{32}$
      description: UUID without dashes (32-character hex string)
    400Error-2:
      type: object
      properties:
        result:
          type: string
        code:
          type: string
        description:
          type: string
        requestId:
          type: string
          description: >-
            Identifier of the request in the server logs. Included when the
            server assigned one.
          example: 47b17d6f18b84c5b8c9460c55d98c108
    403Error:
      type: object
      properties:
        result:
          type: string
        code:
          type: string
        description:
          type: string
      example:
        result: error
        description: Not allowed
    404Error:
      type: object
      properties:
        result:
          type: string
        code:
          type: string
        description:
          type: string
      example:
        result: error
        code: ORGANIZATION_NOT_FOUND
        description: 'Failed to get organization for id: {orgId}'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````