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

# Update invoice custom fields

> Set or clear the custom field values of an invoice. Fields are addressed by their definition id or by their key, and only the fields present in the request are touched — omitted fields keep their current value, while null, an empty string or an empty array clears a field. Custom fields carry no accounting meaning, so they can be written at any invoice status, including exported and archived invoices. Every change is recorded in the invoice's activity feed.



## OpenAPI

````yaml patch /v1/invoice/{id}/custom-fields
openapi: 3.0.0
info:
  title: ibana public api
  description: Public API for ibana
  version: 1.0.0
  contact:
    name: ibana
    url: https://ibana.io
    email: dev@ibana.io
servers:
  - url: https://public-api.ibana.io
    description: Production
security: []
tags: []
paths:
  /v1/invoice/{id}/custom-fields:
    patch:
      tags:
        - Invoice
      summary: Update invoice custom fields
      description: >-
        Set or clear the custom field values of an invoice. Fields are addressed
        by their definition id or by their key, and only the fields present in
        the request are touched — omitted fields keep their current value, while
        null, an empty string or an empty array clears a field. Custom fields
        carry no accounting meaning, so they can be written at any invoice
        status, including exported and archived invoices. Every change is
        recorded in the invoice's activity feed.
      operationId: InvoiceController_updateCustomFields_v1
      parameters:
        - name: id
          required: true
          in: path
          description: Invoice ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCustomFieldValuesDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomFieldValuesResponseDto'
      security:
        - bearer: []
components:
  schemas:
    UpdateCustomFieldValuesDto:
      type: object
      properties:
        values:
          type: object
          additionalProperties: true
          description: >-
            Custom fields to write, keyed by definition id (or, on the public
            API, by definition key). Only the fields present here are touched;
            omitted fields keep their current value. Pass null, an empty string
            or an empty array to clear a field. Select fields take an option id,
            multi-select fields a list of option ids, checkboxes a boolean.
          example:
            erp-referenz: SAP-4711
            freigegeben: true
            region: opt-dach
      required:
        - values
    CustomFieldValuesResponseDto:
      type: object
      properties:
        customFieldValues:
          type: object
          additionalProperties: true
          description: >-
            Custom field values of the entity, keyed by definition id. Each
            entry carries the definition key and label alongside the raw value
            and its human readable display value.
          example:
            0f8b6a4e-3d1a-4c2f-9f1b-2a5c6d7e8f90:
              definitionId: 0f8b6a4e-3d1a-4c2f-9f1b-2a5c6d7e8f90
              key: erp-referenz
              label: ERP-Referenz
              type: STRING
              value: SAP-4711
              displayValue: SAP-4711
      required:
        - customFieldValues
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````