---
title: "Remove invoice lines"
method: POST
path: "/invoices/{id}/remove_lines"
tags: ["Invoices"]
---

# Remove invoice lines

`POST /invoices/{id}/remove_lines`

Removes one or more line items from a draft invoice and recalculates the invoice total. Pass the `id` of every line item to remove. If any `id` does not belong to a line item of the invoice, the whole request fails and no line item is removed. The invoice must be in `draft` status.

## Path parameters

- `id` string, required

## Request body

- object
  - `lines` string[], required — `id`s of the line items to remove from the invoice. Must contain at least one `id`, and every `id` must belong to a line item of the invoice.

## Response `200`

The updated invoice, without the removed line items and with the recalculated total.

- Invoice
  - `id` string, required — Unique identifier of the invoice.
  - `hosted_invoice_url` string, nullable, required — URL of the hosted invoice page, where your customer can view and pay the invoice. `null` for `test` mode invoices and for invoices that are not `open`.
  - `object` 'invoice', required — Type of the object. Always `invoice`.
  - `attempt_count` integer, required — Number of automatic charge attempts Fintoc has made on the invoice. `0` until the invoice is finalized and charged for the first time.
  - `created_at` string, date-time, required — ISO 8601 timestamp of when the invoice was created.
  - `currency` 'CLP' | 'MXN', required — Currency of the invoice, as an ISO 4217 code. Every line item uses this currency.
  - `customer` string, required — `id` of the customer the invoice bills.
  - `default_payment_method` string, nullable, required — `id` of the payment method Fintoc charges when the invoice is finalized. `null` for invoices without one, such as subscription invoices.
  - `lines` InvoiceLineItem[], required — Line items that make up the invoice total.
    - `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.
  - `metadata` object, nullable, required — Set of key-value pairs attached to the invoice. `null` when the invoice has no metadata.
  - `mode` 'live' | 'test', required — Mode of the invoice. `live` invoices use real data; `test` invoices use fake data for integration testing. An API key only sees invoices that share its mode.
  - `next_payment_attempt_at` string, date-time, nullable, required — ISO 8601 timestamp of the next scheduled automatic charge attempt. `null` when no further attempt is scheduled.
  - `payments` object[], required — Payment attempts to collect the invoice.
    - `amount` integer, required — Amount of the payment, 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 payment, as an ISO 4217 code. Always matches the invoice currency.
    - `payment_intent` string, required — `id` of the payment intent created to collect the invoice.
    - `status` 'pending' | 'succeeded' | 'failed', required — Status of the payment attempt.
  - `status` 'draft' | 'open' | 'paid' | 'void', required — Status of the invoice. Invoices start as `draft`, become `open` when finalized, and end as `paid` or `void`.
  - `subscription` string, nullable, required — `id` of the subscription that generated the invoice. `null` for invoices not tied to a subscription.
  - `total` integer, required — Total amount of the invoice, in the smallest unit of `currency` (for example, `30000` for $30000 CLP, since CLP has no minor unit, or `3000` for $30.00 MXN). Equals the sum of the line item amounts.

## Other responses

- `400` — Invalid request: `lines` is missing or empty.
- `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 one of the line items does not belong to the invoice.
- `409` — The invoice is not editable: line items can only be removed while the invoice is in `draft` status.

---

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