# Delete an invoice item

Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.

## Prerequisites

Before you can run the following code snippet, you need to call these APIs with the provided parameters to set up the prerequisite API object(s).

1. createCustomer
POST /v1/customers {"name":"Jenny Rosen","email":"jennyrosen@example.com"}
2. createPrice
POST /v1/prices {"currency":"usd","unit_amount":1000,"recurring":{"interval":"month"},"product_data":{"name":"Gold Plan"}}
3. createInvoiceitem
POST /v1/invoiceitems {"customer":"${node.prerequisites.createCustomer.createCustomer:id}","pricing":{"price":"${node.prerequisites.createPrice.createPrice:id}"}}

## Request

```curl
curl -X DELETE https://api.stripe.com/v1/invoiceitems/{{INVOICEITEM_ID}} \
  -u "<<YOUR_SECRET_KEY>>"
```

### Response

```json
{
  "id": "ii_1MtGUtLkdIwHu7ixBYwjAM00",
  "object": "invoiceitem",
  "deleted": true
}
```

## Returns

An object with the deleted invoice item’s ID and a deleted flag upon success. Otherwise, this call raises [an error](https://docs.stripe.com/api/invoiceitems/delete.md#errors), such as if the invoice item has already been deleted.
