Light APIv1.0.0

API / Reference / Invoice Receivables

Update invoice line

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

Updates an invoice line item

Only while the invoice is DRAFT. null clears accountId, taxCodeId, discount, priceOverwrite, productNameOverwrite, avataxCode, billingStart, billingEnd and the accrual fields, but leaves productId, quantity and taxAmountOverwrite unchanged. Changing productId resets priceOverwrite to the new product's price unless you send one in the same request. taxAmountOverwrite is not persisted: a later update that changes quantity, priceOverwrite, discount or productId without it recalculates tax from the tax code. A discount that would make the line negative is silently dropped.

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

  • lineId string · uuidrequired

Request body

application/json;charset=UTF-8

  • productId string · uuid

    ID of the product

  • quantity number

    Quantity of the product

  • accountId string · uuid

    ID of the ledger account for this line

  • taxCodeId string · uuid

    ID of the tax code to apply to 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.

    Applied once and not stored. Re-send it with any later update that changes quantity, priceOverwrite, discount or productId, or the tax is recalculated from the tax code.

  • 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

  • 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.

      Catalogue value ids for this group. Required; send [] (with an empty inlineValues) to clear the group. SINGLE_SELECT and MULTI_SELECT groups accept nothing else. See Custom properties on writes.

    • 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.

      Literal values for TEXT, NUMERIC, BOOLEAN and DATE groups, as strings (yyyy-MM-dd for dates). Rejected on select groups with CUSTOM_PROPERTY_VALUE_TYPE_MISMATCH. See Custom properties on writes.

  • 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

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)

    Discount applied to the line, by percentage or by amount.

    • 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

    Signed: credit-side lines are positive, debit-side lines (a negative priceOverwrite) are negative. discountAmount is unsigned.

  • taxAmount integer · int64

    Tax amount in smallest denomination

    Signed the same way as netAmount: negative on a debit-side line.

  • 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