API / Reference / Customer Credits
Link customer credit to invoice
POST
https://api.light.inc/v1/customer-credits/{customerCreditId}/invoice-receivables/{invoiceReceivableId}/link
Links a customer credit to a sales invoice
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 -
invoiceReceivableIdstring · uuidrequired
Request body
application/json;charset=UTF-8
-
amountinteger · int64Amount of the customer credit to apply to the sales invoice, in the smallest currency unit. If omitted, the remaining unallocated customer-credit balance is applied, capped by the invoice receivable's remaining balance. Partial allocation is not supported for entities configured with an e-invoicing provider.
Response
-
companyIdstring · uuidID of the company
-
customerCreditobjectInvoice payable details
-
idstring · uuidUnique identifier for the object
-
documentNumberstringDocument number
-
documentDatestring · dateDate the accounting document was issued
-
statusstringStatus of the accounting document
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
DRAFTAPPROVAL_PENDINGAPPROVEDPOSTEDPARTIALLY_CLEAREDCLEAREDARCHIVED -
amountinteger · int64The amount of the accounting document in cents
-
currencystring
-
-
invoiceReceivableobjectInvoice payable details
-
idstring · uuidUnique identifier for the object
-
documentNumberstringDocument number
-
documentDatestring · dateDate the accounting document was issued
-
statusstringStatus of the accounting document
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
DRAFTAPPROVAL_PENDINGAPPROVEDPOSTEDPARTIALLY_CLEAREDCLEAREDARCHIVED -
amountinteger · int64The amount of the accounting document in cents
-
currencystring
-
-
amountinteger · int64Amount of the customer credit applied to the sales invoice, in the smallest currency unit
-
linkedAtstring · date-timeTimestamp when the customer credit was linked to the sales invoice