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

# Add Line Item

> Appends a single line item to a draft invoice and recalculates totals.



## OpenAPI

````yaml https://app.dimepayments.com/openapi.yaml post /api/invoice/line-item/add
openapi: 3.0.3
info:
  title: Dime Payments API Documentation
  description: >-
    A simple, basic API for managing Merchants through Dime Payments. JSON based
    REST API
  version: 1.0.0
servers:
  - url: https://app.dimepayments.com
security:
  - default: []
tags:
  - name: Merchant management
    description: ''
  - name: Transaction management
    description: >-

      APIs for managing transactions.  Depending on API KEY permissions, one
      should be able to

      charge credit cards, ACH, Google/Apple Pay wallets along with other
      functions.
  - name: Addresses
    description: |-

      APIs for managing customer addresses
  - name: Customer management
    description: >-

      APIs for managing customers.  Depending on API KEY permissions, one should
      be able to

      list, create, update, and delete customers along with several other
      customer specific requests.
  - name: Deposit management
    description: ''
  - name: Invoice management
    description: >-

      APIs for managing invoices. Depending on API KEY permissions, one should
      be

      able to list, create, update, delete, and send invoices, manage their line

      items, and manage recurring-invoice schedules. Every request is scoped to
      a

      single Merchant via the required `data.sid`.
  - name: Payment Method management
    description: >-

      APIs for managing payment methods associated with customers.  Depending on
      API KEY permissions, one should be able to

      list, show, create, update, and delete payment methods.
  - name: Recurring Payments management
    description: >-

      APIs for managing recurring payments.  Depending on API KEY permissions,
      one should be able to

      create, edit, pause, cancel along with other functions.
  - name: Zapier
    description: >-

      APIs for use through Zapier.  Depending on API KEY permissions, one should
      be able to

      see customers and transactions data.
paths:
  /api/invoice/line-item/add:
    post:
      tags:
        - Invoice management
      summary: Add Line Item
      description: Appends a single line item to a draft invoice and recalculates totals.
      operationId: addLineItem
      parameters: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  description: ''
                  example:
                    sid: 12345
                  properties:
                    sid:
                      type: integer
                      description: The SID of the Merchant.
                      example: 12345
                    invoice_id:
                      type: integer
                      description: The id of the draft invoice.
                      example: 42
                    item_id:
                      type: integer
                      description: The Merchant item id this line is sourced from.
                      example: 5
                    name:
                      type: string
                      description: The line name.
                      example: Consulting
                    description:
                      type: string
                      description: An optional line description.
                      example: 2 hours
                    quantity:
                      type: number
                      description: The quantity.
                      example: 2
                    unit_price:
                      type: number
                      description: The unit price in dollars.
                      example: 125
                  required:
                    - sid
                    - invoice_id
                    - item_id
                    - name
                    - quantity
                    - unit_price
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: null
                    token: ZZtkx6kulWXLhTL2zXeoZX4Y8diKPpDCiaeixPS1
                    invoice_number: INV-93082
                    status: draft
                    payment_terms: net_15
                    issue_date: '2026-07-20'
                    due_date: '2026-08-04'
                    is_overdue: false
                    subtotal: 0
                    total: 0
                    amount_paid: 0
                    balance: 0
                    allow_partial_payment: true
                    thank_you_note: null
                    public_url: >-
                      http://app.dimepayments.com/invoice/ZZtkx6kulWXLhTL2zXeoZX4Y8diKPpDCiaeixPS1
                    customer:
                      id: 15127
                      name: Mina Bauch
                      email: okeefe.isidro@example.org
                    items: []
                    payments: []
                    events: []
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: null
                        nullable: true
                      token:
                        type: string
                        example: ZZtkx6kulWXLhTL2zXeoZX4Y8diKPpDCiaeixPS1
                      invoice_number:
                        type: string
                        example: INV-93082
                      status:
                        type: string
                        example: draft
                      payment_terms:
                        type: string
                        example: net_15
                      issue_date:
                        type: string
                        example: '2026-07-20'
                      due_date:
                        type: string
                        example: '2026-08-04'
                      is_overdue:
                        type: boolean
                        example: false
                      subtotal:
                        type: integer
                        example: 0
                      total:
                        type: integer
                        example: 0
                      amount_paid:
                        type: integer
                        example: 0
                      balance:
                        type: integer
                        example: 0
                      allow_partial_payment:
                        type: boolean
                        example: true
                      thank_you_note:
                        type: string
                        example: null
                        nullable: true
                      public_url:
                        type: string
                        example: >-
                          http://app.dimepayments.com/invoice/ZZtkx6kulWXLhTL2zXeoZX4Y8diKPpDCiaeixPS1
                      customer:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 15127
                          name:
                            type: string
                            example: Mina Bauch
                          email:
                            type: string
                            example: okeefe.isidro@example.org
                      items:
                        type: array
                        example: []
                      payments:
                        type: array
                        example: []
                      events:
                        type: array
                        example: []
        '400':
          description: Failed validation
          content:
            application/json:
              schema:
                type: object
                example:
                  errors:
                    data.item_id:
                      - The selected data.item id is invalid.
                properties:
                  errors:
                    type: object
                    properties:
                      data.item_id:
                        type: array
                        example:
                          - The selected data.item id is invalid.
                        items:
                          type: string
        '401':
          description: Token unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: Permission Denied.
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Permission Denied.
        '404':
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  - description: Invalid sid
                    type: object
                    example:
                      data:
                        message: No such Merchant
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: No such Merchant
                  - description: Invoice not found
                    type: object
                    example:
                      data:
                        message: Invoice not found
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: Invoice not found
        '422':
          description: Invoice locked
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: Only draft invoices can be edited.
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Only draft invoices can be edited.
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: >-
        You can retrieve your token by visiting your dashboard and clicking
        <b>Generate API token under your profile in top right</b>.

````