API / Reference / Credit Notes
Create credit note
POST
https://api.light.inc/v1/credit-notes
Creates a new credit note in draft status. The credit note can be created with or without line items. When documentNumber is provided, it is used for idempotency — retrying a create with the same documentNumber returns the existing credit note instead of creating a duplicate. The areLinesWithTax field controls whether line amounts include tax (true = gross, tax included) or exclude tax (false = net, tax added on top). A businessPartnerId (vendor) is required if the credit note will be linked to an invoice payable later. The posting date is automatically set to the documentDate.
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 entity
-
currencystring -
documentDatestring · dateDate when the credit note was issued
-
businessPartnerIdstring · uuidID of the vendor (required if the credit note will be linked to an invoice payable)
-
descriptionstringDescription of the credit note
-
amountinteger · int64Total credit note amount in cents
-
areLinesWithTaxbooleanWhether line amounts include tax. true = tax included (gross), false = tax added on top (net)
-
documentNumberstringUnique credit note number. When provided, it is also used for idempotency — retrying a create with the same documentNumber returns the existing credit note. If omitted, a number is generated automatically.
-
customPropertiesarray of objectList of custom properties
-
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 credit note line items
-
netTransactionAmountobject-
amountinteger · int64 -
dcSignstring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
DC
-
-
grossTransactionAmountobject-
amountinteger · int64 -
dcSignstring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
DC
-
-
taxTransactionAmountobject-
amountinteger · int64 -
dcSignstring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
DC
-
-
descriptionstringLine description
-
ledgerTaxIdstring · uuidID of the tax code
-
ledgerAccountIdstring · uuidID of the ledger account
-
customPropertiesarray of objectList of custom properties for this 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.
-
-
accrualTemplateIdstring · uuidID of the accrual template
-
accrualStartDatestring · dateStart date for accrual
-
accrualEndDatestring · dateEnd date for accrual
-
-
localCurrencyFxRateOverridenumberCustom FX rate for the ledger's local currency. If not provided, Light uses official ECB rates.
-
groupCurrencyFxRateOverridenumberCustom FX rate for the ledger's group currency. If not provided, Light uses official ECB rates.
Response
-
idstring · uuidUnique identifier for the object
-
companyIdstring · uuidID of the company
-
companyEntityIdstring · uuidID of the entity
-
amountinteger · int64Total credit note amount in cents
-
businessPartnerNamestringName of the vendor
-
businessPartnerIdstring · uuidID of the vendor
-
statusstringStatus of the credit note
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
DRAFTAPPROVAL_PENDINGAPPROVEDPOSTEDPARTIALLY_CLEAREDCLEAREDARCHIVED -
descriptionstringDescription of the credit note
-
currencystring -
postingDatestring · dateDate when the credit note should be posted to the ledger
-
documentDatestring · dateDate when the credit note was issued
-
valuationDatestring · dateDate used when applying foreign exchange rate
-
areLinesWithTaxbooleanWhether the credit note line amount is inclusive of tax or not. True means tax is already included in the line amount and will not be added on top, false means tax will be added on top of the line amount
-
linesarray of objectList of credit note line items
-
idstring · uuidUnique identifier for the object
-
companyIdstring · uuidID of the company
-
creditNoteIdstring · uuidID of the credit note this line belongs to
-
grossTransactionAmountobject-
amountinteger · int64 -
dcSignstring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
DC
-
-
netTransactionAmountobject-
amountinteger · int64 -
dcSignstring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
DC
-
-
descriptionstringDescription of the credit note line item
-
ledgerTaxIdstring · uuidID of the tax code
-
taxTransactionAmountobject-
amountinteger · int64 -
dcSignstring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
DC
-
-
ledgerAccountIdstring · uuidID of the ledger account
-
costCenterIdstring · uuidID of the cost center
-
createdAtstring · date-timeTimestamp when the credit note line item was created
-
updatedAtstring · date-timeTimestamp when the credit note line item was last updated
-
accrualTemplateIdstring · uuidID of the accrual template
-
accrualStartDatestring · dateStart date for accrual
-
accrualEndDatestring · dateEnd date for accrual
-
accrualDefaultDurationinteger · int32Default duration for accrual in months
-
-
createdAtstring · date-timeTimestamp when the credit note was created
-
updatedAtstring · date-timeTimestamp when the credit note was last updated
-
updatedBystring · uuidID of the user who last updated the credit note
-
localCurrencyFxRatenumberFX rate applied for the ledger's local currency
-
groupCurrencyFxRatenumberFX rate applied for the ledger's group currency
-
senderEmailstringThe email of the user who sent the document that this credit note was created from
-
documentNamestringThe name of the document that this credit note was created from