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

Path Parameters

customerCreditId
string<uuid>
required

Body

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

ID of the entity

customerId
string<uuid> | null

ID of the customer

documentDate
string<date> | null

Date when the customer credit was issued

areLinesWithTax
boolean | null

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

customProperties
object[] | null

List of custom properties associated with the customer credit

description
string | null

Description of the customer credit

currency
string | null
Example:

"USD"

amount
integer | null

Total customer credit amount in cents

documentNumber
string | null

Response

default - application/json;charset=UTF-8

default response

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"

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