Update contract line
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
-
contractIdstring · uuidrequired -
lineIdstring · uuidrequired
Headers
-
X-Idempotency-Keystring
Request body
application/json;charset=UTF-8
-
productIdstring · uuidID 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
-
billingStartstring · dateDate when billing starts for this line
-
accountIdstring · uuidID of the ledger account for this line
-
taxCodeIdstring · uuidID of the tax code to apply to this line
-
customPropertiesarray of objectList of custom properties to set on the contract or line
-
groupIdstring · uuidID of the custom property group.
-
valueIdsarray of string · uuidIDs 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 emptyinlineValues) to clear the group.SINGLE_SELECTandMULTI_SELECTgroups accept nothing else. See Custom properties on writes. -
inlineValuesarray of stringInline 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,BOOLEANandDATEgroups, as strings (yyyy-MM-ddfor dates). Rejected on select groups withCUSTOM_PROPERTY_VALUE_TYPE_MISMATCH. See Custom properties on writes. -
attachmentIdsarray of string · uuidIDs 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.
-
-
billingRecurrencestringBilling frequency for this line
ONE_TIME- The product is billed onceMONTHLY- The product is billed every monthQUARTERLY- The product is billed every three monthsHALF_YEARLY- The product is billed every six monthsYEARLY- The product is billed every year
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
ONE_TIMEMONTHLYQUARTERLYHALF_YEARLYYEARLY -
billingEndstring · dateLast day this line is billed for (inclusive)
-
discountobjectDiscount 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
-
startDatestring · date -
endDatestring · date -
typestring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
PERCENTAGEAMOUNT
-
-
priceOverwriteinteger · int64Total 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 as200, not20.nullclears it and returns the line to the product's price. -
productNameOverwritestringCustom product name override
-
quantitynumberQuantity of the product
-
amortizationTemplateIdstring · uuidID of the amortization template
-
amortizationStartDatestring · dateStart date for amortization
-
amortizationEndDatestring · dateEnd date for amortization
Response
-
idstring · uuidUnique identifier for the object
-
companyIdstring · uuidID of the company
-
contractIdstring · uuidID of the contract this line belongs to
-
productIdstring · uuidID of the product
-
billingStartstring · dateDate when billing starts for this line
-
billingEndstring · dateLast day this line is billed for (inclusive)
-
billingRecurrencestringBilling frequency for this line
ONE_TIME- The product is billed onceMONTHLY- The product is billed every monthQUARTERLY- The product is billed every three monthsHALF_YEARLY- The product is billed every six monthsYEARLY- The product is billed every year
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
ONE_TIMEMONTHLYQUARTERLYHALF_YEARLYYEARLY -
accountIdstring · uuidID of the account for bookkeeping
-
taxCodeIdstring · uuidID of the tax code
-
avataxCodestringAvalara tax code
-
discountobjectDiscount 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
-
startDatestring · date -
endDatestring · date -
typestring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
PERCENTAGEAMOUNT
-
-
quantitynumberQuantity of the product
-
priceOverwriteinteger · int64Total 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 byquantity.nullmeans 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,quantityanddiscount. -
productNameOverwritestringCustom product name override
-
amortizationTemplateIdstring · uuidID of the amortization template
-
amortizationStartDatestring · dateStart date for amortization
-
amortizationEndDatestring · dateEnd date for amortization
-
aiValueSuggestionsarray of objectAI-generated suggestions for this line
-
fieldstring -
fieldValuesarray of string -
reasoningstring
-
-
customPropertiesarray of objectList of custom properties associated with the line
-
groupIdstring · uuidID of the custom property group
-
groupInternalNamestringInternal name of the custom property group
-
valuesarray of objectList of values. Note that this will be a single value unless the group input type supports multiple values
-
idstring · uuidUnique identifier for the object
-
groupIdstring · uuidID of the custom property group
-
groupInternalNamestringInternal name of the custom property group
-
companyIdstring · uuidID of the company
-
internalNamestringInternal name of the custom property value
-
labelstringLabel of the custom property value
-
contextstringContext/description of the custom property value
-
createdAtstring · date-timeTimestamp when the custom property value was created
-
updatedAtstring · date-timeTimestamp when the custom property value was last updated
-
attachmentobjectFile assigned to an ATTACHMENT property. Null for other property types.
-
idstring · uuidAttachment ID. Use GET /v1/attachments/{attachmentId}/document to download the file.
-
fileNamestring -
contentTypestring
-
-
-
-
createdAtstring · date-timeTimestamp when the line was created
-
updatedAtstring · date-timeTimestamp when the line was last updated