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

# Download Document

> Download a Document.

**The Documents Data Model** simplifies the handling of document documents across various accounting platforms, providing a standardised approach to accessing and managing document-related information.


## OpenAPI

````yaml GET /download_document/{document_id}
openapi: 3.0.1
info:
  title: rootfi
  version: v3
servers:
  - url: https://api.rootfi.dev/v3
    description: global
  - url: https://api.sa.rootfi.dev/v3
    description: saudi
security: []
paths:
  /download_document/{document_id}:
    get:
      tags:
        - AccountingDownloadDocument
      summary: Download Document
      description: Download a Document.
      operationId: accounting_downloadDocument_download
      parameters:
        - name: document_id
          in: path
          description: The ID of the document
          required: true
          schema:
            type: string
          examples:
            Example1:
              value: '123456'
        - name: rootfi_company_id
          in: query
          description: The company ID of the document
          required: true
          schema:
            type: integer
          examples:
            Example1:
              value: 111
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/accountingDownloadDocResponse'
              examples:
                Example1:
                  value:
                    data:
                      rootfi_id: 1112
                      rootfi_deleted_at: null
                      rootfi_created_at: '2024-01-25T09:00:00Z'
                      rootfi_updated_at: '2024-01-25T09:00:00Z'
                      rootfi_company_id: 111
                      platform_id: '123456_1'
                      platform_unique_id: '123456'
                      file_name: Example File Name
                      file_type: Example File Type
                      file_size: Example File Size
                      document_type_id: '123456'
                      document_type: Example Document Type
                      document_uploaded: true
                      download_url: https://example.com
                      updated_at: '2024-01-25T09:00:00Z'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    accountingDownloadDocResponse:
      title: accountingDownloadDocResponse
      type: object
      description: The data of the documents endpoint
      properties:
        data:
          $ref: '#/components/schemas/accountingDownlaodDocumentObject'
      required:
        - data
      allOf:
        - $ref: '#/components/schemas/CommonReadResponse'
    RootFiAPIResponseType:
      title: RootFiAPIResponseType
      type: object
      properties:
        error:
          $ref: '#/components/schemas/RootFiAPIResponseErrorType'
          description: The error message
      required:
        - error
    accountingDownlaodDocumentObject:
      title: accountingDownlaodDocumentObject
      type: object
      properties: {}
      allOf:
        - $ref: '#/components/schemas/AccountingRootFiBaseFields'
        - $ref: '#/components/schemas/accountingDownloadDocumentFields'
    CommonReadResponse:
      title: CommonReadResponse
      type: object
      properties:
        prev:
          type: string
          nullable: true
          description: The previous page of objects to retrieve
        next:
          type: string
          nullable: true
          description: The next page of objects to retrieve
        total_count:
          type: integer
          nullable: true
          description: The total count of the objects
    RootFiAPIResponseErrorType:
      title: RootFiAPIResponseErrorType
      type: object
      properties:
        message:
          type: string
          description: The error message
        code:
          type: string
          description: The error code
        field:
          type: string
          description: The status of the error
      required:
        - message
        - code
        - field
    AccountingRootFiBaseFields:
      title: AccountingRootFiBaseFields
      type: object
      properties:
        rootfi_id:
          type: number
          format: double
          description: The unique ID we assign for that data's information
          example: 157
        rootfi_deleted_at:
          type: string
          format: date-time
          nullable: true
          description: The date at which the data was deleted in the accounting platform
        rootfi_created_at:
          type: string
          format: date-time
          description: The date at which RootFi first synced this data
          example: '2024-01-22T05:07:31.465Z'
        rootfi_updated_at:
          type: string
          format: date-time
          description: The latest date at which RootFi updated this data
          example: '2024-01-22T05:07:31.000Z'
        rootfi_company_id:
          type: number
          format: double
          description: The ID of the company in the accounting platform
          example: 1089
        platform_id:
          type: string
          description: An unique custom RootFi ID made from platform's unique_id.
          example: '123456'
        platform_unique_id:
          type: string
          nullable: true
          description: The ID of the data in the accounting platform.
        raw_data:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            A JSON containing fields that you can directly get from the
            accounting platform.
        data_hash:
          type: string
          nullable: true
          description: The hash of the data
      required:
        - rootfi_id
        - rootfi_created_at
        - rootfi_updated_at
        - rootfi_company_id
        - platform_id
    accountingDownloadDocumentFields:
      title: accountingDownloadDocumentFields
      type: object
      properties:
        file_name:
          type: string
          nullable: true
          description: The file name of the document
        file_type:
          type: string
          nullable: true
          description: The file type of the document
        file_size:
          type: string
          nullable: true
          description: The file size of the document
        document_type_id:
          type: string
          nullable: true
          description: The document type ID of the document
        document_type:
          type: string
          nullable: true
          description: The document type of the document
        document_uploaded:
          type: boolean
          nullable: true
          description: The document uploaded of the document
        download_url:
          type: string
          nullable: true
          description: The download URL of the document
        updated_at:
          type: string
          nullable: true
          description: The updated date of the document
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key

````