Skip to main content
POST
/
v1
/
invoice-payables
/
{invoicePayableId}
/
reverse-clearing
Reverse invoice payable payment
curl --request POST \
  --url https://api.light.inc/v1/invoice-payables/{invoicePayableId}/reverse-clearing \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json;charset=UTF-8' \
  --data '
{
  "clearingAccountingDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "shouldArchiveClearingDocument": false
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "metadata": {},
  "invoicePayableId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "failureContext": {
    "name": "<string>",
    "errors": [
      {
        "type": "<string>",
        "message": "<string>",
        "path": [
          "<string>"
        ],
        "context": {}
      }
    ]
  },
  "warningContext": {
    "name": "<string>",
    "errors": [
      {
        "type": "<string>",
        "message": "<string>",
        "path": [
          "<string>"
        ],
        "context": {}
      }
    ]
  },
  "approvalNote": "<string>",
  "cancellationReason": "<string>",
  "payeeName": "<string>",
  "payeeIban": "<string>",
  "payeeBban": "<string>",
  "payeeBic": "<string>",
  "payeeBankCode": "<string>",
  "payeeSwedishBankgiroNumber": "<string>",
  "payeeSwedishPlusgiroNumber": "<string>",
  "payeeAddress": "<string>",
  "payeeZipcode": "<string>",
  "payeeBankName": "<string>",
  "payeeBankAddress": "<string>",
  "payeeBankZipcode": "<string>",
  "payeeCity": "<string>",
  "payeeBankCity": "<string>",
  "vendorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "vendorDetailsOcr": {
    "avatarUrl": "<string>",
    "name": "<string>",
    "email": "<string>",
    "phoneNumber": {
      "localNumber": "<string>"
    },
    "website": "<string>",
    "city": "<string>",
    "address": "<string>",
    "zipcode": "<string>",
    "bankAccountNumber": "<string>",
    "bankAccountBic": "<string>",
    "domesticBankAccountNumber": "<string>",
    "domesticBankAccountCode": "<string>",
    "vatId": "<string>"
  },
  "companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceNumber": "<string>",
  "amount": 123,
  "outstandingBalance": 123,
  "currency": "USD",
  "description": "<string>",
  "senderBankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "fiNumber": "<string>",
  "norKidReference": "<string>",
  "swissPaymentReference": "<string>",
  "paymentAt": "2023-11-07T05:31:56Z",
  "ocrCompletedAt": "2023-11-07T05:31:56Z",
  "canceledAt": "2023-11-07T05:31:56Z",
  "issuedDate": "2023-12-25",
  "dueDate": "2023-12-25",
  "invoiceCreatedAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "purchaseOrderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "lineItemsIncludeTax": true,
  "localCurrencyFxRate": 123,
  "groupCurrencyFxRate": 123,
  "lineItems": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "invoicePayableId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "metadata": {},
      "amount": 123,
      "netAmount": 123,
      "description": "<string>",
      "taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "taxAmount": 123,
      "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "amortizationStartDate": "2023-12-25",
      "amortizationEndDate": "2023-12-25",
      "amortizationTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "customPropertiesOld": {
        "items": {}
      },
      "aiValueSuggestions": [
        {
          "field": "<string>",
          "fieldValues": [
            "<string>"
          ],
          "reasoning": "<string>"
        }
      ],
      "customProperties": [
        {
          "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "groupInternalName": "<string>",
          "values": [
            {
              "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "groupInternalName": "<string>",
              "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "internalName": "<string>",
              "label": "<string>",
              "context": "<string>",
              "createdAt": "2023-11-07T05:31:56Z",
              "updatedAt": "2023-11-07T05:31:56Z"
            }
          ]
        }
      ],
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "customProperties": [
    {
      "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "groupInternalName": "<string>",
      "values": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "groupInternalName": "<string>",
          "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "internalName": "<string>",
          "label": "<string>",
          "context": "<string>",
          "createdAt": "2023-11-07T05:31:56Z",
          "updatedAt": "2023-11-07T05:31:56Z"
        }
      ]
    }
  ],
  "paymentPausedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "paymentPausedAt": "2023-11-07T05:31:56Z",
  "senderEmail": "<string>",
  "documentName": "<string>"
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.

Path Parameters

invoicePayableId
string<uuid>
required

Body

application/json;charset=UTF-8
clearingAccountingDocumentId
string<uuid>

ID of the clearing accounting document to reverse — the bank payment or credit note that was applied to this invoice payable. Obtain it from the accountingDocumentId of an entry returned by the List invoice payable payments endpoint.

clearingType
enum<string>

Type of the clearing being reversed: BP for a bank payment or CN for a credit note. Matches the type of the corresponding entry returned by the List invoice payable payments endpoint.

  • BP - Bank payment
  • CN - Credit note

