API / Reference / Invoice Payables
Reverse invoice payable payment
POST
https://api.light.inc/v1/invoice-payables/{invoicePayableId}/reverse-clearing
Reverses a clearing applied to an invoice payable — either a bank payment (BP) or a credit note (CN) — identified by its accounting document ID. Use the List invoice payable payments endpoint to obtain the accountingDocumentId and type of the clearing to reverse. Reversing removes the clearing's effect from the ledger and transitions the invoice back to UNPAID or PARTIALLY_PAID depending on the remaining outstanding balance. Optionally set shouldArchiveClearingDocument to also archive the underlying bank payment or credit note.
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
-
invoicePayableIdstring · uuidrequired
Request body
application/json;charset=UTF-8
-
clearingAccountingDocumentIdstring · uuidID of the clearing accounting document to reverse — the bank payment or credit note that was applied to this invoice payable. Obtain it from the
accountingDocumentIdof an entry returned by theList invoice payable paymentsendpoint. -
clearingTypestringType of the clearing being reversed:
BPfor a bank payment orCNfor a credit note. Matches thetypeof the corresponding entry returned by theList invoice payable paymentsendpoint.BP- Bank paymentCN- Credit note
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
BPCN -
shouldArchiveClearingDocumentbooleanWhether to also archive the underlying clearing document (bank payment or credit note) after reversing it.
Response
-
idstring · uuidExternal ID of the invoice payable object.
-
typestringType of the invoice payable (e.g. vendor invoice or reimbursement).
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
REIMBURSEMENTSELF_BILLEDVENDOR_INVOICE -
metadataobjectMetadata specific to the invoice payable type (e.g. reimbursement- or vendor-specific fields).
-
typestringType of metadata attached to the invoice payable, depending on its kind (vendor invoice or reimbursement).
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
SELF_BILLED_METADATAVENDOR_INVOICE_METADATAREIMBURSEMENT_METADATA
-
-
invoicePayableIdstring · uuidInternal ID of the underlying invoice payable record.
-
companyIdstring · uuidID of the company this invoice payable belongs to.
-
statestringCurrent state of the invoice payable in its lifecycle (from ingestion to payment/completion).
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
INITCREATEDIN_DRAFTAPPROVAL_REQUESTEDAPPROVAL_PENDINGAPPROVED_ACCOUNTING_ENTRY_PENDINGDECLINEDREADY_FOR_PAYMENT_RELEASEPENDING_PAYMENT_APPROVALPAYMENT_PAUSEDSCHEDULEDPAYMENT_PENDINGPARTIALLY_PAIDUNPAIDPAIDCOMPLETEDRESET_PENDINGCANCELLATION_PENDINGCANCELLEDDUPLICATEDIMPORT_PENDING -
failureReasonstringHigh-level reason why processing the invoice payable failed, if any.
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
EMAIL_NOT_ALLOWEDERP_ENTRY_FAILEDOCR_FAILEDPAYMENT_APPROVAL_DECLINEDPAYMENT_FAILEDRESETTING_INVOICE_FAILEDAPPROVAL_SUBMISSION_FAILEDUSER_INPUT_VALIDATION_FAILEDDUPLICATE_INVOICEPAYMENT_REJECTEDPAYMENT_REVERSED -
failureContextobjectFailure context when vendor onboarding fails.
-
namestringThe error name
-
typestringThe error type
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
BAD_REQUESTUNAUTHORIZEDFORBIDDENNOT_FOUNDCONFLICTUNPROCESSABLE_CONTENT -
errorsarray of objectList of errors providing details about what went wrong
-
typestringA string code identifying the error type
-
messagestringA human-readable message providing more details about the error
-
patharray of stringOptional path of the error when the error is for a specific field. Used mostly on BAD_REQUEST errors, that path will match the field name on the request object
-
contextobjectOptional context providing additional information about the error. This can include any relevant data that might help in understanding or resolving the error
-
-
-
warningContextobjectFailure context when vendor onboarding fails.
-
namestringThe error name
-
typestringThe error type
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
BAD_REQUESTUNAUTHORIZEDFORBIDDENNOT_FOUNDCONFLICTUNPROCESSABLE_CONTENT -
errorsarray of objectList of errors providing details about what went wrong
-
typestringA string code identifying the error type
-
messagestringA human-readable message providing more details about the error
-
patharray of stringOptional path of the error when the error is for a specific field. Used mostly on BAD_REQUEST errors, that path will match the field name on the request object
-
contextobjectOptional context providing additional information about the error. This can include any relevant data that might help in understanding or resolving the error
-
-
-
approvalNotestringApproval note associated with the invoice payable (e.g. approver comments).
-
cancellationReasonstringReason why the invoice payable was cancelled, if applicable.
-
payeeNamestringName of the payee for this invoice payable.
-
payeeIbanstringPayee IBAN used for payment of this invoice payable.
-
payeeBbanstringPayee BBAN (Basic Bank Account Number) used for local payments.
-
payeeBicstringPayee bank BIC/SWIFT code.
-
payeeBankCodestringPayee bank/branch code used for local payments.
-
payeeSwedishBankgiroNumberstringPayee Swedish Bankgiro number, if applicable.
-
payeeSwedishPlusgiroNumberstringPayee Swedish Plusgiro number, if applicable.
-
payeeCountrystringCountry of the payee.
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
UNDEFINEDACADAEAFAGAIALAMANAOAQARASATAUAWAXAZBABBBDBEBFBGBHBIBJBLBMBNBOBQBRBSBTBUBVBWBYBZCACCCDCFCGCHCICKCLCMCNCOCPCRCSCUCVCWCXCYCZDEDGDJDKDMDODZEAECEEEGEHERESETEUEZFIFJFKFMFOFRFXGAGBGDGEGFGGGHGIGLGMGNGPGQGRGSGTGUGWGYHKHMHNHRHTHUICIDIEILIMINIOIQIRISITJEJMJOJPKEKGKHKIKMKNKPKRKWKYKZLALBLCLILKLRLSLTLULVLYMAMCMDMEMFMGMHMKMLMMMNMOMPMQMRMSMTMUMVMWMXMYMZNANCNENFNGNINLNONPNRNTNUNZOMPAPEPFPGPHPKPLPMPNPRPSPTPWPYQARERORSRURWSASBSCSDSESFSGSHSISJSKSLSMSNSOSRSSSTSUSVSXSYSZTATCTDTFTGTHTJTKTLTMTNTOTPTRTTTVTWTZUAUGUKUMUSUYUZVAVCVEVGVIVNVUWFWSXIXUXKYEYTYUZAZMZRZW -
payeeAddressstringStreet address of the payee.
-
payeeZipcodestringZIP/postal code of the payee.
-
payeeBankNamestringName of the payee's bank.
-
payeeBankCountrystringCountry of the payee's bank.
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
UNDEFINEDACADAEAFAGAIALAMANAOAQARASATAUAWAXAZBABBBDBEBFBGBHBIBJBLBMBNBOBQBRBSBTBUBVBWBYBZCACCCDCFCGCHCICKCLCMCNCOCPCRCSCUCVCWCXCYCZDEDGDJDKDMDODZEAECEEEGEHERESETEUEZFIFJFKFMFOFRFXGAGBGDGEGFGGGHGIGLGMGNGPGQGRGSGTGUGWGYHKHMHNHRHTHUICIDIEILIMINIOIQIRISITJEJMJOJPKEKGKHKIKMKNKPKRKWKYKZLALBLCLILKLRLSLTLULVLYMAMCMDMEMFMGMHMKMLMMMNMOMPMQMRMSMTMUMVMWMXMYMZNANCNENFNGNINLNONPNRNTNUNZOMPAPEPFPGPHPKPLPMPNPRPSPTPWPYQARERORSRURWSASBSCSDSESFSGSHSISJSKSLSMSNSOSRSSSTSUSVSXSYSZTATCTDTFTGTHTJTKTLTMTNTOTPTRTTTVTWTZUAUGUKUMUSUYUZVAVCVEVGVIVNVUWFWSXIXUXKYEYTYUZAZMZRZW -
payeeBankAddressstringStreet address of the payee's bank.
-
payeeBankZipcodestringZIP/postal code of the payee's bank.
-
payeeCitystringCity of the payee.
-
payeeBankCitystringCity of the payee's bank.
-
vendorIdstring · uuidID of the vendor entity this invoice payable is linked to, if any.
-
vendorDetailsOcrobjectVendor details extracted from the invoice using OCR.
-
avatarUrlstringURL of the vendor avatar/logo detected by OCR, if any.
-
namestringVendor name detected by OCR from the uploaded document.
-
emailstringVendor email address detected by OCR from the uploaded document.
-
phoneNumberobjectVendor phone number.
-
countryCodestring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
UNDEFINEDACADAEAFAGAIALAMANAOAQARASATAUAWAXAZBABBBDBEBFBGBHBIBJBLBMBNBOBQBRBSBTBUBVBWBYBZCACCCDCFCGCHCICKCLCMCNCOCPCRCSCUCVCWCXCYCZDEDGDJDKDMDODZEAECEEEGEHERESETEUEZFIFJFKFMFOFRFXGAGBGDGEGFGGGHGIGLGMGNGPGQGRGSGTGUGWGYHKHMHNHRHTHUICIDIEILIMINIOIQIRISITJEJMJOJPKEKGKHKIKMKNKPKRKWKYKZLALBLCLILKLRLSLTLULVLYMAMCMDMEMFMGMHMKMLMMMNMOMPMQMRMSMTMUMVMWMXMYMZNANCNENFNGNINLNONPNRNTNUNZOMPAPEPFPGPHPKPLPMPNPRPSPTPWPYQARERORSRURWSASBSCSDSESFSGSHSISJSKSLSMSNSOSRSSSTSUSVSXSYSZTATCTDTFTGTHTJTKTLTMTNTOTPTRTTTVTWTZUAUGUKUMUSUYUZVAVCVEVGVIVNVUWFWSXIXUXKYEYTYUZAZMZRZW -
localNumberstring
-
-
websitestringVendor website detected by OCR from the uploaded document.
-
countrystringVendor country detected by OCR from the uploaded document.
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
UNDEFINEDACADAEAFAGAIALAMANAOAQARASATAUAWAXAZBABBBDBEBFBGBHBIBJBLBMBNBOBQBRBSBTBUBVBWBYBZCACCCDCFCGCHCICKCLCMCNCOCPCRCSCUCVCWCXCYCZDEDGDJDKDMDODZEAECEEEGEHERESETEUEZFIFJFKFMFOFRFXGAGBGDGEGFGGGHGIGLGMGNGPGQGRGSGTGUGWGYHKHMHNHRHTHUICIDIEILIMINIOIQIRISITJEJMJOJPKEKGKHKIKMKNKPKRKWKYKZLALBLCLILKLRLSLTLULVLYMAMCMDMEMFMGMHMKMLMMMNMOMPMQMRMSMTMUMVMWMXMYMZNANCNENFNGNINLNONPNRNTNUNZOMPAPEPFPGPHPKPLPMPNPRPSPTPWPYQARERORSRURWSASBSCSDSESFSGSHSISJSKSLSMSNSOSRSSSTSUSVSXSYSZTATCTDTFTGTHTJTKTLTMTNTOTPTRTTTVTWTZUAUGUKUMUSUYUZVAVCVEVGVIVNVUWFWSXIXUXKYEYTYUZAZMZRZW -
citystringVendor city detected by OCR from the uploaded document.
-
addressstringVendor street address detected by OCR from the uploaded document.
-
zipcodestringVendor ZIP/postal code detected by OCR from the uploaded document.
-
bankAccountNumberstringVendor bank account number (IBAN or local format) detected by OCR from the uploaded document.
-
bankAccountBicstringVendor bank BIC/SWIFT code detected by OCR from the uploaded document.
-
domesticBankAccountNumberstringVendor domestic bank account number detected by OCR (country-specific format).
-
domesticBankAccountCodestringVendor domestic bank account code detected by OCR (e.g. routing/sort code).
-
vatIdstringVendor VAT ID detected by OCR from the uploaded document.
-
-
companyEntityIdstring · uuidID of the company entity this invoice payable is booked under.
-
invoiceNumberstringInvoice number provided on the vendor invoice.
-
amountinteger · int64Total invoice amount in cents, expressed in the invoice currency.
-
outstandingBalanceinteger · int64Outstanding invoice balance to be paid in cents, expressed in the invoice currency.
-
currencystring -
descriptionstringDescription or memo for the invoice payable.
-
senderBankAccountIdstring · uuidID of the sender bank account from which this invoice payable will be paid.
-
fiNumberstringFI (Finnish reference) number associated with this invoice payable, if applicable.
-
finnishPaymentReferencestringFinnish payment reference (viitenumero or RF Creditor Reference) associated with this invoice payable, if applicable.
-
norKidReferencestringNorwegian KID reference associated with this invoice payable, if applicable.
-
swissPaymentReferencestringSwiss payment reference (QR-Reference or Creditor Reference/SCOR) associated with this invoice payable, if applicable.
-
swedishOcrReferencestringSwedish OCR reference associated with this invoice payable, if applicable.
-
paymentAtstring · date-timeDate/time when payment is scheduled or was executed for this invoice payable.
-
ocrCompletedAtstring · date-timeTimestamp when OCR processing for this invoice payable was completed.
-
canceledAtstring · date-timeTimestamp when this invoice payable was cancelled.
-
issuedDatestring · dateIssue date of the original vendor invoice.
The date the vendor issued the invoice. This model carries no
postingDate— for the date the document hit the ledger, read the ledger line viaGET /v1/ledger-transaction-lines. -
dueDatestring · datePayment due date of the invoice payable.
-
invoiceCreatedAtstring · date-timeTimestamp when the invoice payable record was created.
-
updatedAtstring · date-timeTimestamp when the invoice payable record was last updated.
-
purchaseOrderIdstring · uuidID of the purchase order linked to this invoice payable, if any.
-
lineItemsIncludeTaxbooleanWhether invoice line item amounts are entered as tax-inclusive. When true, line item
amountis expected to be the gross amount including tax; when false, line itemnetAmountis expected to be the base amount excluding tax. -
localCurrencyFxRatenumberForeign exchange rate to the ledger's local currency. If null, the system uses its default FX source.
-
groupCurrencyFxRatenumberForeign exchange rate to the ledger's group currency. If null, the system uses its default FX source.
-
lineItemsarray of objectList of line items belonging to this invoice payable.
-
idstring · uuidID of the invoice payable line item.
-
invoicePayableIdstring · uuidID of the invoice payable this line item belongs to.
-
typestringType of the invoice payable line item (vendor invoice or reimbursement).
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
REIMBURSEMENTSELF_BILLEDVENDOR_INVOICE -
metadataobjectMetadata for the invoice payable line item (ERP-specific fields and context).
-
typestringType of the invoice payable line item (vendor invoice or reimbursement).
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
REIMBURSEMENTSELF_BILLEDVENDOR_INVOICE
-
-
amountinteger · int64Amount in cents, including tax. When
lineItemsIncludeTaxis true,amountrepresents the full tax-inclusive amount for this line. -
netAmountinteger · int64Net line amount in cents, excluding tax. When
lineItemsIncludeTaxis false,netAmountrepresents the base amount on which tax is calculated. -
descriptionstringDescription of this invoice payable line item.
-
taxCodeIdstring · uuidID of the tax code applied to this line item.
-
taxAmountinteger · int64Tax amount in cents for this line item.
-
accountIdstring · uuidID of the ledger account used to book this line item.
-
costCenterIdstring · uuidID of the cost center associated with this line item, if applicable.
-
amortizationStartDatestring · dateStart date for amortization of this line item.
-
amortizationEndDatestring · dateEnd date for amortization of this line item.
-
amortizationTemplateIdstring · uuidID of the amortization template to use for this line item within Light Ledger.
-
customPropertiesOldobjectLegacy container for custom properties on this line item (deprecated/old format).
-
itemsobject
-
-
aiValueSuggestionsarray of objectAI-generated suggestions for line item values (e.g. account, cost center, tax code).
-
fieldstring -
fieldValuesarray of string -
reasoningstring
-
-
customPropertiesarray of objectCustom properties set on this invoice payable line item.
-
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 this invoice payable line item was created.
-
updatedAtstring · date-timeTimestamp when this invoice payable line item was last updated.
-
-
customPropertiesarray of objectCustom properties set on the invoice payable header.
-
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
-
-
-
paymentPausedBystring · uuidID of the user who paused payment for this invoice payable, if payment is paused.
-
paymentPausedAtstring · date-timeTimestamp when payment for this invoice payable was paused, if applicable.
-
senderEmailstringEmail address from which the invoice payable was received, if known.
-
documentNamestringName of the original document file associated with this invoice payable.