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

# Create line

> Creates a new invoice line item



## OpenAPI

````yaml /openapi-public.json post /v1/invoice-receivables/{invoiceReceivableId}/lines
openapi: 3.0.1
info:
  title: Light API
  version: 1.0.0
servers: []
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /v1/invoice-receivables/{invoiceReceivableId}/lines:
    post:
      tags:
        - v1 - Invoice Receivables
      summary: Create line
      description: Creates a new invoice line item
      operationId: createInvoiceLine
      parameters:
        - name: invoiceReceivableId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: >-
                #/components/schemas/ExternalCreateInvoiceReceivableLineRequestV1Model
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalInvoiceReceivableLineV1Model'
components:
  schemas:
    ExternalCreateInvoiceReceivableLineRequestV1Model:
      type: object
      properties:
        productId:
          type: string
          description: ID of the product
          format: uuid
        quantity:
          type: number
          description: Quantity of the product
          default: 1
        taxCodeId:
          type: string
          description: ID of the tax code to apply to this line
          format: uuid
          nullable: true
        accountId:
          type: string
          description: ID of the ledger account for this line
          format: uuid
          nullable: true
        discount:
          $ref: '#/components/schemas/ExternalAccountReceivableLineDiscountV1Model'
        priceOverwrite:
          type: integer
          description: >-
            Price overwrite in smallest denomination. If not provided, the
            product's default price will be used
          format: int64
          nullable: true
        productNameOverwrite:
          type: string
          description: >-
            Product name overwrite. If not provided, the product's default name
            will be used
          nullable: true
        taxAmountOverwrite:
          type: integer
          description: >-
            Tax amount override in smallest denomination. Bypasses tax
            calculation and sets the exact tax amount for this line.


            Requirements: The line must have a valid amount (product price or
            priceOverwrite must be set).


            The taxAmount field in the response will reflect this override
            value.


            Amounts use smallest denomination. Examples: GBP 42.15 = 4215, JPY
            12345 = 12345, BHD 7.321 = 7321.
          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 for this line
          format: date
          nullable: true
        billingEnd:
          type: string
          description: End of the billing period for this line
          format: date
          nullable: true
        accrualTemplateId:
          type: string
          description: ID of the accrual/amortization template to apply to this line
          format: uuid
          nullable: true
        accrualStartDate:
          type: string
          description: Start date for accrual/amortization
          format: date
          nullable: true
        accrualEndDate:
          type: string
          description: End date for accrual/amortization
          format: date
          nullable: true
        customProperties:
          type: array
          description: List of custom properties to set on the invoice or line
          nullable: true
          items:
            $ref: '#/components/schemas/ExternalSetCustomPropertyRequestV1Model'
    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'
    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
    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
    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
    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
  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

````