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

# Generate output for expense reports

> Generates the accounting or payment file for the listed expense reports and returns it as a download. The file format is decided by the integration of the recipient given in `recipientId`, so the same request produces an SIE file for one recipient and a payment file for another.

Every selected report is validated first. If any of them does not pass, nothing is generated and the call is rejected with 400 `EXPENSE_REPORTS_FAILED_VALIDATION`, whose `data.expenseReportIds` names the reports that failed. Pass `ignoreValidation=true` to generate the file anyway, which is what the Reports screen does for reports that have already been sent.

Every id in `expenseReportIds` must belong to the organization. If any of them does not, the whole call is rejected with 404 and no file is generated.

Nothing is persisted and the file is generated per request from reports that keep changing, so the answer carries `Cache-Control: no-store` and must not be reused for a later request.




## OpenAPI

````yaml /openapi/findity-admin-api.json get /organizations/{organizationId}/reports/output
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/output:
    get:
      tags:
        - Expense Reports
      summary: Generate output for expense reports
      description: >
        Generates the accounting or payment file for the listed expense reports
        and returns it as a download. The file format is decided by the
        integration of the recipient given in `recipientId`, so the same request
        produces an SIE file for one recipient and a payment file for another.


        Every selected report is validated first. If any of them does not pass,
        nothing is generated and the call is rejected with 400
        `EXPENSE_REPORTS_FAILED_VALIDATION`, whose `data.expenseReportIds` names
        the reports that failed. Pass `ignoreValidation=true` to generate the
        file anyway, which is what the Reports screen does for reports that have
        already been sent.


        Every id in `expenseReportIds` must belong to the organization. If any
        of them does not, the whole call is rejected with 404 and no file is
        generated.


        Nothing is persisted and the file is generated per request from reports
        that keep changing, so the answer carries `Cache-Control: no-store` and
        must not be reused for a later request.
      operationId: generateOrganizationExpenseReportsOutput
      parameters:
        - name: organizationId
          in: path
          required: true
          description: >-
            The unique identifier of the organization. String, UUID format
            (32-character hexadecimal). Required.
          schema:
            $ref: '#/components/schemas/Uuid'
          example: 05b8daba9ba14a49846fe77883248cf0
        - $ref: '#/components/parameters/outputExpenseReportIds'
        - $ref: '#/components/parameters/outputRecipientId'
        - $ref: '#/components/parameters/outputReportDate'
        - $ref: '#/components/parameters/outputIgnoreValidation'
      responses:
        '200':
          description: >
            The generated file. Content-Type varies with the recipient's
            integration, for example text/plain for an SIE file or
            application/xml for an ISO-20022 payment file.
          headers:
            Content-Disposition:
              description: Attachment filename decided by the integration
              schema:
                type: string
              example: attachment; filename=2026-08-05.si
            Access-Control-Expose-Headers:
              schema:
                type: string
              example: Content-Disposition
            Cache-Control:
              description: The generated file is never cacheable
              schema:
                type: string
              example: no-store
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
            text/plain:
              schema:
                type: string
              example: |
                #FLAGGA 0
                #PROGRAM "Findity" 1.0
                #FORMAT PC8
                #VER A 1 20260805 "Expense report"
                {
                #TRANS 5811 {} -1250.00
                #TRANS 1930 {} 1250.00
                }
            application/xml:
              schema:
                type: string
              example: >
                <?xml version="1.0" encoding="UTF-8"?>

                <Document
                xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
                  <CstmrCdtTrfInitn>
                    <GrpHdr><MsgId>FINDITY-20260805</MsgId><NbOfTxs>1</NbOfTxs></GrpHdr>
                  </CstmrCdtTrfInitn>
                </Document>
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateOutput400Error'
              examples:
                missingExpenseReportIds:
                  summary: expenseReportIds was left out
                  value:
                    result: error
                    code: MISSING_PARAMETER
                    description: >-
                      expenseReportIds is required for action
                      'generateExpenseReportsOutput'
                missingRecipientId:
                  summary: recipientId was left out
                  value:
                    result: error
                    code: MISSING_PARAMETER
                    description: recipientId is required
                recipientNotInOrganization:
                  summary: The recipient belongs to another organization
                  value:
                    result: error
                    code: INVALID_PARAMETER
                    description: >-
                      Recipient 3f2b1a0c9d8e7f6a5b4c3d2e1f0a9b8c does not belong
                      to organization 05b8daba9ba14a49846fe77883248cf0
                unparseableReportDate:
                  summary: reportDate is not in the accepted format
                  value:
                    result: error
                    code: INVALID_DATE
                    description: Invalid date. Please verify it.
                reportsFailedValidation:
                  summary: One or more of the selected reports did not pass validation
                  value:
                    result: error
                    code: EXPENSE_REPORTS_FAILED_VALIDATION
                    description: >-
                      Some of the selected expense reports did not pass
                      validation. Correct them, or generate the output ignoring
                      validation.
                    data:
                      expenseReportIds:
                        - 7c1f0a3b9d2e4f5a8b6c0d1e2f3a4b5c
                tooManyReports:
                  summary: More reports than the batch limit
                  value:
                    result: error
                    code: INVALID_PARAMETER
                    description: A maximum of 100 reports can be handled at once, got 101
                recipientCannotGenerateOutput:
                  summary: The recipient's integration does not generate output files
                  value:
                    result: error
                    code: RECIPIENT_CANNOT_GENERATE_OUTPUT
                    description: >-
                      The selected recipient's integration cannot generate
                      output.
                generationFailed:
                  summary: The integration module did not answer with a usable file
                  value:
                    result: error
                    code: FAILED_TO_GENERATE_OUTPUT
                    description: >-
                      Failed to generate output for the selected expense
                      reports.
        '401':
          description: >
            The caller lacks the
            `adminApiExpenseReports:generateExpenseReportsOutput` permission. A
            caller who has the permission but no access to the organization gets
            404 `ORGANIZATION_NOT_FOUND` instead.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401Error'
              examples:
                unauthorized:
                  summary: The caller lacks the permission the endpoint requires
                  value:
                    result: unauthorized
        '404':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Error'
              examples:
                organizationNotFound:
                  summary: Organization not found
                  value:
                    result: error
                    code: ORGANIZATION_NOT_FOUND
                    description: Organization not found
                expenseReportNotFound:
                  summary: >-
                    One or more of the selected reports do not belong to the
                    organization
                  value:
                    result: error
                    code: EXPENSE_REPORT_NOT_FOUND
                    description: Expense report not found
