---
title: "Update an invoice line item"
method: PATCH
path: "/invoices/{invoice_id}/lines/{id}"
tags: ["Invoices"]
---

# Update an invoice line item

`PATCH /invoices/{invoice_id}/lines/{id}`

Updates a line item of a draft invoice and recalculates the invoice total. All body fields are optional; send only the fields you want to change. The invoice must be in `draft` status and any new currency must match the invoice currency.

## Path parameters

- `invoice_id` string, required
- `id` string, required

## Request body

- object
  - `amount` integer — New amount of the line item, in the smallest unit of `currency` (for example, `30000` for $30000 CLP, since CLP has no minor unit, or `3000` for $30.00 MXN). Must be greater than 0.
  - `currency` 'CLP' | 'MXN' — New currency of the line item, as an ISO 4217 code. Must match the invoice currency.
  - `period_end` string, date-time — New ISO 8601 timestamp marking the end of the billing period covered by the line item. Must remain after `period_start`.
  - `period_start` string, date-time — New ISO 8601 timestamp marking the start of the billing period covered by the line item.
  - `quantity` integer — New number of units billed by the line item. Must be greater than 0.
  - `name` string — New display name for the line item shown on the invoice.
  - `description` string — New additional details about the line item shown on the invoice.

## Response `200`

The updated line item. The invoice total already reflects the new amount.

- InvoiceLineItem
  - `id` string, required — Unique identifier of the line item.
  - `object` 'line_item', required — Type of the object. Always `line_item`.
  - `amount` integer, required — Amount of the line item, in the smallest unit of `currency` (for example, `30000` for $30000 CLP, since CLP has no minor unit, or `3000` for $30.00 MXN).
  - `currency` 'CLP' | 'MXN', required — Currency of the line item, as an ISO 4217 code. Always matches the invoice currency.
  - `description` string, nullable, required — Additional details about the line item shown on the invoice. `null` when the line item has no description.
  - `name` string, required — Display name for the line item shown on the invoice.
  - `period_end` string, date-time, nullable, required — ISO 8601 datetime in UTC marking the end of the billing period covered by the line item. `null` for line items on invoices not tied to a subscription.
  - `period_start` string, date-time, nullable, required — ISO 8601 datetime in UTC marking the start of the billing period covered by the line item. `null` for line items on invoices not tied to a subscription.
  - `quantity` integer, required — Number of units billed by the line item.

## Other responses

- `400` — Invalid request. One of the following is true: `amount` or `quantity` is not a positive integer; `currency` is unknown or does not match the invoice currency; a date is malformed; or the requested `period_end` is before the requested `period_start`.
- `401` — Invalid or missing API key.
- `404` — The invoice does not exist, belongs to another organization, belongs to a different mode than the API key, or the line item does not belong to the invoice.
- `409` — The line item cannot be updated: the invoice is not in `draft` status, or a partial update would leave `period_end` before `period_start`.

---

[API](https://skmtc.net/fintoc/apis/fintoc-api.md) · [All operations](https://skmtc.net/fintoc/apis/fintoc-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fintoc/fintoc-api/revisions/9dafa63688a3/schema)
