---
title: "Create customer credit"
method: POST
path: "/v1/customer-credits"
tags: ["v1 - Customer Credits"]
---

# Create customer credit

`POST /v1/customer-credits`

## Request

- Base URL: `https://light.inc` (the document declares no server; this is the origin it was published from)
- URL: `https://light.inc/v1/customer-credits`
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer

Creates a new customer credit

## Headers

- `X-Idempotency-Key` string

## Request body

- ExternalCreateCustomerCreditRequestV1Model
  - `companyEntityId` string, uuid, nullable: ID of the entity
  - `documentNumber` string, nullable: Unique customer credit number. If not provided, one will be generated automatically when the invoice is opened.
  - `description` string, nullable: Description of the customer credit
  - `currency` string, nullable
  - `localCurrencyFxRate` number, nullable: Custom foreign exchange rate for the ledger's local currency. If not provided Light uses official ECB rates
  - `groupCurrencyFxRate` number, nullable: Custom foreign exchange rate for the ledger's group currency. If not provided Light uses official ECB rates
  - `documentDate` string, date, nullable: Date when the customer credit was issued
  - `postingDate` string, date, nullable: Date when the customer credit is posted to the ledger. Defaults to the document date, or today if both dates are omitted
  - `documentTemplateId` string, uuid, nullable: ID of the document template that the customer credit will use
  - `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, nullable: ID of the customer
  - `amount` integer, nullable: Total customer credit amount in cents
  - `lines` ExternalCreateCustomerCreditLineRequestV1Model[]: List of customer credit line items
    - `productId` string, uuid: ID of the product
    - `quantity` number: Quantity of the product
    - `netTransactionAmount` DirectedAmount
      - `amount` integer
      - `dcSign` 'D' | 'C': ⚠️ This enum is not exhaustive; new values may be added in the future.
    - `grossTransactionAmount` DirectedAmount
      - `amount` integer
      - `dcSign` 'D' | 'C': ⚠️ This enum is not exhaustive; new values may be added in the future.
    - `taxTransactionAmount` DirectedAmount
      - `amount` integer
      - `dcSign` 'D' | 'C': ⚠️ This enum is not exhaustive; new values may be added in the future.
    - `description` string, nullable: Description of the customer credit line item
    - `ledgerTaxId` string, uuid, nullable: ID of the tax code
    - `ledgerAccountId` string, uuid, nullable: ID of the ledger account
    - `avataxCode` string, nullable: Avalara tax code. Used when the customer credit tax engine is AVATAX
    - `customProperties` SetCustomPropertyRequestV1Model[], nullable: List of custom properties associated with the line
      - `groupId` string, uuid
      - `valueIds` string[]
      - `inlineValues` string[]
    - `accrualTemplateId` string, uuid, nullable: ID of the accrual template
    - `accrualStartDate` string, date, nullable: Start date for accrual
    - `accrualEndDate` string, date, nullable: End date for accrual
  - `customProperties` SetCustomPropertyRequestV1Model[], nullable: List of custom properties associated with the customer credit
    - `groupId` string, uuid
    - `valueIds` string[]
    - `inlineValues` string[]

## Response `default`

default response

- ExternalCustomerCreditV1Model
  - `id` string, uuid: Unique identifier for the object
  - `companyId` string, uuid: ID of the company
  - `companyEntityId` string, uuid, nullable: ID of the entity
  - `amount` integer, nullable: Total customer credit amount in cents
  - `customerName` string, nullable: Name of the customer
  - `customerId` string, uuid, nullable: ID of the customer
  - `status` 'DRAFT' | 'APPROVAL_PENDING' | 'APPROVED' | 'POSTED' | 'PARTIALLY_CLEARED' | 'CLEARED' | 'ARCHIVED': Status of the customer credit ⚠️ This enum is not exhaustive; new values may be added in the future.
  - `description` string, nullable: Description of the customer credit
  - `currency` string
  - `documentDate` string, date, nullable: Customer-facing issue date override. Null means customer-facing documents use the posting date
  - `postingDate` string, date, nullable: Date when the customer credit is posted to the ledger
  - `valuationDate` string, date, nullable: 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` ExternalCustomerCreditLineV1Model[]: 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` DirectedAmount
      - `amount` integer
      - `dcSign` 'D' | 'C': ⚠️ This enum is not exhaustive; new values may be added in the future.
    - `netTransactionAmount` DirectedAmount
      - `amount` integer
      - `dcSign` 'D' | 'C': ⚠️ This enum is not exhaustive; new values may be added in the future.
    - `description` string, nullable: Description of the customer credit line item
    - `ledgerTaxId` string, uuid, nullable: ID of the tax code
    - `taxTransactionAmount` DirectedAmount
      - `amount` integer
      - `dcSign` 'D' | 'C': ⚠️ This enum is not exhaustive; new values may be added in the future.
    - `ledgerAccountId` string, uuid, nullable: ID of the ledger account
    - `avataxCode` string, nullable: 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, nullable: ID of the accrual template
    - `accrualStartDate` string, date, nullable: Start date for accrual
    - `accrualEndDate` string, date, nullable: End date for accrual
    - `accrualDefaultDuration` integer, nullable: 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, nullable: ID of the user who last updated the customer credit
  - `paymentReference` string, nullable: Payment reference generated when the customer credit is posted
  - `linkedInvoiceReceivable` ExternalRelatedAccDocV1Model: Invoice payable details
    - `id` string, uuid: Unique identifier for the object
    - `documentNumber` string, nullable: Document number
    - `documentDate` string, date, nullable: Date the accounting document was issued
    - `postingDate` string, date, nullable: Date the accounting document is posted to the ledger
    - `status` 'DRAFT' | 'APPROVAL_PENDING' | 'APPROVED' | 'POSTED' | 'PARTIALLY_CLEARED' | 'CLEARED' | 'ARCHIVED': Status of the accounting document ⚠️ This enum is not exhaustive; new values may be added in the future.
    - `amount` integer, nullable: The amount of the accounting document in cents
    - `currency` string

---

[API](https://skmtc.dev/light/apis/light-api.md) - [All operations](https://skmtc.dev/light/apis/light-api/llms.txt) - [OpenAPI document](https://skmtc.dev/light/apis/light-api/revisions/84f51306f648?raw)
