Skip to main content
POST
/
v1
/
customer-credits
Create customer credit
curl --request POST \
  --url https://api.light.inc/v1/customer-credits \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json;charset=UTF-8' \
  --data '{
  "companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "documentNumber": "<string>",
  "description": "<string>",
  "currency": "USD",
  "postingDate": "2023-12-25",
  "localCurrencyFxRate": 123,
  "groupCurrencyFxRate": 123,
  "documentDate": "2023-12-25",
  "areLinesWithTax": true,
  "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "amount": 123,
  "lines": [
    {
      "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "quantity": 123,
      "netTransactionAmount": {
        "amount": 123,
        "dcSign": "D"
      },
      "grossTransactionAmount": {
        "amount": 123,
        "dcSign": "D"
      },
      "taxTransactionAmount": {
        "amount": 123,
        "dcSign": "D"
      },
      "description": "<string>",
      "ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "customProperties": [
        {
          "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "valueIds": [
            "3c90c3cc-0d44-4b50-8888-8dd25736052a"
          ],
          "inlineValues": [
            "<string>"
          ]
        }
      ]
    }
  ],
  "customProperties": [
    {
      "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "valueIds": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "inlineValues": [
        "<string>"
      ]
    }
  ]
}'
{
  "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"
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json;charset=UTF-8
companyEntityId
string<uuid> | null

ID of the entity

documentNumber
string | null
description
string | null

Description of the customer credit

currency
string | null
Example:

"USD"

postingDate
string<date> | null

Date when the customer credit should be posted to the ledger

localCurrencyFxRate
number | null

Custom foreign exchange rate for the ledger's local currency. If not provided Light uses official ECB rates

groupCurrencyFxRate
number | null

Custom foreign exchange rate for the ledger's group currency. If not provided Light uses official ECB rates

documentDate
string<date> | null

Date when the customer credit was issued

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

customerId
string<uuid> | null

ID of the customer

amount
integer | null

Total customer credit amount in cents

lines
object[]

List of customer credit line items

customProperties
object[] | null

List of custom properties associated with the customer credit

Response

default - application/json;charset=UTF-8

default response

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> | null

ID of the entity

amount
integer | null

Total customer credit amount in cents

customerName
string | null

Name of the customer

customerId
string<uuid> | null

ID of the customer

status
enum<string>

Status of the customer credit

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

Available options:
DRAFT,
POSTED,
PARTIALLY_CLEARED,
CLEARED,
ARCHIVED
description
string | null

Description of the customer credit

currency
string
Example:

"USD"

postingDate
string<date> | null

Date when the customer credit should be posted to the ledger

documentDate
string<date> | null

Date when the customer credit was issued

valuationDate
string<date> | null

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
object[]

List of customer credit line items

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> | null

ID of the user who last updated the customer credit

linkedInvoiceReceivable
object | null

The invoice receivable that this customer credit is linked to