components:
  schemas:
    Uuid:
      type: string
      pattern: ^[0-9a-fA-F]{32}$
      description: UUID without dashes (32-character hex string)
    GenerateOutput400Error:
      type: object
      properties:
        result:
          type: string
        code:
          type: string
        description:
          type: string
        data:
          type: object
          description: >
            Only present for `EXPENSE_REPORTS_FAILED_VALIDATION`, where it names
            the reports that did not pass validation.
          properties:
            expenseReportIds:
              type: array
              items:
                $ref: '#/components/schemas/Uuid'
    401Error:
      type: object
      properties:
        result:
          type: string
      example:
        result: unauthorized
    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}'
  parameters:
    outputExpenseReportIds:
      name: expenseReportIds
      in: query
      description: >
        The expense reports to generate output for, as a comma separated list

        (`expenseReportIds=05b8daba9ba14a49846fe77883248cf0,7c1f0a3b9d2e4f5a8b6c0d1e2f3a4b5c`).
        The

        endpoint also accepts the parameter repeated once per id, but the comma
        separated form is the one

        this contract describes and the one generated clients will send.


        Every id must belong to the organization, if any of them does not the
        whole call is rejected with

        404 and no file is generated. Array of strings, UUID format
        (32-character hexadecimal), 1-100

        items. Required.
      required: true
      style: form
      explode: false
      schema:
        type: array
        minItems: 1
        maxItems: 100
        items:
          $ref: '#/components/schemas/Uuid'
      example:
        - 05b8daba9ba14a49846fe77883248cf0
        - 7c1f0a3b9d2e4f5a8b6c0d1e2f3a4b5c
    outputRecipientId:
      name: recipientId
      in: query
      description: >
        The recipient whose integration decides the format of the generated
        file. Must belong to the organization. String, UUID format (32-character
        hexadecimal). Required.
      required: true
      schema:
        $ref: '#/components/schemas/Uuid'
      example: 3f2b1a0c9d8e7f6a5b4c3d2e1f0a9b8c
    outputReportDate:
      name: reportDate
      in: query
      description: >
        The booking date written into the generated file. String, ISO 8601
        date-time in the form `yyyy-MM-ddTHH:mm:ssZ`, where the zone is either
        `Z` or a numeric offset. A numeric offset has to be percent encoded
        (`+0200` as `%2B0200`), since a raw plus sign is read as a space in a
        query string. A value in any other form is rejected with 400
        `INVALID_DATE`. Optional, the integration decides what to use when it is
        left out.
      required: false
      schema:
        type: string
        format: date-time
      example: '2026-08-05T00:00:00Z'
    outputIgnoreValidation:
      name: ignoreValidation
      in: query
      description: >
        When true the reports are put in the file without being validated first.
        Use it to generate output again for reports that have already been sent.
        When false, a report that does not pass validation rejects the whole
        call with 400 `EXPENSE_REPORTS_FAILED_VALIDATION`. Boolean. Optional,
        defaults to false.
      required: false
      schema:
        type: boolean
        default: false
      example: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````