⚠️ This enum is not exhaustive; new values may be added in the future.

Available options:
BP,
CN
shouldArchiveClearingDocument
boolean
default:false

Whether to also archive the underlying clearing document (bank payment or credit note) after reversing it.

Response

default - application/json;charset=UTF-8

default response

id
string<uuid>

External ID of the invoice payable object.

type
enum<string>

Type of the invoice payable (e.g. vendor invoice or reimbursement).

⚠️ This enum is not exhaustive; new values may be added in the future.

Available options:
REIMBURSEMENT,
VENDOR_INVOICE
metadata
object

Metadata specific to the invoice payable type (e.g. reimbursement- or vendor-specific fields).

invoicePayableId
string<uuid>

Internal ID of the underlying invoice payable record.

companyId
string<uuid>

ID of the company this invoice payable belongs to.

state
enum<string>

Current 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.

Available options:
INIT,
CREATED,
IN_DRAFT,
APPROVAL_REQUESTED,
APPROVAL_PENDING,
APPROVED_ACCOUNTING_ENTRY_PENDING,
DECLINED,
READY_FOR_PAYMENT_RELEASE,
PENDING_PAYMENT_APPROVAL,
PAYMENT_PAUSED,
SCHEDULED,
PAYMENT_PENDING,
PARTIALLY_PAID,
UNPAID,
PAID,
COMPLETED,
RESET_PENDING,
CANCELLATION_PENDING,
CANCELLED,
DUPLICATED,
IMPORT_PENDING
failureReason
enum<string> | null

High-level reason why processing the invoice payable failed, if any.

⚠️ This enum is not exhaustive; new values may be added in the future.

Available options:
EMAIL_NOT_ALLOWED,
ERP_ENTRY_FAILED,
OCR_FAILED,
PAYMENT_APPROVAL_DECLINED,
PAYMENT_FAILED,
RESETTING_INVOICE_FAILED,
APPROVAL_SUBMISSION_FAILED,
USER_INPUT_VALIDATION_FAILED,
DUPLICATE_INVOICE,
PAYMENT_REJECTED
failureContext
object

Failure context when vendor onboarding fails.

warningContext
object

Failure context when vendor onboarding fails.

approvalNote
string | null

Approval note associated with the invoice payable (e.g. approver comments).

cancellationReason
string | null

Reason why the invoice payable was cancelled, if applicable.

payeeName
string | null

Name of the payee for this invoice payable.

payeeIban
string | null

Payee IBAN used for payment of this invoice payable.

payeeBban
string | null

Payee BBAN (Basic Bank Account Number) used for local payments.

payeeBic
string | null

Payee bank BIC/SWIFT code.

payeeBankCode
string | null

Payee bank/branch code used for local payments.

payeeSwedishBankgiroNumber
string | null

Payee Swedish Bankgiro number, if applicable.

payeeSwedishPlusgiroNumber
string | null

Payee Swedish Plusgiro number, if applicable.

payeeCountry
enum<string> | null

Country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
TR,
TT,
TV,
TW,
TZ,
UA,
UG,
UK,
UM,
US,
UY,
UZ,
VA,
VC,
VE,
VG,
VI,
VN,
VU,
WF,
WS,
XI,
XU,
XK,
YE,
YT,
YU,
ZA,
ZM,
ZR,
ZW
payeeAddress
string | null

Street address of the payee.

payeeZipcode
string | null

ZIP/postal code of the payee.

payeeBankName
string | null

Name of the payee's bank.

payeeBankCountry
enum<string> | null

Country of the payee's bank.

⚠️ This enum is not exhaustive; new values may be added in the future.

