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

# Download Original File

> Download the original file of an invoice or credit note you received, as your trade partner sent it. Use it to keep the original document on your side, for example next to the invoice in your ERP.

Use the `procurosTransactionId` from `GET /v2/transactions` or from `GET /v2/all-transactions`.

The original file is available when the invoice or credit note reached Procuros as a PDF or as an e-invoice, for example an XRechnung XML or a ZUGFeRD PDF. If your trade partner sent an e-invoice XML together with a PDF copy, you get the XML, because the XML is the e-invoice. The `Content-Type` header tells you which kind of file you got, and the `Content-Disposition` header carries its file name.

The endpoint returns `404` when the transaction does not exist or when its original file is not an e-invoice.



## OpenAPI

````yaml /en/api/v2/openapi-v2.yaml get /v2/transactions/{procurosTransactionId}/original-file
openapi: 3.0.3
info:
  title: Procuros API
  description: Manage Procuros Transactions.
  version: 2.0.0
servers:
  - url: https://api.procuros.io/
  - url: https://api.procuros-staging.io/
security:
  - api_token: []
paths:
  /v2/transactions/{procurosTransactionId}/original-file:
    get:
      tags:
        - E-Invoicing
      summary: Download Original File
      description: >-
        Download the original file of an invoice or credit note you received, as
        your trade partner sent it. Use it to keep the original document on your
        side, for example next to the invoice in your ERP.


        Use the `procurosTransactionId` from `GET /v2/transactions` or from `GET
        /v2/all-transactions`.


        The original file is available when the invoice or credit note reached
        Procuros as a PDF or as an e-invoice, for example an XRechnung XML or a
        ZUGFeRD PDF. If your trade partner sent an e-invoice XML together with a
        PDF copy, you get the XML, because the XML is the e-invoice. The
        `Content-Type` header tells you which kind of file you got, and the
        `Content-Disposition` header carries its file name.


        The endpoint returns `404` when the transaction does not exist or when
        its original file is not an e-invoice.
      operationId: v2_download_original_file
      parameters:
        - name: procurosTransactionId
          in: path
          required: true
          description: The `procurosTransactionId` of the invoice or credit note.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Success
          content:
            application/pdf:
              schema:
                type: string
                format: binary
                description: >-
                  The original PDF file. A ZUGFeRD or Factur-X PDF keeps its
                  embedded XML.
            application/xml:
              schema:
                type: string
                format: binary
                description: The original e-invoice XML file.
        '404':
          description: Transaction not found, or its original file is not an e-invoice
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalErrorResponse'
        4XX:
          description: Client Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalErrorResponse'
        5XX:
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalErrorResponse'
components:
  schemas:
    InternalErrorResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    api_token:
      type: http
      scheme: bearer
      description: The API Token of your ERP Connection.

````

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