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

# Upload transaction document

> Upload a document for a transaction, such as a receipt or invoice. Images (`jpg` & `png`) and PDFs are supported. The document will be associated with the provided transaction id. This functionality is built into Layer's `<BankTransactions>` embedded component, but can be used directly if needed. This endpoint expects a multipart upload.



## OpenAPI

````yaml post /v1/businesses/{businessId}/bank-transactions/{transactionId}/documents
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/bank-transactions/{transactionId}/documents:
    post:
      tags: []
      summary: Upload transaction document
      description: >-
        Upload a document for a transaction, such as a receipt or invoice.
        Images (`jpg` & `png`) and PDFs are supported. The document will be
        associated with the provided transaction id. This functionality is built
        into Layer's `<BankTransactions>` embedded component, but can be used
        directly if needed. This endpoint expects a multipart upload.
      operationId: business.documents.post
      parameters:
        - name: businessId
          in: path
          description: The UUID of the business to upload the document for.
          required: true
          schema:
            type: string
        - name: transactionId
          in: path
          description: The UUID of the transaction to associate this document with.
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Content-Type must be set to multipart/form-data.
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - documentType
                - file
              properties:
                documentType:
                  $ref: '#/components/schemas/DocumentType'
                  description: The type of document being uploaded.
                file:
                  type: string
                  format: binary
                  description: >-
                    The document file. For RECEIPT documents, only images (jpg,
                    png) and PDFs are supported.
                description:
                  type: string
                  description: Optional description for the document.
      responses:
        '201':
          description: Document uploaded successfully.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiFileMetadata'
        '400':
          description: >-
            Bad request. Possible causes: missing or invalid `documentType`, no
            file uploaded, file too large, duplicate file names, unrecognized
            form fields, or invalid file type for the given document type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: >-
            Business id is not found. This indicates the business id is invalid
            or the business has been archived.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    DocumentType:
      type: string
      enum:
        - RECEIPT
    ApiFileMetadata:
      type: object
      properties:
        id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Optional unique identifier for the file, can be null if not
            specified.
        fileType:
          type: string
          description: The type of the file (e.g., PDF, DOCX, JPEG).
          example: JPEG
        filename:
          type: string
          description: The name of the file including its extension.
          example: exampleFile.jpg
        documentType:
          $ref: '#/components/schemas/DocumentType'
          description: The type of document.
      required:
        - fileType
        - filename
        - documentType
      description: >-
        Contains metadata about a file, including its type, name, and the
        category of document it represents.
    ApiError:
      type: object
      description: An error object returned in API error responses.
      properties:
        type:
          $ref: '#/components/schemas/ApiErrorType'
          description: >-
            A fixed category for the error, helpful for categorizing and
            processing errors.
        description:
          type: string
          description: A human-readable error description.
        error_enum:
          $ref: '#/components/schemas/ApiEnumErrorType'
          description: >-
            A stable, machine-readable identifier for programmatically handling
            specific error conditions. Only present for 4xx client errors—not
            included for 5xx server errors. Use this instead of parsing the
            description field, as enum values remain stable across API versions.
          nullable: true
        meta:
          type: object
          description: Optional additional information about the error.
          nullable: true
      required:
        - type
        - description
    ApiErrorType:
      type: string
      enum:
        - ResourceArchived
        - AuthFailure
        - Plaid
        - Stripe
        - InvalidState
        - ResourceNotFound
        - InvalidParameters
        - JsonSerialization
        - Unknown
        - BadRequest
        - PaginationCursor
        - Conflict
        - LedgerOperationFailed
    ApiEnumErrorType:
      type: string
      description: >-
        Stable enum values for programmatic error handling. Only present in 4xx
        error responses.
      enum:
        - AccessCodeInvalid
        - BalanceSheetDoesNotBalance
        - BalanceSheetMissingAccount
        - BankStatementParserError
        - BillStateError
        - BulkCategorizeFailure
        - BulkMatchFailure
        - BusinessTaskAlreadyCompleted
        - BusinessTaskDeleted
        - CalendlyOAuthError
        - CallBookingError
        - CantUpdateTransactionInCustomerPayout
        - CantUpdateTransactionInVendorPayout
        - CheckPayrollConfigNotFound
        - CheckPayrollServiceNotFound
        - ClerkUserAlreadyExists
        - ConflictingQueryParams
        - CustomAccountAlreadyExists
        - CustomTransactionCsvParsingError
        - CustomTransactionUploadFailure
        - CustomerPayoutInputFormatError
        - DoesNotMatchExistingEntity
        - EmptyBatchRequest
        - ExpenseParserError
        - ExternalAccountBalanceReconciliationError
        - ExternalIdConflict
        - InvalidCategory
        - InvalidEffectiveDate
        - InvalidLedgerOperation
        - InvalidMonthlyAverageRange
        - InvalidMultiPartRequest
        - InvalidPaginationCursor
        - InvalidPayload
        - InvoiceDeleted
        - InvoiceNotFound
        - InvoiceReferenceMismatch
        - InvoiceStateError
        - ManualRateLimit
        - MultipleTagKeyFiltersUnsupported
        - NoCognitoUserFound
        - NoOpeningBalanceFound
        - NotYetReconciled
        - OnePasswordApiError
        - OnePasswordItemNotFound
        - OnePasswordVaultNotFound
        - OpenAICategorizationError
        - PaymentLinkInvalid
        - PayrollStateError
        - PeriodIsClosed
        - PeriodNotClosed
        - PhoneNumberAlreadyRegistered
        - PlaidApiError
        - PlaidConnectionBroken
        - PlaidCreateLinkTokenError
        - PlaidCredentialsNotConfigured
        - PlaidExchangePublicTokenError
        - PlaidGetInstitutionByIdError
        - PlaidGetItemError
        - PlaidInvalidEnvironment
        - PlaidItemAlreadyExists
        - PlaidItemNotFound
        - PlaidProcessorApiError
        - PlaidUnlinkItemError
        - QueryParamFormat
        - QueryParamMissing
        - QuickbooksBrokenConnection
        - QuickbooksConnectionAlreadyExists
        - QuickbooksConnectionAlreadySyncing
        - QuickbooksConnectionMissing
        - QuickbooksConnectionNotActivated
        - QuickbooksInvalidRequest
        - QuickbooksInvalidState
        - QuickbooksNoMatchingAccount
        - QuickbooksNonPostingAccountType
        - QuickbooksNotConfigured
        - QuickbooksOAuthCallbackInvalid
        - QuickbooksOAuthError
        - QuickbooksTokenExpired
        - ResourceArchived
        - ScheduleCNotConfigured
        - SmsNotEnabled
        - SpecifiedBadRequest
        - SpecifiedIdNotFound
        - SplitTransactionError
        - StepEvaluationBadRequest
        - StripeConnectAccountIdNotFound
        - StripeCredentialsNotConfigured
        - StripeGetBalanceForConnectAccountFailure
        - StripeRedirectOrRefreshUrlNotConfigured
        - TagFilterNotFound
        - UnexpectedQueryParam
        - UnitAccountsInUse
        - WrongAnswerType
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````