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

> Archives an invoice receivable



## OpenAPI

````yaml /openapi-public.json post /v1/invoice-receivables/{invoiceReceivableId}/archive
openapi: 3.0.1
info:
  title: Light API
  version: 1.0.0
servers: []
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /v1/invoice-receivables/{invoiceReceivableId}/archive:
    post:
      tags:
        - v1 - Invoice Receivables
      summary: Archive invoice
      description: Archives an invoice receivable
      operationId: archiveInvoiceReceivable
      parameters:
        - name: invoiceReceivableId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalInvoiceReceivableV1Model'
components:
  schemas:
    ExternalInvoiceReceivableV1Model:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object
          format: uuid
        companyId:
          type: string
          description: ID of the company
          format: uuid
        contractId:
          type: string
          description: ID of the contract, if this is invoice is linked to a contract
          format: uuid
          nullable: true
        companyEntityId:
          type: string
          description: ID of the entity
          format: uuid
          nullable: true
        amount:
          type: integer
          description: >-
            Total invoice amount in smallest denomination, with discounts and
            tax applied
          format: int64
        paymentType:
          type: string
          description: >-
            Payment type for the invoice


            - `AIRWALLEX` - Payment via Airwallex. A payment link will be
            displayed on the invoice

            - `BANK_TRANSFER` - Payment via bank transfer. Bank information will
            be displayed on the invoice

            - `DIRECT_DEBIT` - Payment via direct debit. A notice that the
            amount will be collected automatically will be displayed on the
            invoice

            - `STRIPE` - Payment via Stripe. A payment link will be sent to the
            customer


            ⚠️ This enum is not exhaustive; new values may be added in the
            future.
          nullable: true
          deprecated: false
          enum:
            - AIRWALLEX
            - BANK_TRANSFER
            - DIRECT_DEBIT
            - STRIPE
        payeeBankAccountId:
          type: string
          description: ID of the bank account where money should be sent to
          format: uuid
          nullable: true
        invoiceDate:
          type: string
          description: Date the invoice was issued
          format: date
          nullable: true
        dueDate:
          type: string
          description: Date the invoice payment is due
          format: date
          nullable: true
        netTerms:
          type: integer
          description: >-
            Number of days from the invoice date to when the invoice is due.
            Updating this field will automatically set the invoice due date
          format: int32
          nullable: true
        customerId:
          type: string
          description: ID of the customer
          format: uuid
          nullable: true
        invoiceTemplateId:
          type: string
          description: ID of the invoice template
          format: uuid
          nullable: true
        invoiceTemplateAdditionalText:
          type: string
          description: >-
            Text that will added to the additional text section of the invoice
            template
          nullable: true
        invoiceNumber:
          type: string
          description: >-
            Invoice number. This number is guaranteed to be unique and
            sequential per entity.

            By default Light will generate this number when the invoice is
            opened, but you can provide your own custom number when creating or
            updating a draft invoice
          nullable: true
        state:
          type: string
          description: >-
            The invoice state


            - `DRAFT` - The invoice is in draft and can be modified. Next valid
            states are OPEN_IN_PROGRESS or ARCHIVED

            - `OPEN_IN_PROGRESS` - The invoice is being opened. Next valid state
            is OPEN or DRAFT

            - `OPEN` - The invoice is open. Next valid states are
            PAYMENT_PENDING, PARTIALLY_PAID, PAID or ARCHIVED

            - `PAYMENT_PENDING` - The payment was initiated by Light and is
            waiting to be collected. Next valid state is PAID

            - `PARTIALLY_PAID` - The invoice is partially paid. Next valid state
            is PAID

            - `PAID` - The invoice is fully paid

            - `ARCHIVED` - The invoice is archived and cannot be modified


            ⚠️ This enum is not exhaustive; new values may be added in the
            future.
          nullable: false
          deprecated: false
          enum:
            - DRAFT
            - OPEN_IN_PROGRESS
            - OPEN
            - PAYMENT_PENDING
            - PARTIALLY_PAID
            - PAID
            - ARCHIVED
        openedAt:
          type: string
          description: Timestamp when the invoice was opened
          format: date-time
          nullable: true
        poNumber:
          type: string
          description: Purchase order number
          nullable: true
        reference:
          type: string
          description: >-
            Reference number for cross-referencing with procurement and
            invoicing workflows
          nullable: true
        description:
          type: string
          description: Description of the invoice
          nullable: true
        currency:
          type: string
          example: USD
        taxEngineName:
          type: string
          description: >-
            Name of the tax engine to be used


            - `AVATAX` - Avalara AvaTax will be used for tax calculations

            - `LIGHT` - Light built-in tax engine will be used for tax
            calculations

            - `SPHERE` - Sphere tax engine will be used for tax calculations


            ⚠️ This enum is not exhaustive; new values may be added in the
            future.
          nullable: false
          deprecated: false
          enum:
            - AVATAX
            - LIGHT
            - SPHERE
        areLinesWithTax:
          type: boolean
          description: >-
            Whether the invoice 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
        localCurrencyFxRate:
          type: number
          description: >-
            Custom foreign exchange rate for the ledger's local currency. If not
            provided Light uses official ECB rates
          nullable: true
        groupCurrencyFxRate:
          type: number
          description: >-
            Custom foreign exchange rate for the ledger's group currency. If not
            provided Light uses official ECB rates
          nullable: true
        lines:
          type: array
          description: >-
            List of invoice line items. This is only returned when fetching a
            single invoice by id
          nullable: true
          items:
            $ref: '#/components/schemas/ExternalInvoiceReceivableLineV1Model'
        customProperties:
          type: array
          description: List of custom properties associated with the invoice
          nullable: true
          items:
            $ref: '#/components/schemas/ExternalCustomPropertyV1Model'
        createdAt:
          type: string
          description: Timestamp when the invoice was created
          format: date-time
        updatedAt:
          type: string
          description: Timestamp when the invoice was last updated
          format: date-time
        updatedBy:
          type: string
          description: ID of the user who last updated the invoice
          format: uuid
          nullable: true
        failureContext:
          $ref: '#/components/schemas/ExternalUiClientExceptionV1Model'
    ExternalInvoiceReceivableLineV1Model:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object
          format: uuid
        companyId:
          type: string
          description: ID of the company
          format: uuid
        invoiceReceivableId:
          type: string
          description: ID of the invoice receivable this line belongs to
          format: uuid
        productId:
          type: string
          description: ID of the product
          format: uuid
        quantity:
          type: number
          description: Quantity of the product
        taxCodeId:
          type: string
          description: ID of the tax code
          format: uuid
          nullable: true
        accountId:
          type: string
          description: ID of the ledger account
          format: uuid
          nullable: true
        discount:
          $ref: '#/components/schemas/ExternalAccountReceivableLineDiscountV1Model'
        discountAmount:
          type: integer
          description: Discount amount in smallest denomination
          format: int64
          nullable: true
        netAmount:
          type: integer
          description: Net amount in smallest denomination after discount but before tax
          format: int64
          nullable: true
        taxAmount:
          type: integer
          description: Tax amount in smallest denomination
          format: int64
          nullable: true
        avataxCode:
          type: string
          description: Avalara tax code. Used when the invoice tax engine is `AVATAX`
          nullable: true
        billingStart:
          type: string
          description: Start of the billing period
          format: date
          nullable: true
        billingEnd:
          type: string
          description: End of the billing period
          format: date
          nullable: true
        priceOverwrite:
          type: integer
          description: >-
            Custom product price in smallest denomination. This overrides the
            default product's price
          format: int64
          nullable: true
        productNameOverwrite:
          type: string
          description: Custom product name. This overrides the default product's name
          nullable: true
        createdAt:
          type: string
          description: Timestamp when the line was created
          format: date-time
        updatedAt:
          type: string
          description: Timestamp when the line 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
        customProperties:
          type: array
          description: List of custom properties associated with the line
          nullable: true
          items:
            $ref: '#/components/schemas/ExternalCustomPropertyV1Model'
    ExternalCustomPropertyV1Model:
      type: object
      properties:
        groupId:
          type: string
          description: ID of the custom property group
          format: uuid
        groupInternalName:
          type: string
          description: Internal name of the custom property group
        values:
          type: array
          description: >-
            List of values. Note that this will be a single value unless the
            group input type supports multiple values
          items:
            $ref: '#/components/schemas/ExternalCustomPropertyValueV1Model'
      description: Custom properties set on the vendor.
      nullable: true
    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
    ExternalAccountReceivableLineDiscountV1Model:
      type: object
      properties:
        type:
          type: string
          description: >-
            ⚠️ This enum is not exhaustive; new values may be added in the
            future.
          enum:
            - PERCENTAGE
            - AMOUNT
      description: Discount to apply to this line (can be percentage or amount-based)
      nullable: true
      discriminator:
        propertyName: type
    ExternalCustomPropertyValueV1Model:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object
          format: uuid
        groupId:
          type: string
          description: ID of the custom property group
          format: uuid
        groupInternalName:
          type: string
          description: Internal name of the custom property group
        companyId:
          type: string
          description: ID of the company
          format: uuid
        internalName:
          type: string
          description: Internal name of the custom property value
        label:
          type: string
          description: Label of the custom property value
        context:
          type: string
          description: Context/description of the custom property value
          nullable: true
        createdAt:
          type: string
          description: Timestamp when the custom property value was created
          format: date-time
        updatedAt:
          type: string
          description: Timestamp when the custom property value was last updated
          format: date-time
      description: >-
        List of values. Note that this will be a single value unless the group
        input type supports multiple values
    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
  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

````