---
title: "Link customer credit"
method: POST
path: "/v1/customer-credits/{customerCreditId}/invoice-receivables/{invoiceReceivableId}"
tags: ["v1 - Customer Credits"]
---

# Link customer credit

`POST /v1/customer-credits/{customerCreditId}/invoice-receivables/{invoiceReceivableId}`

## 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/{customerCreditId}/invoice-receivables/{invoiceReceivableId}`
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer

Links a customer credit to a sales invoice

## Path parameters

- `customerCreditId` string, uuid, required
- `invoiceReceivableId` string, uuid, required

## Request body

- ExternalLinkCustomerCreditToInvoiceReceivableRequestV1Model
  - `amount` integer, nullable: Amount of the customer credit to apply to the sales invoice, in the smallest currency unit. If omitted, the remaining unallocated customer-credit balance is applied, capped by the invoice receivable's remaining balance. Partial allocation is not supported for entities configured with an e-invoicing provider.

## Response `default`

default response

- ExternalCustomerCreditInvoiceReceivableV1Model
  - `companyId` string, uuid: ID of the company
  - `customerCredit` 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
  - `invoiceReceivable` 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
  - `amount` integer: Amount of the customer credit applied to the sales invoice, in the smallest currency unit
  - `linkedAt` string, date-time: Timestamp when the customer credit was linked to the sales invoice

---

[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)
