Create contract line
POST
https://api.light.inc/v1/contracts/{contractId}/lines
Creates a new contract line item
Only while the contract is DRAFT (CONTRACT_CANNOT_BE_MODIFIED). A line discount carries its own startDate and endDate window in addition to type and value.
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
Headers
-
X-Idempotency-Keystring
Request body
application/json;charset=UTF-8
-
productIdstring · uuidID of the product
-
billingStartstring · dateDate when billing starts for this line
-
billingEndstring · dateDate when billing ends for this line
-
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 ledger account for this line
-
taxCodeIdstring · uuidID of the tax code to apply to this line
-
avataxCodestringAvalara tax code. Used when the contract tax engine is AVATAX
-
discountobjectDiscount to apply to this line (can be percentage or amount-based)
-
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 · int64Custom price override in cents
The line total before discount, in the smallest denomination — not a unit price. It replaces
quantity× the product's price, and the unit price Light displays is this figure divided byquantity: 10 units at $0.20 each is200withquantity: 10, while20prices the whole line at $0.20. Any linediscountthen applies on top, so20with a 50% discount leaves the line at $0.10. Required when the product has no price in the contract's currency. -
productNameOverwritestringCustom product name override
-
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.
Catalogue 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.
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.
-
-
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 · dateDate when billing ends for this line
-
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)
-
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 · int64Custom price override in cents
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
-
-
-
createdAtstring · date-timeTimestamp when the line was created
-
updatedAtstring · date-timeTimestamp when the line was last updated