Available options:
UNDEFINED,
AC,
AD,
AE,
AF,
AG,
AI,
AL,
AM,
AN,
AO,
AQ,
AR,
AS,
AT,
AU,
AW,
AX,
AZ,
BA,
BB,
BD,
BE,
BF,
BG,
BH,
BI,
BJ,
BL,
BM,
BN,
BO,
BQ,
BR,
BS,
BT,
BU,
BV,
BW,
BY,
BZ,
CA,
CC,
CD,
CF,
CG,
CH,
CI,
CK,
CL,
CM,
CN,
CO,
CP,
CR,
CS,
CU,
CV,
CW,
CX,
CY,
CZ,
DE,
DG,
DJ,
DK,
DM,
DO,
DZ,
EA,
EC,
EE,
EG,
EH,
ER,
ES,
ET,
EU,
EZ,
FI,
FJ,
FK,
FM,
FO,
FR,
FX,
GA,
GB,
GD,
GE,
GF,
GG,
GH,
GI,
GL,
GM,
GN,
GP,
GQ,
GR,
GS,
GT,
GU,
GW,
GY,
HK,
HM,
HN,
HR,
HT,
HU,
IC,
ID,
IE,
IL,
IM,
IN,
IO,
IQ,
IR,
IS,
IT,
JE,
JM,
JO,
JP,
KE,
KG,
KH,
KI,
KM,
KN,
KP,
KR,
KW,
KY,
KZ,
LA,
LB,
LC,
LI,
LK,
LR,
LS,
LT,
LU,
LV,
LY,
MA,
MC,
MD,
ME,
MF,
MG,
MH,
MK,
ML,
MM,
MN,
MO,
MP,
MQ,
MR,
MS,
MT,
MU,
MV,
MW,
MX,
MY,
MZ,
NA,
NC,
NE,
NF,
NG,
NI,
NL,
NO,
NP,
NR,
NT,
NU,
NZ,
OM,
PA,
PE,
PF,
PG,
PH,
PK,
PL,
PM,
PN,
PR,
PS,
PT,
PW,
PY,
QA,
RE,
RO,
RS,
RU,
RW,
SA,
SB,
SC,
SD,
SE,
SF,
SG,
SH,
SI,
SJ,
SK,
SL,
SM,
SN,
SO,
SR,
SS,
ST,
SU,
SV,
SX,
SY,
SZ,
TA,
TC,
TD,
TF,
TG,
TH,
TJ,
TK,
TL,
TM,
TN,
TO,
TP,
TR,
TT,
TV,
TW,
TZ,
UA,
UG,
UK,
UM,
US,
UY,
UZ,
VA,
VC,
VE,
VG,
VI,
VN,
VU,
WF,
WS,
XI,
XU,
XK,
YE,
YT,
YU,
ZA,
ZM,
ZR,
ZW
payeeBankAddress
string | null

Street address of the payee's bank.

payeeBankZipcode
string | null

ZIP/postal code of the payee's bank.

payeeCity
string | null

City of the payee.

payeeBankCity
string | null

City of the payee's bank.

vendorId
string<uuid> | null

ID of the vendor entity this invoice payable is linked to, if any.

vendorDetailsOcr
object

Vendor details extracted from the invoice using OCR.

companyEntityId
string<uuid> | null

ID of the company entity this invoice payable is booked under.

invoiceNumber
string | null

Invoice number provided on the vendor invoice.

amount
integer<int64> | null

Total invoice amount in cents, expressed in the invoice currency.

outstandingBalance
integer<int64> | null

Outstanding invoice balance to be paid in cents, expressed in the invoice currency.

currency
string
Example:

"USD"

description
string | null

Description or memo for the invoice payable.

senderBankAccountId
string<uuid> | null

ID of the sender bank account from which this invoice payable will be paid.

fiNumber
string | null

FI (Finnish reference) number associated with this invoice payable, if applicable.

norKidReference
string | null

Norwegian KID reference associated with this invoice payable, if applicable.

swissPaymentReference
string | null

Swiss payment reference (QR-Reference or Creditor Reference/SCOR) associated with this invoice payable, if applicable.

paymentAt
string<date-time> | null

Date/time when payment is scheduled or was executed for this invoice payable.

ocrCompletedAt
string<date-time> | null

Timestamp when OCR processing for this invoice payable was completed.

canceledAt
string<date-time> | null

Timestamp when this invoice payable was cancelled.

issuedDate
string<date> | null

Issue date of the original vendor invoice.

dueDate
string<date> | null

Payment due date of the invoice payable.

invoiceCreatedAt
string<date-time>

Timestamp when the invoice payable record was created.

updatedAt
string<date-time>

Timestamp when the invoice payable record was last updated.

purchaseOrderId
string<uuid> | null

ID of the purchase order linked to this invoice payable, if any.

lineItemsIncludeTax
boolean

Whether invoice line item amounts are entered as tax-inclusive. When true, line item amount is expected to be the gross amount including tax; when false, line item netAmount is expected to be the base amount excluding tax.

localCurrencyFxRate
number | null

Foreign exchange rate to the ledger's local currency. If null, the system uses its default FX source.

groupCurrencyFxRate
number | null

Foreign exchange rate to the ledger's group currency. If null, the system uses its default FX source.

lineItems
object[] | null

List of line items belonging to this invoice payable.

customProperties
(object | null)[] | null

Custom properties set on the invoice payable header.

Custom properties set on the vendor.

paymentPausedBy
string<uuid> | null

ID of the user who paused payment for this invoice payable, if payment is paused.

paymentPausedAt
string<date-time> | null

Timestamp when payment for this invoice payable was paused, if applicable.

senderEmail
string | null

Email address from which the invoice payable was received, if known.

documentName
string | null

Name of the original document file associated with this invoice payable.