# Create contract line

> Creates a new contract line item

`POST https://api.light.inc/v1/contracts/{contractId}/lines`

## Note

Only while the contract is DRAFT ( CONTRACT_CANNOT_BE_MODIFIED ). A line discount carries its own startDate and endDate window in addition to type and value .

## Authorization

- API key
- Bearer token

See https://light.inc/docs/getting-started/authentication.

## Path parameters

- `contractId` (string, uuid, required)

## Header parameters

- `X-Idempotency-Key` (string)

## Request body

`application/json;charset=UTF-8`

- `priceOverwrite` — The **line total** before discount, in the smallest denomination — not a unit price. It replaces `quantity` × the product's price, and the unit price Light displays is this figure divided by `quantity`: 10 units at $0.20 each is `200` with `quantity: 10`, while `20` prices the whole line at $0.20. Any line `discount` then applies on top, so `20` with a 50% discount leaves the line at $0.10. Required when the product has no price in the contract's currency.
- `customProperties.valueIds` — Catalogue value ids for this group. Required; send `[]` (with an empty `inlineValues`) to clear the group. `SINGLE_SELECT` and `MULTI_SELECT` groups accept nothing else. See [Custom properties on writes](/docs/getting-started/pagination-filtering-errors#custom-properties-on-writes).
- `customProperties.inlineValues` — Literal values for `TEXT`, `NUMERIC`, `BOOLEAN` and `DATE` groups, as strings (`yyyy-MM-dd` for dates). Rejected on select groups with `CUSTOM_PROPERTY_VALUE_TYPE_MISMATCH`. See [Custom properties on writes](/docs/getting-started/pagination-filtering-errors#custom-properties-on-writes).

```json
{
  "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "billingStart": "2026-01-15",
  "billingEnd": "2026-01-15",
  "billingRecurrence": "ONE_TIME",
  "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "avataxCode": "string",
  "discount": {
    "startDate": "2026-01-15",
    "endDate": "2026-01-15",
    "type": "PERCENTAGE"
  },
  "quantity": 0,
  "priceOverwrite": 100000,
  "productNameOverwrite": "string",
  "customProperties": [
    {
      "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "valueIds": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "inlineValues": [
        "string"
      ]
    }
  ],
  "amortizationTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "amortizationStartDate": "2026-01-15",
  "amortizationEndDate": "2026-01-15"
}
```

Values above are generated from the schema: the shapes and types are real, the values are placeholders, and fields that exclude each other are all shown. Do not send it unchanged.

## Response

- `priceOverwrite` — The **line total** before discount, in the smallest denomination — not a unit price. It stands in for `quantity` × the product's price, and the unit price Light displays is this figure divided by `quantity`. `null` means the line is priced from the product. The model carries no computed amounts (no net, discount or tax figure), so a line's arithmetic is this field, `quantity` and `discount`.

```json
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "contractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "billingStart": "2026-01-15",
  "billingEnd": "2026-01-15",
  "billingRecurrence": "ONE_TIME",
  "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "avataxCode": "string",
  "discount": {
    "startDate": "2026-01-15",
    "endDate": "2026-01-15",
    "type": "PERCENTAGE"
  },
  "quantity": 0,
  "priceOverwrite": 100000,
  "productNameOverwrite": "string",
  "amortizationTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "amortizationStartDate": "2026-01-15",
  "amortizationEndDate": "2026-01-15",
  "aiValueSuggestions": [
    {
      "field": "string",
      "fieldValues": [
        "string"
      ],
      "reasoning": "string"
    }
  ],
  "customProperties": [
    {
      "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "groupInternalName": "string",
      "values": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "groupInternalName": "string",
          "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "internalName": "string",
          "label": "string",
          "context": "string",
          "createdAt": "2026-01-15T09:30:00Z",
          "updatedAt": "2026-01-15T09:30:00Z"
        }
      ]
    }
  ],
  "createdAt": "2026-01-15T09:30:00Z",
  "updatedAt": "2026-01-15T09:30:00Z"
}
```

Values above are generated from the schema: the shapes and types are real, the values are placeholders.

## Code

```bash
# Set LIGHT_IDEMPOTENCY_KEY to a key saved for this operation; reuse it on retries.
curl -X POST "https://api.light.inc/v1/contracts/3c90c3cc-0d44-4b50-8888-8dd25736052a/lines" \
  -H "Authorization: Basic YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Idempotency-Key: ${LIGHT_IDEMPOTENCY_KEY:?Set a saved key for this operation}" \
  -d '{
  "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "billingStart": "2026-01-15",
  "billingEnd": "2026-01-15",
  "billingRecurrence": "ONE_TIME",
  "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "avataxCode": "string",
  "discount": {
    "startDate": "2026-01-15",
    "endDate": "2026-01-15",
    "type": "PERCENTAGE"
  },
  "quantity": 0,
  "priceOverwrite": 100000,
  "productNameOverwrite": "string",
  "customProperties": [
    {
      "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "valueIds": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "inlineValues": [
        "string"
      ]
    }
  ],
  "amortizationTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "amortizationStartDate": "2026-01-15",
  "amortizationEndDate": "2026-01-15"
}'
```

---

Full page: https://light.inc/docs/api-reference/v1--contracts/create-contract-line · Index: https://light.inc/docs/llms.txt
