# Delete an invoice item

> The invoice_items.delete operation: DELETE /api/v1/invoice_items/{id} in the REST API and the invoice_items_delete tool in the MCP server.

Deletes an invoice item that isn't billed yet: a pending item, or a line of a draft. Items of a finalized or
voided invoice are part of its record and stay. Returns the deleted item.

## At a glance

- **REST:** `DELETE /api/v1/invoice_items/{id}`
- **MCP tool:** `invoice_items_delete`
- **Operation ID:** `invoice_items.delete`
- **Scope:** Brand
- **Permission:** `invoices:write`
- **Risk tier:** `write`
- **Dry run:** Supported (send `Ownrecord-Dry-Run: true`)
- **Idempotency:** `Idempotency-Key` optional
- **Modes:** Test and live
- **Authentication:** API key with the `invoices:write` scope
- **Since:** M5

## Request

### Path parameters

| Field | Type      | Description                   |
| ----- | --------- | ----------------------------- |
| `id`  | `ii_…` ID | The invoice item ID (`ii_…`). |

### Body

This operation takes no body.

## Response

`200 OK` with a JSON object:

| Field            | Type                                                                                                   | Description                                                                      |
| ---------------- | ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------- |
| `id`             | `ii_…` ID                                                                                              |                                                                                  |
| `object`         | `"invoice_item"`                                                                                       |                                                                                  |
| `livemode`       | boolean                                                                                                |                                                                                  |
| `customerId`     | `cus_…` ID                                                                                             |                                                                                  |
| `subscriptionId` | `sub_…` ID or null                                                                                     |                                                                                  |
| `invoiceId`      | `inv_…` ID or null                                                                                     | The invoice the item is on; null while it waits for the customer's next invoice. |
| `origin`         | one of `pending`, `invoice`                                                                            | `invoice`: created for a draft; `pending`: created for the next invoice.         |
| `description`    | string                                                                                                 |                                                                                  |
| `productId`      | `prod_…` ID                                                                                            |                                                                                  |
| `priceId`        | `price_…` ID or null                                                                                   |                                                                                  |
| `taxCategoryId`  | one of 9 values, e.g. `electronically_supplied_service`, `saas`, `ebook` (all in the OpenAPI document) |                                                                                  |
| `taxBehavior`    | one of `inclusive`, `exclusive`                                                                        |                                                                                  |
| `quantity`       | integer                                                                                                |                                                                                  |
| `unitAmount`     | money                                                                                                  |                                                                                  |
| `amount`         | money                                                                                                  | Quantity × unit amount.                                                          |
| `period`         | object or null                                                                                         |                                                                                  |
| `proration`      | boolean                                                                                                |                                                                                  |
| `taxDate`        | date-time or null                                                                                      | The date whose tax rates apply (a proration's change date).                      |
| `metadata`       | object                                                                                                 |                                                                                  |
| `createdAt`      | date-time                                                                                              |                                                                                  |
| `updatedAt`      | date-time                                                                                              |                                                                                  |

## Examples

### Remove a line from a draft

```http
DELETE /api/v1/invoice_items/ii_01m4tx5nj8emwbyf7y9vcf47ys
Authorization: Bearer or_test_…
```

Response (`200`):

```json
{
  "id": "ii_01m4tx5nj8emwbyf7y9vcf47ys",
  "object": "invoice_item",
  "livemode": false,
  "customerId": "cus_01m4tx5nj8emwbyf7y9vcf47ym",
  "subscriptionId": null,
  "invoiceId": "inv_01m4tx5nj8emwbyf7y9vcf47yk",
  "origin": "invoice",
  "description": "Implementation workshop (days)",
  "productId": "prod_01m4tx5nj8emwbyf7y9vcf47yr",
  "priceId": null,
  "taxCategoryId": "consulting_remote",
  "taxBehavior": "exclusive",
  "quantity": 2,
  "unitAmount": {
    "amount": "600000000",
    "currency": "EUR"
  },
  "amount": {
    "amount": "1200000000",
    "currency": "EUR"
  },
  "period": null,
  "proration": false,
  "taxDate": null,
  "metadata": {},
  "createdAt": "2026-10-20T08:30:00.000Z",
  "updatedAt": "2026-10-20T08:30:00.000Z"
}
```

## Errors

| Code                                                                                             | HTTP status | When                                                                                   | What to do                                                                                                                                                                                                                                                               |
| ------------------------------------------------------------------------------------------------ | ----------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [`validation_failed`](https://ownrecord.io/docs/reference/errors.md#validation_failed)           | 400         | `id` isn't an invoice item ID (`ii_…`).                                                | Fix the fields listed in `details.issues` and send the request again.                                                                                                                                                                                                    |
| [`resource_not_found`](https://ownrecord.io/docs/reference/errors.md#resource_not_found)         | 404         | This brand has no such invoice item in this mode.                                      | Check the ID and that your credentials are scoped to the right organization, entity, brand and mode.                                                                                                                                                                     |
| [`invoice_status_invalid`](https://ownrecord.io/docs/reference/errors.md#invoice_status_invalid) | 409         | The item is on a finalized or voided invoice: it's part of that invoice's record.      | Check the invoice's `status` (`details.status`) and what it still allows (`details.allowed_actions`). Drafts are edited and finalized; open invoices are sent, paid, voided or marked uncollectible; paid and void invoices don't change (corrections are credit notes). |
| [`version_conflict`](https://ownrecord.io/docs/reference/errors.md#version_conflict)             | 409         | The item changed at the same moment; retry.                                            | Fetch the object again and retry the change.                                                                                                                                                                                                                             |
| [`scope_required`](https://ownrecord.io/docs/reference/errors.md#scope_required)                 | 400         | The request names no brand (an org or entity key without `Ownrecord-Brand`).           | Call the operation with credentials or a target at its level: an organization, a legal entity, a brand or the platform (`details.required_scope`).                                                                                                                       |
| [`permission_denied`](https://ownrecord.io/docs/reference/errors.md#permission_denied)           | 403         | You can't change this brand's invoices (`invoices:write`: finance, owners and admins). | Ask an organization owner or admin for a role or scope that allows this action.                                                                                                                                                                                          |
| [`livemode_not_allowed`](https://ownrecord.io/docs/reference/errors.md#livemode_not_allowed)     | 403         | You have no live-mode access, so you can't use live invoices.                          | Use test mode, or credentials for the target's mode. Developers need live access granted by an organization owner or admin.                                                                                                                                              |

It can also return these [common errors](https://ownrecord.io/docs/reference.md#common-errors): [`api_version_unsupported`](https://ownrecord.io/docs/reference/errors.md#api_version_unsupported), [`invalid_json`](https://ownrecord.io/docs/reference/errors.md#invalid_json), [`unsupported_media_type`](https://ownrecord.io/docs/reference/errors.md#unsupported_media_type), [`authentication_required`](https://ownrecord.io/docs/reference/errors.md#authentication_required), [`api_key_invalid`](https://ownrecord.io/docs/reference/errors.md#api_key_invalid), [`idempotency_key_reused`](https://ownrecord.io/docs/reference/errors.md#idempotency_key_reused), [`idempotency_in_progress`](https://ownrecord.io/docs/reference/errors.md#idempotency_in_progress), [`approval_required`](https://ownrecord.io/docs/reference/errors.md#approval_required), [`approval_rejected`](https://ownrecord.io/docs/reference/errors.md#approval_rejected), [`approval_expired`](https://ownrecord.io/docs/reference/errors.md#approval_expired), [`stale_approval`](https://ownrecord.io/docs/reference/errors.md#stale_approval), [`approval_policy_denied`](https://ownrecord.io/docs/reference/errors.md#approval_policy_denied), [`rate_limited`](https://ownrecord.io/docs/reference/errors.md#rate_limited), [`internal_error`](https://ownrecord.io/docs/reference/errors.md#internal_error).
