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

# Patch transaction metadata

> Updates the metadata for the provided bank transaction. Include only the fields you want to change. Omitted fields stay unchanged. Send null for a field to clear it.



## OpenAPI

````yaml patch /v1/businesses/{businessId}/bank-transactions/{transactionId}/metadata
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/bank-transactions/{transactionId}/metadata:
    patch:
      tags: []
      summary: Patch transaction metadata
      description: >-
        Updates the metadata for the provided bank transaction. Include only the
        fields you want to change. Omitted fields stay unchanged. Send null for
        a field to clear it.
      operationId: business.bank-transactions.metadata.patch
      parameters:
        - name: businessId
          in: path
          description: >-
            The UUID of the business that the transaction to update the metadata
            for belongs to.
          required: true
          schema:
            type: string
        - name: transactionId
          in: path
          description: The UUID of the bank transaction to update metadata for.
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Content-Type must be set to application/json.
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchTransactionMetadataParams'
      responses:
        '200':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ApiTransactionMetadata'
                required:
                  - data
        '400':
          description: >-
            customer_id and customer_external_id refer to different customers,
            or vendor_id and vendor_external_id refer to different vendors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: The business, transaction, customer, or vendor is not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    PatchTransactionMetadataParams:
      type: object
      properties:
        memo:
          type: string
          nullable: true
          description: >-
            Memo to store on the transaction. Omit this field to leave the
            current memo unchanged. Send null to clear it.
        reference_number:
          type: string
          nullable: true
          description: >-
            Reference number to store on the transaction. Omit this field to
            leave the current value unchanged. Send null to clear it.
        customer_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Layer customer ID to associate with the transaction. The customer
            must already exist. Omit this field to leave the current customer
            unchanged. Send null to clear it.
        customer_external_id:
          type: string
          nullable: true
          description: >-
            External ID of the customer to associate with the transaction. Layer
            creates the customer when this external ID does not exist yet. Omit
            this field to leave the current customer unchanged. Send null to
            clear it. If you also send customer_id, both values must refer to
            the same customer.
        vendor_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Layer vendor ID to associate with the transaction. The vendor must
            already exist. Omit this field to leave the current vendor
            unchanged. Send null to clear it.
        vendor_external_id:
          type: string
          nullable: true
          description: >-
            External ID of the vendor to associate with the transaction. Layer
            creates the vendor when this external ID does not exist yet. Omit
            this field to leave the current vendor unchanged. Send null to clear
            it. If you also send vendor_id, both values must refer to the same
            vendor.
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: >-
            Custom metadata for the transaction. Omit this field to leave the
            current metadata unchanged. Send null to clear it.
      description: >-
        Fields to change on a bank transaction's metadata. Omitted fields stay
        unchanged.
    ApiTransactionMetadata:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be `Transaction_Metadata`.
          example: Transaction_Metadata
        memo:
          type: string
          nullable: true
          description: >-
            Optional memo field for adding notes or additional information about
            the transaction.
          example: Example memo to associate with a transaction
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the bank transaction. Can be used to filter when listing bank
            transactions.
        customer_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Layer customer ID to associate with the bank transaction. Send null
            to clear the customer.
        vendor_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Layer vendor ID to associate with the bank transaction. Send null to
            clear the vendor.
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB.
      description: >-
        Contains metadata associated with a transaction, including an optional
        memo, customer, and vendor.
    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
    PlatformDefinedJson:
      type: object
      description: Arbitrary JSON data defined by the caller, with a 1KB size constraint.
      additionalProperties: true
      example:
        custom_field: value
        any valid json: below 1kb
        nested:
          meaning of life: 42
          array: []
    ApiErrorType:
      type: string
      enum:
        - ResourceArchived
        - AuthFailure
        - Plaid
        - Stripe
        - InvalidState
        - ResourceNotFound
        - InvalidParameters
        - JsonSerialization
        - Unknown
        - BadRequest
        - PaginationCursor
        - Conflict
        - LedgerOperationFailed
      example: InvalidParameters
    ApiEnumErrorType:
      type: string
      description: >-
        Stable enum values for programmatic error handling. Only present in 4xx
        error responses.
      enum:
        - AccessCodeInvalid
        - BalanceSheetDoesNotBalance
        - BalanceSheetMissingAccount
        - BankStatementAccountDetectionError
        - BankStatementParsingError
        - BankStatementParserError
        - BankStatementValidationError
        - 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
        - ReadOnlyBusiness
        - ResourceArchived
        - ScheduleCNotConfigured
        - SmsNotEnabled
        - SpecifiedBadRequest
        - SpecifiedIdNotFound
        - SplitTransactionError
        - StepEvaluationBadRequest
        - StripeConnectAccountIdNotFound
        - StripeCredentialsNotConfigured
        - StripeGetBalanceForConnectAccountFailure
        - StripeRedirectOrRefreshUrlNotConfigured
        - TagFilterNotFound
        - UnexpectedQueryParam
        - UnitAccountsInUse
        - WrongAnswerType
      example: InvalidPayload
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````