# Partially update a product line

`PATCH /accounting/products/{id}/product-lines/{productLineId}`

Group: Accounting › Products › Product Lines · Operation ID: `updateAccountingProductLine`

Updates one existing product line's own fields (plus its tax records), scoped to that single line — other lines on the product are untouched. Writes only the fields the request body carries; everything omitted is left unchanged, EXCEPT `productLineTaxes`, which is a full replacement of the line's tax records whenever the field is present (pass every tax record that should remain, not just new ones) — omit the field entirely to leave existing taxes unchanged.

This endpoint does not touch pricing — use createPricing/updatePricing/deletePricing (POST/PATCH/DELETE .../product-lines/:productLineId/pricing) for that. `lineType` is also not settable here: it is immutable after creation, so retyping a line means deleting it and creating a new one. The call runs in a transaction: a failure writes nothing.

[Open in the interactive reference](https://docs.api.lensing.ai/?op=updateAccountingProductLine)

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | `"v1"` | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |
| `Idempotency-Key` | header | string | no | An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with `400 IDEMPOTENCY_NOT_SUPPORTED` rather than silently ignored. |
| `id` | path | string | yes | Id of the product the line belongs to (a UUID); bound from the :id path segment. |
| `productLineId` | path | string | yes | Id of the product line to update (a UUID); bound from the :productLineId path segment. |

## Request body

Required, `application/json`: updateAccountingProductLineInput.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `priceModel` | string | no | New pricing model for the line. Omit to leave unchanged. One of 'flat', 'perUnit', 'tiered', 'volume', 'stairstep', 'rateCard', 'thresholdBased'. |
| `unitOfMeasure` | string | no | New unit of measure. Omit to leave unchanged. One of 'instance', 'gigabyte', 'terabyte', 'user', 'seat', 'minute', 'hour', 'day', 'month', 'each', 'license', 'activeUser', 'megabyte', 'message', 'text', 'platform', 'employee', 'personnel', 'credit', 'currency', 'package', 'case', 'word', 'record'. |
| `name` | string | no | New human-readable name. Omit to leave unchanged. |
| `pricingTerm` | string | no | New pricing term. Omit to leave unchanged. One of 'monthly', 'biMonthly', 'once', 'quarterly', 'semiAnnually', 'annually'. |
| `enforceListPrice` | boolean | no | Whether sales transactions on this line can override the list price. Omit to leave unchanged. |
| `invoiceFrequency` | string | no | New invoice frequency. Omit to leave unchanged. One of 'monthly', 'biMonthly', 'quarterly', 'semiAnnually', 'annually', 'once', 'custom', 'template', 'milestone', 'allAtOnce', 'termEnd'. |
| `prepaidBalanceOverConsumptionBehavior` | string | no | New prepaid-overconsumption behavior. Accepted values: allowNegative, overage. Omit to leave unchanged. |
| `prepaidBalanceRolloverAtRenewal` | boolean | no | Whether the remaining prepaid balance rolls over at renewal. Omit to leave unchanged. |
| `crmProductId` | string | no | New CRM identifier for this line. Omit to leave unchanged. |
| `dataSource` | string | no | New upstream-system identifier. Omit to leave unchanged. E.g. 'Salesforce', 'NetSuite', 'Stripe' — the domain is tenant-configurable and not exhaustively enumerable here. |
| `productLineTaxes` | array of object | no | Full replacement of this line's tax records. Pass every record that should remain. Omit the field entirely to leave existing taxes unchanged; pass an empty array to clear them. |
| `productLineTaxes[].taxCode` | string | yes | Tax code as defined by the configured tax provider. |
| `productLineTaxes[].entityId` | string | yes | Id of the legal entity this tax record applies under (a UUID). |
| `productLineTaxes[].engine` | string | yes | Identifier of the tax engine used to compute this tax. One of 'avalara', 'anrok', 'everestTaxEngine', 'manualTax', 'none'. |
| `productLineTaxes[].country` | string | no | ISO 3166-1 country code the tax record applies in. |

Example:

```json
{
  "priceModel": "<priceModel>",
  "unitOfMeasure": "<unitOfMeasure>",
  "name": "<name>",
  "pricingTerm": "<pricingTerm>",
  "enforceListPrice": true,
  "invoiceFrequency": "<invoiceFrequency>",
  "prepaidBalanceOverConsumptionBehavior": "<prepaidBalanceOverConsumptionBehavior>",
  "prepaidBalanceRolloverAtRenewal": true,
  "crmProductId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "dataSource": "<dataSource>",
  "productLineTaxes": [
    {
      "taxCode": "<taxCode>",
      "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "engine": "<engine>",
      "country": "<country>"
    }
  ]
}
```

## Response

`200` Success

## Response headers

- `Idempotency-Replayed` — Present and `true` only when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent as `false`.

## Errors

| Code | Status |
| --- | --- |
| `INVALID_ID` | 400 |
| `NOT_FOUND` | 400 |
| `UNKNOWN_TAX_ENTITY_IDS` | 400 |
| `UNSUPPORTED_LINE_TYPE` | 400 |
| `VALIDATION_FAILED` | 400 |
| `IDEMPOTENCY_KEY_CONFLICT` | 409 |
| `IDEMPOTENCY_PAYLOAD_MISMATCH` | 422 |

## Statuses

- `400` — Invalid request or business failure. Codes: INVALID_ID, NOT_FOUND, UNKNOWN_TAX_ENTITY_IDS, UNSUPPORTED_LINE_TYPE, VALIDATION_FAILED
- `401` — Missing or invalid access token
- `403` — Not authorized
- `404` — Not found
- `409` — The Idempotency-Key is still being processed by another request.
- `422` — The Idempotency-Key was already used with a different request payload.
- `429` — Too many requests
- `500` — Internal server error
