Light APIv1.0.0

API / Reference / Invoice Receivables

Create line

POST https://api.light.inc/v1/invoice-receivables/{invoiceReceivableId}/lines

Creates a new invoice line item

Authorization

Send one of these on every request. See Authentication for how to get credentials.

  • API key

    Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.

  • Bearer token

Path parameters

  • invoiceReceivableId string · uuidrequired

Request body

application/json;charset=UTF-8

  • productId string · uuid

    ID of the product

  • quantity number

    Quantity of the product

  • taxCodeId string · uuid

    ID of the tax code to apply to this line

  • accountId string · uuid

    ID of the ledger account for this line

  • discount object

    Discount to apply to this line (can be percentage or amount-based)

    • type string

      ⚠️ This enum is not exhaustive; new values may be added in the future.

      One of PERCENTAGE AMOUNT

  • priceOverwrite integer · int64

    Price overwrite in smallest denomination. If not provided, the product's default price will be used

  • productNameOverwrite string

    Product name overwrite. If not provided, the product's default name will be used

  • taxAmountOverwrite integer · int64

    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.

  • avataxCode string

    Avalara tax code. Used when the invoice tax engine is AVATAX

  • billingStart string · date

    Start of the billing period for this line

  • billingEnd string · date

    End of the billing period for this line

  • accrualTemplateId string · uuid

    ID of the accrual/amortization template to apply to this line

  • accrualStartDate string · date

    Start date for accrual/amortization

  • accrualEndDate string · date

    End date for accrual/amortization

  • customProperties array of object

    List of custom properties to set on the invoice or line

    • groupId string · uuid

      ID of the custom property group.

    • valueIds array of string · uuid

      IDs of the selected custom property values. It behaves as a PUT operation, so if empty the existing ones will be effectively deleted.

    • inlineValues array of string

      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.

Response

  • id string · uuid

    Unique identifier for the object

  • companyId string · uuid

    ID of the company

  • invoiceReceivableId string · uuid

    ID of the invoice receivable this line belongs to

  • productId string · uuid

    ID of the product

  • quantity number

    Quantity of the product

  • taxCodeId string · uuid

    ID of the tax code

  • accountId string · uuid

    ID of the ledger account

  • discount object

    Discount to apply to this line (can be percentage or amount-based)

    • type string

      ⚠️ This enum is not exhaustive; new values may be added in the future.

      One of PERCENTAGE AMOUNT

  • discountAmount integer · int64

    Discount amount in smallest denomination

  • netAmount integer · int64

    Net amount in smallest denomination after discount but before tax

  • taxAmount integer · int64

    Tax amount in smallest denomination

  • avataxCode string

    Avalara tax code. Used when the invoice tax engine is AVATAX

  • billingStart string · date

    Start of the billing period

  • billingEnd string · date

    End of the billing period

  • priceOverwrite integer · int64

    Custom product price in smallest denomination. This overrides the default product's price

  • productNameOverwrite string

    Custom product name. This overrides the default product's name

  • createdAt string · date-time

    Timestamp when the line was created

  • updatedAt string · date-time

    Timestamp when the line was last updated

  • accrualTemplateId string · uuid

    ID of the accrual template

  • accrualStartDate string · date

    Start date for accrual

  • accrualEndDate string · date

    End date for accrual

  • customProperties array of object

    List of custom properties associated with the line

    • groupId string · uuid

      ID of the custom property group

    • groupInternalName string

      Internal name of the custom property group

    • values array of object

      List of values. Note that this will be a single value unless the group input type supports multiple values

      • id string · uuid

        Unique identifier for the object

      • groupId string · uuid

        ID of the custom property group

      • groupInternalName string

        Internal name of the custom property group

      • companyId string · uuid

        ID of the company

      • internalName string

        Internal name of the custom property value

      • label string

        Label of the custom property value

      • context string

        Context/description of the custom property value

      • createdAt string · date-time

        Timestamp when the custom property value was created

      • updatedAt string · date-time

        Timestamp when the custom property value was last updated