Light APIv1.0.0

API / Reference / Customer Credits

List customer credits

GET https://api.light.inc/v1/customer-credits

Returns a paginated list of customer credits

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

Query parameters

  • sort string

    Sort string in the format field:direction. To provide multiple sort fields, separate them with commas.

    Available directions: asc, desc.

    Available fields: amount, businessPartnerName, documentDate, postingDate, status.

  • filter string

    Filter string in the format field:operator:value. To provide multiple filters, separate them with commas.

    Available operators: eq, ne, in, not_in, gt, gte, lt, lte.

    • For in and not_in operators, provide multiple values separated by the pipe character (|).

    Available fields: businessPartnerId, companyEntityId, currency, documentDate, einvoiceStatus, id, postingDate, status, updatedAt.

  • limit integer · int32

    Maximum number of items to return. Default is 50, maximum is 200.

  • cursor string

    The cursor position to start returning results from. To opt-in into cursor-based pagination, provide 0 for the initial request. For subsequent requests, use nextCursor and prevCursor from the previous response to navigate. Cursor values are opaque and should not be constructed manually.

  • include array

    Related objects to include on every customer credit. Supported value can be INVOICE_RECEIVABLE

Response

  • records array of object

    List of records for the current page

    • 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

    • 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

        • dcSign string

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

          One of D C

      • netTransactionAmount object

        • amount integer · int64

        • 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

        • 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

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

  • hasMore boolean

    Boolean flag indicating if there are more records available

  • nextCursor string

    Cursor for fetching the next page

  • prevCursor string

    Cursor for fetching the previous page