Light APIv1.0.0

API / Reference / Credit Notes

Link credit note to invoice payable

POST https://api.light.inc/v1/credit-notes/{creditNoteId}/invoice-payables/{invoicePayableId}

Links a credit note to an invoice payable for clearing (offsetting balances). Because credit notes cannot be applied in the ledger until the invoice payable is posted, this creates a 'link' record that will be used during posting to automatically clear the credit note balance against the invoice payable balance. Requirements: credit note must be in POSTED status, both documents must belong to the same company entity, same vendor (businessPartnerId), same currency, and clearing amount cannot exceed available balance on either document.

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

  • creditNoteId string · uuidrequired

  • invoicePayableId string · uuidrequired

Request body

application/json;charset=UTF-8

  • amount integer · int64

    Amount to clear in cents

Response

  • companyId string · uuid

    ID of the company

  • creditNote object

    Invoice payable details

    • id string · uuid

      Unique identifier for the object

    • documentNumber string

      Document number

    • documentDate string · date

      Date the accounting document was issued

    • status string

      Status of the accounting document

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

      One of DRAFT APPROVAL_PENDING APPROVED POSTED PARTIALLY_CLEARED CLEARED ARCHIVED

    • amount integer · int64

      The amount of the accounting document in cents

    • currency string

  • invoicePayable object

    Invoice payable details

    • id string · uuid

      Unique identifier for the object

    • documentNumber string

      Document number

    • documentDate string · date

      Date the accounting document was issued

    • status string

      Status of the accounting document

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

      One of DRAFT APPROVAL_PENDING APPROVED POSTED PARTIALLY_CLEARED CLEARED ARCHIVED

    • amount integer · int64

      The amount of the accounting document in cents

    • currency string

  • amount integer · int64

    Clearing amount in cents

  • currency string

  • createdAt string · date-time

    Timestamp when the link was created

  • updatedAt string · date-time

    Timestamp when the link was last updated