API / Reference / Credit Notes
Post credit note
POST
https://api.light.inc/v1/credit-notes/{creditNoteId}/post
Posts the credit note to the ledger. The credit note must be in draft status with at least one line item. A valid companyEntityId, businessPartnerId, and currency are required. After posting, the credit note can be linked to invoice payables for balance clearing.
Beyond the listed prerequisites: the company must use Light's ledger (CREDIT_NOTE_CANNOT_BE_POSTED), amount must be set and non-zero and equal the sum of the lines' gross amounts (CREDIT_NOTE_VALIDATION_ERROR), the total must be a credit (CREDIT_NOTE_NEGATIVE_TOTAL_AMOUNT), and every line needs ledgerAccountId (CREDIT_NOTE_MISSING_FIELD). businessPartnerId is not actually checked here; it is required to link. The posting needs an open period and a payables control account for the entity. If the company auto-allocates credits, the response may already be PARTIALLY_CLEARED or CLEARED.
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
-
creditNoteIdstring · uuidrequired
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 · int64Unsigned integer in minor units. The direction is in
dcSign; a negative value is rejected. -
dcSignstring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
DC
-
-
netTransactionAmountobject-
amountinteger · int64Unsigned integer in minor units. The direction is in
dcSign; a negative value is rejected. -
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 · int64Unsigned integer in minor units. The direction is in
dcSign; a negative value is rejected. -
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
Echoes the override you sent;
nullwhen Light applies its own rate, not the rate that was applied. -
groupCurrencyFxRatenumberFX rate applied for the ledger's group currency
Echoes the override you sent;
nullwhen Light applies its own rate, not the rate that was applied. -
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