New Light partners with Amesto GlobalLight partners with Amesto Global Read the announcement

Update contract line

PATCH
https://api.light.inc/v1/contracts/{contractId}/lines/{lineId}

Updates a contract line item

Permission: contracts:update (AR_CLERK, COMPANY_ADMIN, CONTROLLER)

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

  • contractId string · uuidrequired

  • lineId string · uuidrequired

Headers

  • X-Idempotency-Key string

Request body

application/json;charset=UTF-8

  • productId string · uuid

    ID of the product. Changing the product removes the line's price overwrite and takes the new product's billing frequency, unless the same request sets them

  • billingStart string · date

    Date when billing starts for this line

  • accountId string · uuid

    ID of the ledger account for this line

  • taxCodeId string · uuid

    ID of the tax code to apply to this line

  • customProperties array of object

    List of custom properties to set on the contract 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.

      Note

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

      Note

      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.

    • attachmentIds array of string · uuid

      IDs of attachments to assign to an ATTACHMENT property on an existing vendor. Send valueIds as an empty list. Only one active attachment belonging to the vendor can be assigned per group. Clear the current file before assigning another. Create the vendor first, request POST /v1/attachments/upload-url with its resourceId, upload the file to the returned URL, then POST /v1/attachments with documentKey set to the returned key. Use the created attachment's id here in PUT or PATCH /v1/vendors/{vendorId}. A PATCH that sends only customProperties and changes only their files works in every vendor status. customProperties replaces the whole set, so send the vendor's other properties as they are, by valueIds. A PUT, or a PATCH that changes anything else, returns 400 while the vendor is IN_REVIEW, ONBOARDING or INACTIVE. An empty list clears the assignment without archiving the file.

  • billingRecurrence string

    Billing frequency for this line

    • ONE_TIME - The product is billed once
    • MONTHLY - The product is billed every month
    • QUARTERLY - The product is billed every three months
    • HALF_YEARLY - The product is billed every six months
    • YEARLY - The product is billed every year

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

    One of ONE_TIME MONTHLY QUARTERLY HALF_YEARLY YEARLY

  • billingEnd string · date

    Last day this line is billed for (inclusive)

  • discount object

    Discount to apply to this line (can be percentage or amount-based). An amount-based discount is taken off the line total in every billing period. It is not per unit and not a one-off over the term

    • startDate string · date

    • endDate string · date

    • type string

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

      One of PERCENTAGE AMOUNT

  • priceOverwrite integer · int64

    Total amount of the line per billing period in the smallest currency unit, for the whole quantity. This is not a unit price: 10 seats at 100.00 each is 100000. Leave empty to use the product's price times the quantity. Examples of the smallest unit: GBP 42.15 = 4215, JPY 12345 = 12345, BHD 7.321 = 7321

    Note

    As on create: the line total before discount, in the smallest denomination, standing in for quantity × the product's price — not a unit price, so send 10 units at $0.20 each as 200, not 20. null clears it and returns the line to the product's price.

  • productNameOverwrite string

    Custom product name override

  • quantity number

    Quantity of the product

  • amortizationTemplateId string · uuid

    ID of the amortization template

  • amortizationStartDate string · date

    Start date for amortization

  • amortizationEndDate string · date

    End date for amortization

Response

  • id string · uuid

    Unique identifier for the object

  • companyId string · uuid

    ID of the company

  • contractId string · uuid

    ID of the contract this line belongs to

  • productId string · uuid

    ID of the product

  • billingStart string · date

    Date when billing starts for this line

  • billingEnd string · date

    Last day this line is billed for (inclusive)

  • billingRecurrence string

    Billing frequency for this line

    • ONE_TIME - The product is billed once
    • MONTHLY - The product is billed every month
    • QUARTERLY - The product is billed every three months
    • HALF_YEARLY - The product is billed every six months
    • YEARLY - The product is billed every year

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

    One of ONE_TIME MONTHLY QUARTERLY HALF_YEARLY YEARLY

  • accountId string · uuid

    ID of the account for bookkeeping

  • taxCodeId string · uuid

    ID of the tax code

  • avataxCode string

    Avalara tax code

  • discount object

    Discount to apply to this line (can be percentage or amount-based). An amount-based discount is taken off the line total in every billing period. It is not per unit and not a one-off over the term

    • startDate string · date

    • endDate string · date

    • type string

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

      One of PERCENTAGE AMOUNT

  • quantity number

    Quantity of the product

  • priceOverwrite integer · int64

    Total amount of the line per billing period in the smallest currency unit, for the whole quantity. This is not a unit price: 10 seats at 100.00 each is 100000. Leave empty to use the product's price times the quantity. Examples of the smallest unit: GBP 42.15 = 4215, JPY 12345 = 12345, BHD 7.321 = 7321

    Note

    The line total before discount, in the smallest denomination — not a unit price. It stands in for quantity × the product's price, and the unit price Light displays is this figure divided by quantity. null means the line is priced from the product. The model carries no computed amounts (no net, discount or tax figure), so a line's arithmetic is this field, quantity and discount.

  • productNameOverwrite string

    Custom product name override

  • amortizationTemplateId string · uuid

    ID of the amortization template

  • amortizationStartDate string · date

    Start date for amortization

  • amortizationEndDate string · date

    End date for amortization

  • aiValueSuggestions array of object

    AI-generated suggestions for this line

    • field string

    • fieldValues array of string

    • reasoning string

  • 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

      • attachment object

        File assigned to an ATTACHMENT property. Null for other property types.

        • id string · uuid

          Attachment ID. Use GET /v1/attachments/{attachmentId}/document to download the file.

        • fileName string

        • contentType string

  • createdAt string · date-time

    Timestamp when the line was created

  • updatedAt string · date-time

    Timestamp when the line was last updated