---
title: "Remove a line item from an invoice"
method: DELETE
path: "/public-api/v1/invoices/{invoice_id}/invoice_items/{id}"
tags: ["Invoices"]
---

# Remove a line item from an invoice

`DELETE /public-api/v1/invoices/{invoice_id}/invoice_items/{id}`

## Request

- Base URL: `https://app.hellobonsai.com`
- URL: `https://app.hellobonsai.com/public-api/v1/invoices/{invoice_id}/invoice_items/{id}`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://app.hellobonsai.com/oauth/authorize`
    - Token URL: `https://app.hellobonsai.com/oauth/token`
  - HTTP bearer

Removes one line item and recalculates the invoice total. The response
hands back the item as it was, so you can log or reinstate it.

Any time entries that were billed through this line item go back to
unbilled and can be invoiced again.

Only invoices that have not been paid for work here. An invoice that is
paid, partially paid, or has a payment in progress is closed to changes
and returns `403`.

## Response `200`

The line item was removed. Its final state is in `data`.

- object
  - `data` InvoiceItem, required: A single line on an invoice: what you are billing for, how much of it, and at what rate.
    - `id` integer, required: Unique identifier for the line item.
    - `name` string, nullable, required: Line item name, as it appears on the invoice.
    - `description` string, nullable, required: Longer description shown beneath the name, or `null`.
    - `amount` string, nullable, required: Quantity billed, as a decimal string.
    - `rate` string, nullable, required: Price per unit, as a decimal string in the invoice currency.
    - `unit_type` 'flat' | 'per_hour' | 'per_day' | 'per_item' | 'per_word' | 'per_week' | 'per_month' | 'per_year' | 'per_quarter' | 'null', nullable, required: What the rate is charged per. Defaults to `flat`.
    - `total` string, required: `amount` multiplied by `rate`, rounded, as a decimal string.
  - `meta` Meta, required: Metadata returned alongside every single-resource response.
    - `request_id` string, required: Identifier for this request. Quote it when contacting support about a specific call.

## Other responses

- `401`: The access token is missing, expired or invalid.
- `403`: This token is not allowed to edit invoices, or the invoice is paid, partially paid, or has a payment in progress and can no longer be changed.
- `404`: No such invoice or line item that this token can see.
- `429`: Rate limit exceeded. Wait at least `Retry-After` seconds before trying again.

---

[API](https://skmtc.dev/hellobonsai/apis/bonsai-api.md) - [All operations](https://skmtc.dev/hellobonsai/apis/bonsai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hellobonsai/apis/bonsai-api/revisions/abf12ed6a8d3?raw)
