> ## 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 customer credit line

> Creates a new line for the given customer credit



## OpenAPI

````yaml /openapi-public.json post /v1/customer-credits/{customerCreditId}/lines
openapi: 3.0.1
info:
  title: Light API
  version: 1.0.0
servers: []
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /v1/customer-credits/{customerCreditId}/lines:
    post:
      tags:
        - v1 - Customer Credits
      summary: Create customer credit line
      description: Creates a new line for the given customer credit
      operationId: createCustomerCreditLine
      parameters:
        - name: customerCreditId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: >-
                #/components/schemas/ExternalCreateCustomerCreditLineRequestV1Model
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalCustomerCreditLineV1Model'
components:
  schemas:
    ExternalCreateCustomerCreditLineRequestV1Model:
      type: object
      properties:
        productId:
          type: string
          description: ID of the product
          format: uuid
        quantity:
          type: number
          description: Quantity of the product
        netTransactionAmount:
          $ref: '#/components/schemas/DirectedAmount'
        grossTransactionAmount:
          $ref: '#/components/schemas/DirectedAmount'
        taxTransactionAmount:
          $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
        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
        customProperties:
          type: array
          description: List of custom properties associated with the line
          nullable: true
          items:
            $ref: '#/components/schemas/SetCustomPropertyRequestV1Model'
        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
    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
    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
    SetCustomPropertyRequestV1Model:
      type: object
      properties:
        groupId:
          type: string
          format: uuid
        valueIds:
          type: array
          items:
            type: string
            format: uuid
        inlineValues:
          type: array
          items:
            type: string
      description: List of custom properties to set on the vendor.
      nullable: true
  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

````