Light APIv1.0.0

API / Reference / Customer Credits

Post and send customer credit

POST https://api.light.inc/v1/customer-credits/{customerCreditId}/post-and-send-email

Posts the customer credit and sends it via email. Optionally submits to e-invoicing if shouldSubmitEInvoice is set.

Same as post, plus a required emailInfo that is validated before posting, so a bad subject or recipient list leaves the credit in DRAFT (CUSTOMER_CREDIT_EMAIL_INVALID_SUBJECT, CUSTOMER_CREDIT_EMAIL_MISSING_RECIPIENTS, at most 20 recipients and 20 cc). The email itself is sent after the call returns.

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

Request body

application/json;charset=UTF-8

  • emailInfo object

    Email configuration for sending the customer credit.

    • subject string

      Email subject line

    • replyTo string

      Reply-to email address

    • recipients array of string

      List of email addresses to send the customer credit to

    • cc array of string

      List of email addresses to CC on the email

    • customMessage string

      Optional custom message added to the email body

  • shouldSubmitEInvoice boolean

    Whether to submit the customer credit to the e-invoicing system (if configured). If true, the e-credit note will be submitted. If false, it will not. If omitted (null), the system will auto-detect: submit if the linked invoice has an e-invoice ID.

Response

  • id string · uuid

    Unique identifier for the object

  • companyId string · uuid

    ID of the company

  • companyEntityId string · uuid

    ID of the entity

  • amount integer · int64

    Total customer credit amount in cents

    The header amount available to allocate, independent of the line totals; the link validations compare against it.

  • customerName string

    Name of the customer

  • customerId string · uuid

    ID of the customer

  • status string

    Status of the customer credit

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

    One of DRAFT APPROVAL_PENDING APPROVED POSTED PARTIALLY_CLEARED CLEARED ARCHIVED

  • description string

    Description of the customer credit

  • currency string

  • documentDate string · date

    Date when the customer credit was issued

  • valuationDate string · date

    Date used when applying foreign exchange rate

  • areLinesWithTax boolean

    Whether the customer credit line amount is inclusive of tax or not. True means tax is already included in the line amount and will not be added on top, false means tax will be added on top of the line amount

  • lines array of object

    List of customer credit line items

    • id string · uuid

      Unique identifier for the object

    • companyId string · uuid

      ID of the company

    • customerCreditId string · uuid

      ID of the customer credit this line belongs to

    • grossTransactionAmount object

      • amount integer · int64

        Unsigned integer in minor units. The direction is in dcSign; a negative value is rejected.

      • dcSign string

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

        One of D C

    • netTransactionAmount object

      • amount integer · int64

        Unsigned integer in minor units. The direction is in dcSign; a negative value is rejected.

      • dcSign string

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

        One of D C

    • description string

      Description of the customer credit line item

    • ledgerTaxId string · uuid

      ID of the tax code

    • taxTransactionAmount object

      • amount integer · int64

        Unsigned integer in minor units. The direction is in dcSign; a negative value is rejected.

      • dcSign string

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

        One of D C

    • ledgerAccountId string · uuid

      ID of the ledger account

    • avataxCode string

      Avalara tax code. Used when the customer credit tax engine is AVATAX

    • productId string · uuid

      ID of the product

    • quantity number

      Quantity of the product

    • createdAt string · date-time

      Timestamp when the customer credit was created

    • updatedAt string · date-time

      Timestamp when the customer credit was last updated

    • accrualTemplateId string · uuid

      ID of the accrual template

    • accrualStartDate string · date

      Start date for accrual

    • accrualEndDate string · date

      End date for accrual

    • accrualDefaultDuration integer · int32

      Default duration for accrual in months

  • createdAt string · date-time

    Timestamp when the customer credit was created

  • updatedAt string · date-time

    Timestamp when the customer credit was last updated

  • updatedBy string · uuid

    ID of the user who last updated the customer credit

  • paymentReference string

    Payment reference generated when the customer credit is posted

  • linkedInvoiceReceivable object

    Invoice payable details

    The linked invoice receivable (the description says payable). null when there are no links or more than one; on the list endpoint also null unless include=INVOICE_RECEIVABLE.

    • 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