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

# Update vendor credit

> Updates an existing vendor credit.



## OpenAPI

````yaml patch /v1/businesses/{businessId}/bills/vendor-credits/{vendorCreditId}
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/bills/vendor-credits/{vendorCreditId}:
    patch:
      tags: []
      summary: Update vendor credit
      description: Updates an existing vendor credit.
      operationId: business.bills.vendor-credits.patch
      parameters:
        - name: businessId
          in: path
          description: The UUID of the business the vendor credit belongs to.
          required: true
          schema:
            type: string
            format: uuid
        - name: vendorCreditId
          in: path
          description: The UUID of the vendor credit to update.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorCreditUpdateParams'
        required: true
      responses:
        '200':
          description: Vendor credit updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiVendorCredit'
components:
  schemas:
    VendorCreditUpdateParams:
      type: object
      properties:
        external_id:
          type: string
          description: External identifier for the vendor credit.
        vendor_id:
          type: string
          format: uuid
          description: UUID of the vendor this credit is associated with.
        vendor_external_id:
          type: string
          description: External identifier of the vendor this credit is associated with.
        received_at:
          type: string
          format: date-time
          description: Timestamp when the vendor credit was received.
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/VendorCreditLineItemCreateParams'
          description: List of line items for this vendor credit.
        allocations:
          type: array
          items:
            $ref: '#/components/schemas/VendorCreditAllocationCreateParams'
          description: List of allocations for this vendor credit.
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagKeyValue'
          description: List of tags associated with this vendor credit.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the vendor credit
            (for example, to display to end users).
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB.
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the vendor credit. Can be used to filter when listing vendor
            credits.
    ApiVendorCredit:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the vendor credit.
        external_id:
          type: string
          description: External identifier for the vendor credit.
        vendor:
          $ref: '#/components/schemas/ApiVendorData'
          description: The vendor associated with this credit.
        received_at:
          type: string
          format: date-time
          description: Timestamp when the vendor credit was received.
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/ApiVendorCreditLineItem'
          description: List of line items for this vendor credit.
        allocations:
          type: array
          items:
            $ref: '#/components/schemas/ApiVendorCreditAllocation'
          description: List of allocations for this vendor credit.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the vendor credit was created.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the vendor credit was last updated.
        deleted_at:
          type: string
          format: date-time
          description: Timestamp when the vendor credit was deleted, if applicable.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: List of tags associated with this vendor credit.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the vendor credit
            (for example, to display to end users).
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB.
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the vendor credit. Can be used to filter when listing vendor
            credits.
      required:
        - id
        - vendor
        - received_at
        - line_items
        - created_at
        - updated_at
        - transaction_tags
    VendorCreditLineItemCreateParams:
      type: object
      properties:
        amount:
          type: integer
          format: int64
          description: Amount for the line item in cents.
        expense_account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          description: >-
            Identifier for the expense account for the vendor credit line item.
            It is suggested but not required that this should point to an
            expense account (as opposed to revenue/asset/liability/equity).
        memo:
          type: string
          description: Description for the line item.
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB.
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the vendor credit line item.
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagKeyValue'
          description: List of tags associated with this vendor credit line item.
      required:
        - amount
        - expense_account_identifier
    VendorCreditAllocationCreateParams:
      type: object
      properties:
        amount:
          type: integer
          format: int64
          description: Amount for the allocation in cents.
        bill_id:
          type: string
          format: uuid
          description: UUID of the bill the vendor credit allocation is for.
      required:
        - amount
        - bill_id
    TagKeyValue:
      type: object
      description: >-
        A TagKeyValue holds key=value data related to a tag. This is used when
        creating or updating taggable entities (transactions, invoices, etc.).
      properties:
        key:
          type: string
          description: The tag dimension key (e.g., "department", "project", "location").
          example: department
        dimension_display_name:
          type: string
          nullable: true
          description: >-
            If the TagDimension doesn't exist, providing this value specifies
            the display name upon database insertion. Otherwise, it is left as
            null on the TagDimension.
          example: Department
        value:
          type: string
          description: The tag value (e.g., "sales", "marketing", "engineering").
          example: sales
        value_display_name:
          type: string
          nullable: true
          description: >-
            If the TagValueDefinition doesn't exist, providing this value
            specifies the display name upon database insertion. Otherwise, it is
            left as null on the TagValueDefinition.
          example: Sales Department
      required:
        - key
        - value
    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: []
    ApiVendorData:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the vendor.
        external_id:
          type: string
          description: >-
            Unique ID of the vendor in your system for linking purposes.
            **Idempotency key**.
        individual_name:
          type: string
          nullable: true
          description: Full name of the individual vendor or contact at a corporate vendor.
        company_name:
          type: string
          nullable: true
          description: Name of the company vendor.
        email:
          type: string
          nullable: true
          description: Email address of the vendor.
        mobile_phone:
          type: string
          nullable: true
          description: Mobile phone number of the vendor.
        office_phone:
          type: string
          nullable: true
          description: Office phone number of the vendor.
        address_string:
          type: string
          nullable: true
          description: Address of the vendor.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the vendor (for
            example, to display to end users).
        status:
          type: string
          enum:
            - ACTIVE
            - ARCHIVED
          description: Status of the vendor.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
    ApiVendorCreditLineItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the vendor credit line item.
        ledger_account:
          $ref: '#/components/schemas/SingleApiChartAccount'
          description: Ledger account for this line item.
        amount:
          type: integer
          format: int64
          description: Amount for the line item in cents.
        memo:
          type: string
          description: Description for the line item.
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB.
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the vendor credit line item.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: List of tags associated with this vendor credit line item.
      required:
        - id
        - amount
    ApiVendorCreditAllocation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the vendor credit allocation.
        vendor_credit_id:
          type: string
          format: uuid
          description: UUID of the vendor credit this allocation belongs to.
        bill_id:
          type: string
          format: uuid
          description: UUID of the bill this allocation is for.
        amount:
          type: integer
          format: int64
          description: Amount for the allocation in cents.
      required:
        - id
        - vendor_credit_id
        - bill_payment_id
        - amount
    ApiTag:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: ID for the tag.
        key:
          type: string
          description: Key for the tag.
          example: ExampleTagKey
        dimension_display_name:
          type: string
          nullable: true
          description: Display name for the tag dimension.
        value:
          type: string
          description: Value for the tag.
          example: ExampleTagValue
        value_display_name:
          type: string
          nullable: true
          description: Display name for the tag value definition.
        dimension_id:
          type: string
          format: uuid
          description: ID of the tag dimension this tag belongs to.
        definition_id:
          type: string
          format: uuid
          description: ID of the tag value definition.
        archived_at:
          type: string
          format: date-time
          nullable: true
          description: When the tag was archived.
      required:
        - id
        - key
        - value
        - dimension_id
        - definition_id
    AccountIdentifier:
      oneOf:
        - $ref: '#/components/schemas/AccountId'
          description: ID of the account.
          title: Account ID
        - $ref: '#/components/schemas/AccountStableName'
          description: Stable name associated with the account.
          title: Account Stable Name
    SingleApiChartAccount:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/AccountIdentifier'
        name:
          type: string
          description: Name of the account.
          example: Current Assets
        account_number:
          type: string
          nullable: true
          description: Account number if configured.
          example: '4000'
        stable_name:
          $ref: '#/components/schemas/AccountStableName'
        normality:
          $ref: '#/components/schemas/BankTransactionDirection'
        account_type:
          $ref: '#/components/schemas/ApiLedgerAccountType'
        account_subtype:
          $ref: '#/components/schemas/ApiLedgerAccountSubtype'
      description: A single ledger account without nested children.
    AccountId:
      type: object
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - AccountId
          description: Resource type. Value will be `AccountId`.
          example: AccountId
        id:
          type: string
          format: uuid
          description: ID of the account.
    AccountStableName:
      type: object
      required:
        - type
        - stable_name
      properties:
        type:
          type: string
          enum:
            - StableName
          description: Resource type. Value will be `StableName`.
          example: StableName
        stable_name:
          type: string
          example: CURRENT_ASSETS
          description: Stable name of the account.
    BankTransactionDirection:
      type: string
      enum:
        - CREDIT
        - DEBIT
    ApiLedgerAccountType:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/LedgerAccountType'
          description: Type of the account.
        display_name:
          type: string
          description: Display name of the account type.
          example: Asset
    ApiLedgerAccountSubtype:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/LedgerAccountSubtype'
        display_name:
          type: string
          description: Display name of the account subtype.
          example: Current Assets
    LedgerAccountType:
      type: string
      enum:
        - ASSET
        - LIABILITY
        - EQUITY
        - REVENUE
        - COGS
        - EXPENSE
    LedgerAccountSubtype:
      type: string
      enum:
        - BANK_ACCOUNTS
        - ACCOUNTS_RECEIVABLE
        - INVENTORY
        - PAYMENT_PROCESSOR_CLEARING_ACCOUNT
        - FIXED_ASSET
        - ACCUMULATED_DEPRECIATION
        - CASH
        - UNDEPOSITED_FUNDS
        - CURRENT_ASSET
        - NON_CURRENT_ASSET
        - PREPAID_EXPENSES
        - DEVELOPMENT_COSTS
        - LOANS_RECEIVABLE
        - INTANGIBLE_ASSET
        - ACCOUNTS_PAYABLE
        - CREDIT_CARD
        - TAXES_PAYABLE
        - INCOME_TAXES_PAYABLE
        - SALES_TAXES_PAYABLE
        - OTHER_TAXES_PAYABLE
        - PAYROLL_TAXES_PAYABLE
        - UNEARNED_REVENUE
        - PAYROLL_LIABILITY
        - PAYROLL_CLEARING
        - LINE_OF_CREDIT
        - TIPS
        - REFUND_LIABILITIES
        - UNDEPOSITED_OUTFLOWS
        - OUTGOING_PAYMENT_CLEARING_ACCOUNT
        - OTHER_CURRENT_LIABILITY
        - LOANS_PAYABLE
        - NOTES_PAYABLE
        - SHAREHOLDER_LOAN
        - NON_CURRENT_LIABILITY
        - CONTRIBUTIONS
        - DISTRIBUTIONS
        - COMMON_STOCK
        - PREFERRED_STOCK
        - ADDITIONAL_PAID_IN_CAPITAL
        - RETAINED_EARNINGS
        - ACCUMULATED_ADJUSTMENTS
        - OPENING_BALANCE_EQUITY
        - OTHER_EQUITY
        - SALES
        - UNCATEGORIZED_REVENUE
        - RETURNS_ALLOWANCES
        - DIVIDEND_INCOME
        - INTEREST_INCOME
        - OTHER_INCOME
        - COGS
        - OPERATING_EXPENSES
        - PAYROLL
        - TAXES_LICENSES
        - UNCATEGORIZED_EXPENSE
        - CHARITABLE_CONTRIBUTIONS
        - LOAN_EXPENSES
        - FINANCE_COSTS
        - INTEREST_EXPENSES
        - DEPRECIATION
        - AMORTIZATION
        - BAD_DEBT
        - OTHER_EXPENSES
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````