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

# Unarchive customer credit

> Unarchives the given customer credit and reverts it to draft



## OpenAPI

````yaml /openapi-public.json post /v1/customer-credits/{customerCreditId}/unarchive
openapi: 3.0.1
info:
  title: Light API
  version: 1.0.0
servers: []
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /v1/customer-credits/{customerCreditId}/unarchive:
    post:
      tags:
        - v1 - Customer Credits
      summary: Unarchive customer credit
      description: Unarchives the given customer credit and reverts it to draft
      operationId: unarchiveCustomerCredit
      parameters:
        - name: customerCreditId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Customer credit unarchived successfully.
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalCustomerCreditV1Model'
        '400':
          description: Bad request. Customer credit is not archived.
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalUiClientExceptionV1Model'
components:
  schemas:
    ExternalCustomerCreditV1Model:
      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 customer credit amount in cents
          format: int64
          nullable: true
        customerName:
          type: string
          description: Name of the customer
          nullable: true
        customerId:
          type: string
          description: ID of the customer
          format: uuid
          nullable: true
        status:
          type: string
          description: >-
            Status of the customer credit


            ⚠️ 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 customer credit
          nullable: true
        currency:
          type: string
          example: USD
        documentDate:
          type: string
          description: Date when the customer credit 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 customer credit 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 customer credit line items
          items:
            $ref: '#/components/schemas/ExternalCustomerCreditLineV1Model'
        createdAt:
          type: string
          description: Timestamp when the customer credit was created
          format: date-time
        updatedAt:
          type: string
          description: Timestamp when the customer credit was last updated
          format: date-time
        updatedBy:
          type: string
          description: ID of the user who last updated the customer credit
          format: uuid
          nullable: true
        linkedInvoiceReceivable:
          $ref: '#/components/schemas/ExternalRelatedAccDocV1Model'
    ExternalUiClientExceptionV1Model:
      type: object
      properties:
        name:
          type: string
          description: The error name
        type:
          type: string
          description: >-
            The error type


            ⚠️ This enum is not exhaustive; new values may be added in the
            future.
          nullable: false
          deprecated: false
          enum:
            - BAD_REQUEST
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - CONFLICT
            - UNPROCESSABLE_CONTENT
        errors:
          type: array
          description: List of errors providing details about what went wrong
          items:
            $ref: '#/components/schemas/ExternalUiClientExceptionErrorV1Model'
      description: Failure context when vendor onboarding fails.
      nullable: true
    ExternalCustomerCreditLineV1Model:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object
          format: uuid
        companyId:
          type: string
          description: ID of the company
          format: uuid
        customerCreditId:
          type: string
          description: ID of the customer credit this line belongs to
          format: uuid
        grossTransactionAmount:
          $ref: '#/components/schemas/DirectedAmount'
        netTransactionAmount:
          $ref: '#/components/schemas/DirectedAmount'
        description:
          type: string
          description: Description of the customer credit 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
        avataxCode:
          type: string
          description: Avalara tax code. Used when the customer credit tax engine is AVATAX
          nullable: true
        productId:
          type: string
          description: ID of the product
          format: uuid
        quantity:
          type: number
          description: Quantity of the product
        createdAt:
          type: string
          description: Timestamp when the customer credit was created
          format: date-time
        updatedAt:
          type: string
          description: Timestamp when the customer credit 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
    ExternalRelatedAccDocV1Model:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object
          format: uuid
        documentNumber:
          type: string
          description: Document number
          nullable: true
        documentDate:
          type: string
          description: Date the accounting document was issued
          format: date
          nullable: true
        status:
          type: string
          description: >-
            Status of the accounting document


            ⚠️ 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
        amount:
          type: integer
          description: The amount of the accounting document in cents
          format: int64
          nullable: true
        currency:
          type: string
          example: USD
      description: Invoice payable details
    ExternalUiClientExceptionErrorV1Model:
      type: object
      properties:
        type:
          type: string
          description: A string code identifying the error type
        message:
          type: string
          description: A human-readable message providing more details about the error
        path:
          type: array
          description: >-
            Optional path of the error when the error is for a specific field.
            Used mostly on BAD_REQUEST errors, that path will match the field
            name on the request object
          nullable: true
          items:
            type: string
            description: >-
              Optional path of the error when the error is for a specific field.
              Used mostly on BAD_REQUEST errors, that path will match the field
              name on the request object
            nullable: true
        context:
          type: object
          additionalProperties:
            type: object
            description: >-
              Optional context providing additional information about the error.
              This can include any relevant data that might help in
              understanding or resolving the error
            nullable: true
          description: >-
            Optional context providing additional information about the error.
            This can include any relevant data that might help in understanding
            or resolving the error
          nullable: true
      description: List of errors providing details about what went wrong
    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

````