Light APIv1.0.0

API / Reference / Customer Credits

Link customer credit

POST https://api.light.inc/v1/customer-credits/{customerCreditId}/invoice-receivables/{invoiceReceivableId}

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

  • customerCreditId string · uuidrequired

  • invoiceReceivableId string · uuidrequired

Request body

application/json;charset=UTF-8

  • amount integer · int64

    Amount 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

  • companyId string · uuid

    ID of the company

  • customerCredit 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

  • invoiceReceivable 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

    Amount of the customer credit applied to the sales invoice, in the smallest currency unit

  • linkedAt string · date-time

    Timestamp when the customer credit was linked to the sales invoice