> ## Documentation Index
> Fetch the complete documentation index at: https://docs.justpaid.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Line Item Create Api

> Creates a new line item on an invoice.



## OpenAPI

````yaml post /api/v1/invoice/{invoice_uuid}/line-items
openapi: 3.1.0
info:
  title: NinjaAPI
  version: 1.0.0
  description: ''
servers:
  - url: https://api.justpaid.io
security: []
paths:
  /api/v1/invoice/{invoice_uuid}/line-items:
    post:
      summary: Line Item Create Api
      description: Creates a new line item on an invoice.
      operationId: loopfour_backend_invoice_external_api_line_item_create_api
      parameters:
        - in: path
          name: invoice_uuid
          schema:
            title: Invoice Uuid
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LineItemCreateIn'
        required: true
      responses:
        '201':
          description: Line item created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceLineItemOut2'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                additionalProperties: true
                title: Response
                type: object
        '404':
          description: Invoice not found
          content:
            application/json:
              schema:
                additionalProperties: true
                title: Response
                type: object
      security:
        - HttpBearerAuth: []
components:
  schemas:
    LineItemCreateIn:
      description: Input schema for creating a line item.
      properties:
        name:
          description: Name of the line item
          example: Product A
          title: Name
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Additional details about the line item
          example: Detailed description of the product or service
          title: Description
        quantity:
          default: 1
          description: Quantity of units
          example: 2
          minimum: 1
          title: Quantity
          type: integer
        unit_price:
          description: Price per unit
          example: 100
          title: Unit Price
          type: number
        flat_fee:
          anyOf:
            - type: number
            - type: 'null'
          description: Fixed flat fee amount
          example: 10
          title: Flat Fee
        discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          description: Discount amount in currency
          example: 5
          title: Discount Amount
        discount_percent:
          anyOf:
            - maximum: 100
              minimum: 0
              type: number
            - type: 'null'
          description: Discount percentage (0-100)
          example: 10
          title: Discount Percent
        tax_rate:
          anyOf:
            - maximum: 100
              minimum: 0
              type: number
            - type: 'null'
          description: Tax rate percentage (0-100)
          example: 10
          title: Tax Rate
        tax_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Name of the tax applied
          example: Sales Tax
          title: Tax Name
        service_start_date:
          anyOf:
            - format: date
              type: string
            - type: 'null'
          description: Service period start date
          example: '2024-03-01'
          title: Service Start Date
        service_end_date:
          anyOf:
            - format: date
              type: string
            - type: 'null'
          description: Service period end date
          example: '2024-03-31'
          title: Service End Date
        display_order:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          description: Display order for line item
          title: Display Order
      required:
        - name
        - unit_price
      title: LineItemCreateIn
      type: object
    InvoiceLineItemOut2:
      description: Output schema for invoice line items with UUID for external API.
      properties:
        uuid:
          format: uuid
          title: Uuid
          type: string
        name:
          anyOf:
            - maxLength: 255
              type: string
            - type: 'null'
          title: Name
        unit_price:
          anyOf:
            - type: number
            - type: 'null'
          title: Unit Price
        quantity:
          anyOf:
            - type: integer
            - type: 'null'
          default: 1
          title: Quantity
        amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Amount
        currency:
          anyOf:
            - maxLength: 3
              type: string
            - type: 'null'
          default: USD
          title: Currency
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: The description of the line item
          title: Description
        flat_fee:
          anyOf:
            - type: number
            - type: 'null'
          description: Fixed flat fee added to the line item amount
          title: Flat Fee
        tax_rate:
          anyOf:
            - type: number
            - type: 'null'
          default: 0
          title: Tax Rate
        tax_amount:
          anyOf:
            - type: number
            - type: 'null'
          default: 0
          title: Tax Amount
        tax_name:
          anyOf:
            - maxLength: 255
              type: string
            - type: 'null'
          title: Tax Name
        discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount Amount
        discount_percent:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount Percent
        service_start_date:
          anyOf:
            - format: date
              type: string
            - type: 'null'
          description: The date the service starts for the item
          title: Service Start Date
        service_end_date:
          anyOf:
            - format: date
              type: string
            - type: 'null'
          description: The date the service ends for the item
          title: Service End Date
        display_order:
          anyOf:
            - type: integer
            - type: 'null'
          description: The order in which the line item will be displayed in the UI/pdf
          title: Display Order
      title: InvoiceLineItemOut2
      type: object
  securitySchemes:
    HttpBearerAuth:
      type: http
      scheme: bearer

````