> ## 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 contract line

> Creates a new contract line item



## OpenAPI

````yaml /openapi-public.json post /v1/contracts/{contractId}/lines
openapi: 3.0.1
info:
  title: Light API
  version: 1.0.0
servers: []
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /v1/contracts/{contractId}/lines:
    post:
      tags:
        - v1 - Contracts
      summary: Create contract line
      description: Creates a new contract line item
      operationId: createContractLine
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/ExternalCreateContractLineRequestV1Model'
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalContractLineV1Model'
components:
  schemas:
    ExternalCreateContractLineRequestV1Model:
      type: object
      properties:
        productId:
          type: string
          description: ID of the product
          format: uuid
        billingStart:
          type: string
          description: Date when billing starts for this line
          format: date
          nullable: true
        billingEnd:
          type: string
          description: Date when billing ends for this line
          format: date
          nullable: true
        billingRecurrence:
          type: string
          description: >-
            Billing frequency for this line


            - `ONE_TIME` - The product is billed once

            - `MONTHLY` - The product is billed every month

            - `QUARTERLY` - The product is billed every three months

            - `HALF_YEARLY` - The product is billed every six months

            - `YEARLY` - The product is billed every year


            ⚠️ This enum is not exhaustive; new values may be added in the
            future.
          nullable: true
          deprecated: false
          enum:
            - ONE_TIME
            - MONTHLY
            - QUARTERLY
            - HALF_YEARLY
            - YEARLY
        accountId:
          type: string
          description: ID of the ledger account for this line
          format: uuid
          nullable: true
        taxCodeId:
          type: string
          description: ID of the tax code to apply to this line
          format: uuid
          nullable: true
        avataxCode:
          type: string
          description: Avalara tax code. Used when the contract tax engine is AVATAX
          nullable: true
        discount:
          $ref: '#/components/schemas/ExternalContractLineDiscountV1Model'
        quantity:
          type: number
          description: Quantity of the product
          nullable: true
        priceOverwrite:
          type: integer
          description: Custom price override in cents
          format: int64
          nullable: true
        productNameOverwrite:
          type: string
          description: Custom product name override
          nullable: true
        customProperties:
          type: array
          description: List of custom properties to set on the contract or line
          nullable: true
          items:
            $ref: '#/components/schemas/ExternalSetCustomPropertyRequestV1Model'
        amortizationTemplateId:
          type: string
          description: ID of the amortization template
          format: uuid
          nullable: true
        amortizationStartDate:
          type: string
          description: Start date for amortization
          format: date
          nullable: true
        amortizationEndDate:
          type: string
          description: End date for amortization
          format: date
          nullable: true
    ExternalContractLineV1Model:
      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 this line belongs to
          format: uuid
        productId:
          type: string
          description: ID of the product
          format: uuid
        billingStart:
          type: string
          description: Date when billing starts for this line
          format: date
          nullable: true
        billingEnd:
          type: string
          description: Date when billing ends for this line
          format: date
          nullable: true
        billingRecurrence:
          type: string
          description: >-
            Billing frequency for this line


            - `ONE_TIME` - The product is billed once

            - `MONTHLY` - The product is billed every month

            - `QUARTERLY` - The product is billed every three months

            - `HALF_YEARLY` - The product is billed every six months

            - `YEARLY` - The product is billed every year


            ⚠️ This enum is not exhaustive; new values may be added in the
            future.
          nullable: false
          deprecated: false
          enum:
            - ONE_TIME
            - MONTHLY
            - QUARTERLY
            - HALF_YEARLY
            - YEARLY
        accountId:
          type: string
          description: ID of the account for bookkeeping
          format: uuid
          nullable: true
        taxCodeId:
          type: string
          description: ID of the tax code
          format: uuid
          nullable: true
        avataxCode:
          type: string
          description: Avalara tax code
          nullable: true
        discount:
          $ref: '#/components/schemas/ExternalContractLineDiscountV1Model'
        quantity:
          type: number
          description: Quantity of the product
          nullable: true
        priceOverwrite:
          type: integer
          description: Custom price override in cents
          format: int64
          nullable: true
        productNameOverwrite:
          type: string
          description: Custom product name override
          nullable: true
        amortizationTemplateId:
          type: string
          description: ID of the amortization template
          format: uuid
          nullable: true
        amortizationStartDate:
          type: string
          description: Start date for amortization
          format: date
          nullable: true
        amortizationEndDate:
          type: string
          description: End date for amortization
          format: date
          nullable: true
        aiValueSuggestions:
          type: array
          description: AI-generated suggestions for this line
          nullable: true
          items:
            $ref: '#/components/schemas/ExternalAiValueSuggestionV1Model'
        customProperties:
          type: array
          description: List of custom properties associated with the line
          nullable: true
          items:
            $ref: '#/components/schemas/ExternalCustomPropertyV1Model'
        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
    ExternalContractLineDiscountV1Model:
      type: object
      properties:
        startDate:
          type: string
          format: date
        endDate:
          type: string
          format: date
        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
    ExternalAiValueSuggestionV1Model:
      type: object
      properties:
        field:
          type: string
        fieldValues:
          type: array
          items:
            type: string
        reasoning:
          type: string
      description: >-
        AI-generated suggestions for line item values (e.g. account, cost
        center, tax code).
      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

````