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

# Update credit note

> Updates a credit note in draft status. Fields sent as `null` clear the value; omitted fields remain unchanged.



## OpenAPI

````yaml /openapi-public.json patch /v1/credit-notes/{creditNoteId}
openapi: 3.0.1
info:
  title: Light API
  version: 1.0.0
servers: []
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /v1/credit-notes/{creditNoteId}:
    patch:
      tags:
        - v1 - Credit Notes
      summary: Update credit note
      description: >-
        Updates a credit note in draft status. Fields sent as `null` clear the
        value; omitted fields remain unchanged.
      operationId: updateCreditNote
      parameters:
        - name: creditNoteId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/ExternalUpdateCreditNoteRequestV1Model'
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalCreditNoteV1Model'
components:
  schemas:
    ExternalUpdateCreditNoteRequestV1Model:
      type: object
      properties:
        companyEntityId:
          type: string
          description: ID of the entity
          format: uuid
          nullable: true
        businessPartnerId:
          type: string
          description: ID of the vendor
          format: uuid
          nullable: true
        documentDate:
          type: string
          description: Date when the credit note was issued
          format: date
          nullable: true
        areLinesWithTax:
          type: boolean
          description: >-
            Whether line amounts include tax. true = tax included (gross), false
            = tax added on top (net)
          nullable: true
        customProperties:
          type: array
          description: List of custom properties
          nullable: true
          items:
            $ref: '#/components/schemas/ExternalSetCustomPropertyRequestV1Model'
        description:
          type: string
          description: Description of the credit note
          nullable: true
        currency:
          type: string
          nullable: true
          example: USD
        amount:
          type: integer
          description: Total credit note amount in cents
          format: int64
          nullable: true
        documentNumber:
          type: string
          description: Unique credit note number
          nullable: true
        localCurrencyFxRateOverride:
          type: number
          description: >-
            Custom FX rate for the ledger's local currency. If not provided,
            Light uses official ECB rates.
          nullable: true
        groupCurrencyFxRateOverride:
          type: number
          description: >-
            Custom FX rate for the ledger's group currency. If not provided,
            Light uses official ECB rates.
          nullable: true
    ExternalCreditNoteV1Model:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object
          format: uuid
        companyId:
          type: string
          description: ID of the company
          format: uuid
        companyEntityId:
          type: string
          description: ID of the entity
          format: uuid
          nullable: true
        amount:
          type: integer
          description: Total credit note amount in cents
          format: int64
          nullable: true
        businessPartnerName:
          type: string
          description: Name of the vendor
          nullable: true
        businessPartnerId:
          type: string
          description: ID of the vendor
          format: uuid
          nullable: true
        status:
          type: string
          description: >-
            Status of the credit note


            ⚠️ This enum is not exhaustive; new values may be added in the
            future.
          nullable: false
          deprecated: false
          enum:
            - DRAFT
            - APPROVAL_PENDING
            - APPROVED
            - POSTED
            - PARTIALLY_CLEARED
            - CLEARED
            - ARCHIVED
        description:
          type: string
          description: Description of the credit note
          nullable: true
        currency:
          type: string
          example: USD
        postingDate:
          type: string
          description: Date when the credit note should be posted to the ledger
          format: date
          nullable: true
        documentDate:
          type: string
          description: Date when the credit note was issued
          format: date
          nullable: true
        valuationDate:
          type: string
          description: Date used when applying foreign exchange rate
          format: date
          nullable: true
        areLinesWithTax:
          type: boolean
          description: >-
            Whether the credit note line amount is inclusive of tax or not. True
            means tax is already included in the line amount and will not be
            added on top, false means tax will be added on top of the line
            amount
        lines:
          type: array
          description: List of credit note line items
          items:
            $ref: '#/components/schemas/ExternalCreditNoteLineV1Model'
        createdAt:
          type: string
          description: Timestamp when the credit note was created
          format: date-time
        updatedAt:
          type: string
          description: Timestamp when the credit note was last updated
          format: date-time
        updatedBy:
          type: string
          description: ID of the user who last updated the credit note
          format: uuid
          nullable: true
        localCurrencyFxRate:
          type: number
          description: FX rate applied for the ledger's local currency
          nullable: true
        groupCurrencyFxRate:
          type: number
          description: FX rate applied for the ledger's group currency
          nullable: true
        senderEmail:
          type: string
          description: >-
            The email of the user who sent the document that this credit note
            was created from
          nullable: true
        documentName:
          type: string
          description: The name of the document that this credit note was created from
          nullable: true
    ExternalSetCustomPropertyRequestV1Model:
      type: object
      properties:
        groupId:
          type: string
          description: ID of the custom property group.
          format: uuid
        valueIds:
          type: array
          description: >-
            IDs of the selected custom property values. It behaves as a PUT
            operation, so if empty the existing ones will be effectively
            deleted.
          items:
            type: string
            description: >-
              IDs of the selected custom property values. It behaves as a PUT
              operation, so if empty the existing ones will be effectively
              deleted.
            format: uuid
        inlineValues:
          type: array
          description: >-
            Inline custom property values (used for TEXT/NUMERIC/DATE/etc.
            groups). It behaves as a PUT operation, so if empty or null the
            existing ones will be effectively deleted.
          nullable: true
          items:
            type: string
            description: >-
              Inline custom property values (used for TEXT/NUMERIC/DATE/etc.
              groups). It behaves as a PUT operation, so if empty or null the
              existing ones will be effectively deleted.
            nullable: true
      description: >-
        List of custom properties to set on the vendor. Replaces the existing
        set.
      nullable: true
    ExternalCreditNoteLineV1Model:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object
          format: uuid
        companyId:
          type: string
          description: ID of the company
          format: uuid
        creditNoteId:
          type: string
          description: ID of the credit note this line belongs to
          format: uuid
        grossTransactionAmount:
          $ref: '#/components/schemas/DirectedAmount'
        netTransactionAmount:
          $ref: '#/components/schemas/DirectedAmount'
        description:
          type: string
          description: Description of the credit note line item
          nullable: true
        ledgerTaxId:
          type: string
          description: ID of the tax code
          format: uuid
          nullable: true
        taxTransactionAmount:
          $ref: '#/components/schemas/DirectedAmount'
        ledgerAccountId:
          type: string
          description: ID of the ledger account
          format: uuid
          nullable: true
        costCenterId:
          type: string
          description: ID of the cost center
          format: uuid
          nullable: true
        createdAt:
          type: string
          description: Timestamp when the credit note line item was created
          format: date-time
        updatedAt:
          type: string
          description: Timestamp when the credit note line item was last updated
          format: date-time
        accrualTemplateId:
          type: string
          description: ID of the accrual template
          format: uuid
          nullable: true
        accrualStartDate:
          type: string
          description: Start date for accrual
          format: date
          nullable: true
        accrualEndDate:
          type: string
          description: End date for accrual
          format: date
          nullable: true
        accrualDefaultDuration:
          type: integer
          description: Default duration for accrual in months
          format: int32
          nullable: true
    DirectedAmount:
      type: object
      properties:
        amount:
          type: integer
          format: int64
        dcSign:
          type: string
          description: >-
            ⚠️ This enum is not exhaustive; new values may be added in the
            future.
          enum:
            - D
            - C
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      description: >-
        Basic authentication header of the form **Basic** **<api_key>**, where
        **<api_key>** is your api key.
      name: Authorization
      in: header
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````