API / Reference / Customer Credits
Update customer credit line
PATCH
https://api.light.inc/v1/customer-credits/{customerCreditId}/lines/{lineId}
Updates the given customer credit line
Only while the credit is DRAFT. null clears the amounts, description, ledgerTaxId, ledgerAccountId, avataxCode and the accrual fields, but leaves productId and quantity unchanged. Unknown line: CUSTOMER_CREDIT_LINE_NOT_FOUND.
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
-
customerCreditIdstring · uuidrequired -
lineIdstring · uuidrequired
Request body
application/json;charset=UTF-8
-
productIdstring · uuidID of the product
-
quantitynumberQuantity of the product
-
customPropertiesarray of objectList of custom properties associated with the line
-
groupIdstring · uuid -
valueIdsarray of string · uuidCatalogue 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 stringLiteral 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.
-
-
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
-
-
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
-
-
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
-
-
descriptionstringDescription of the customer credit line item
-
ledgerTaxIdstring · uuidID of the tax code
-
ledgerAccountIdstring · uuidID of the ledger account
-
avataxCodestringAvalara tax code. Used when the customer credit tax engine is AVATAX
-
accrualTemplateIdstring · uuidID of the accrual template
-
accrualStartDatestring · dateStart date for accrual
-
accrualEndDatestring · dateEnd date for accrual
Response
-
idstring · uuidUnique identifier for the object
-
companyIdstring · uuidID of the company
-
customerCreditIdstring · uuidID of the customer credit 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 customer credit 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
-
avataxCodestringAvalara tax code. Used when the customer credit tax engine is AVATAX
-
productIdstring · uuidID of the product
-
quantitynumberQuantity of the product
-
createdAtstring · date-timeTimestamp when the customer credit was created
-
updatedAtstring · date-timeTimestamp when the customer credit 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