Skip to main content
GET
/
v1
/
customer-credits
List customer credits
curl --request GET \
  --url https://api.light.inc/v1/customer-credits \
  --header 'Authorization: <api-key>'
{
  "records": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "amount": 123,
      "customerName": "<string>",
      "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "status": "DRAFT",
      "description": "<string>",
      "currency": "USD",
      "postingDate": "2023-12-25",
      "documentDate": "2023-12-25",
      "valuationDate": "2023-12-25",
      "areLinesWithTax": true,
      "lines": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "customerCreditId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "grossTransactionAmount": {
            "amount": 123,
            "dcSign": "D"
          },
          "netTransactionAmount": {
            "amount": 123,
            "dcSign": "D"
          },
          "description": "<string>",
          "ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "taxTransactionAmount": {
            "amount": 123,
            "dcSign": "D"
          },
          "ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "quantity": 123,
          "createdAt": "2023-11-07T05:31:56Z",
          "updatedAt": "2023-11-07T05:31:56Z"
        }
      ],
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "linkedInvoiceReceivable": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "documentNumber": "<string>",
        "documentDate": "2023-12-25",
        "status": "DRAFT",
        "amount": 123,
        "currency": "USD"
      }
    }
  ],
  "hasMore": true,
  "nextCursor": "<string>",
  "prevCursor": "<string>"
}

Authorizations

Authorization
string
header
required

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

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, status, documentDate.

Example:

"amount:desc,createdAt:asc"

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, status, companyEntityId, documentDate.

Example:

"state:in:IN_DRAFT|SCHEDULED|PAID,amount:gte:500,vendorId:ne:null"

limit
integer

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

Required range: x <= 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.

include
enum<string>[]

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

Response

default - application/json;charset=UTF-8

default response

records
object[]

List of records for the current page

hasMore
boolean

Boolean flag indicating if there are more records available

nextCursor
string | null

Cursor for fetching the next page

prevCursor
string | null

Cursor for fetching the previous page