Create contract
POST
https://api.light.inc/v1/contracts
Creates a new contract
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
Headers
-
X-Idempotency-Keystring
Request body
application/json;charset=UTF-8
-
companyEntityIdstring · uuidID of the company entity
-
startDatestring · dateContract start date
-
endDatestring · dateContract end date
-
invoiceTemplateIdstring · uuidID of the invoice template to use for generating invoices
-
currencystring -
estimatedAmountinteger · int64Estimated total amount for the contract in cents
-
renewalDatestring · dateDate when the contract should be renewed
-
paymentTypestringPayment type for invoices generated from this contract
AIRWALLEX- Payment via Airwallex. A payment link will be displayed on the invoiceBANK_TRANSFER- Payment via bank transfer. Bank information will be displayed on the invoiceDIRECT_DEBIT- Payment via direct debit. A notice that the amount will be collected automatically will be displayed on the invoiceSTRIPE- Payment via Stripe. A payment link will be sent to the customer
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
AIRWALLEXBANK_TRANSFERDIRECT_DEBITSTRIPE -
payeeBankAccountIdstring · uuidID of the bank account where payments should be sent
-
netTermsinteger · int32Number of days from invoice date to when payment is due. Defaults to 30
-
invoiceLeadDaysinteger · int32Number of days before the billing period start to date the invoice. Defaults to 0
-
billingStartstring · dateDate when billing should start for this contract
-
descriptionstringDescription of the contract
-
customerIdstring · uuidID of the customer
-
areLinesWithTaxbooleanWhether invoice line amounts include tax or tax is added on top. Defaults to true
-
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.
-
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.
-
-
linesarray of objectList of contract line items to create
-
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
-
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.
-
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.
-
-
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
-
startDatestring · dateContract start date
-
endDatestring · dateContract end date
-
activatedAtstring · date-timeTimestamp when the contract was activated/published
-
terminatedAtstring · date-timeTimestamp when the contract was terminated
-
terminationReasonstringReason for contract termination
-
terminationReasonTypestringCategorized reason for contract termination
FINISHED- Contract ran to its natural endOTHER- Terminated for another reason, described in terminationReasonRENEWED- Contract ended because it was renewed into a new contract
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
FINISHEDOTHERRENEWED -
renewalDatestring · dateDate when the contract should be renewed
-
companyEntityIdstring · uuidID of the entity
-
invoiceTemplateIdstring · uuidID of the invoice template to use for generating invoices
-
currencystring -
estimatedAmountinteger · int64Estimated total amount for the contract in cents
-
paymentTypestringPayment type for invoices generated from this contract
AIRWALLEX- Payment via Airwallex. A payment link will be displayed on the invoiceBANK_TRANSFER- Payment via bank transfer. Bank information will be displayed on the invoiceDIRECT_DEBIT- Payment via direct debit. A notice that the amount will be collected automatically will be displayed on the invoiceSTRIPE- Payment via Stripe. A payment link will be sent to the customer
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
AIRWALLEXBANK_TRANSFERDIRECT_DEBITSTRIPE -
payeeBankAccountIdstring · uuidID of the bank account where payments should be sent
-
billingStartstring · dateDate when billing should start for this contract
-
netTermsinteger · int32Number of days from invoice date to when payment is due
-
invoiceLeadDaysinteger · int32Number of days before billing period start to date the invoice
-
descriptionstringDescription of the contract
-
customerIdstring · uuidID of the customer
-
statestringCurrent state of the contract
CREATED- Contract has been createdDRAFT- Contract is in draft state and can be editedACTIVE- Contract is active and generating invoicesPENDING_TERMINATION- Contract has a scheduled terminationTERMINATED- Contract has been terminated
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
CREATEDDRAFTACTIVEPENDING_TERMINATIONTERMINATED -
areLinesWithTaxbooleanWhether invoice line amounts include tax or tax is added on top
-
linesarray of objectList of contract line items. Only returned when fetching a single contract by ID
-
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
-
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
-
-
taxEngineNamestringName of the tax engine to be used
AVATAX- Avalara AvaTax will be used for tax calculationsLIGHT- Light built-in tax engine will be used for tax calculationsSPHERE- Sphere tax engine will be used for tax calculations
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
AVATAXLIGHTSPHERE -
externalIdstringExternal identifier from an external system
-
externalSourcestringSource system if contract was synced from an external system
HUBSPOT- Contract synced from HubSpotSALESFORCE- Contract synced from Salesforce
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
HUBSPOTSALESFORCE -
customPropertiesarray of objectList of custom properties associated with the contract
-
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 contract was created
-
updatedAtstring · date-timeTimestamp when the contract was last updated