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

# Archive credit note

> Archives the credit note. If the credit note has been posted, it will be reversed in the ledger. A credit note with active links to invoice payables cannot be archived — unlink first.



## OpenAPI

````yaml /openapi-public.json post /v1/credit-notes/{creditNoteId}/archive
openapi: 3.0.1
info:
  title: Light API
  version: 1.0.0
servers: []
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /v1/credit-notes/{creditNoteId}/archive:
    post:
      tags:
        - v1 - Credit Notes
      summary: Archive credit note
      description: >-
        Archives the credit note. If the credit note has been posted, it will be
        reversed in the ledger. A credit note with active links to invoice
        payables cannot be archived — unlink first.
      operationId: archiveCreditNote
      parameters:
        - name: creditNoteId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalCreditNoteV1Model'
components:
  schemas:
    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
    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

````