---
title: "Deletes a draft invoice."
method: DELETE
path: "/api/v1/invoices/{id}"
tags: ["Invoices"]
---

# Deletes a draft invoice.

`DELETE /api/v1/invoices/{id}`

## Request

- Base URL: `https://app.flexonthejob.com`
- URL: `https://app.flexonthejob.com/api/v1/invoices/{id}`
- Auth: HTTP bearer

Requires `ManageInvoices` and an `Idempotency-Key` header; no body. The API twin of
the draft invoice page's "Delete Draft" button. Only a `Draft` can be deleted — a
finalized invoice is voided instead (`POST /api/v1/invoices/{id}/void`). A consolidated
draft, or a draft carrying a payment other than the job's transferred down payment, is refused.
Money goes back where it came from: the job's down payment returns to the job (the next
invoice re-applies it), applied store credit returns to the customer, and the job's or sales
order's payment status is recalculated. A job moved from `Completed` to `Invoiced` by
generating this draft goes back to `Completed` when no other non-voided invoice remains
(counter-sales organizations keep `Invoiced`); its stock movements stay, and the job can
simply be invoiced again (`POST /api/v1/invoices/from-job`).
Deletion is permanent — there is no restore, and the invoice, its lines, payments and notes
disappear from every synced device. Fires `invoice.deleted`. Repeating the request with the
same `Idempotency-Key` replays the 204; a new key for an already-deleted id gets 404.
The deletion is recorded on the job's history, attributed to the user who created the key.
Example: `DELETE /api/v1/invoices/57`.

## Path parameters

- `id` integer, required

## Response `204`

The draft invoice was deleted; no body.

## Other responses

- `400`: Missing `Idempotency-Key`.
- `401`: Unauthorized
- `403`: Forbidden
- `404`: No such invoice in the calling organization (or it was already deleted).
- `409`: The invoice is not a draft (void it instead), is a consolidated invoice, has recorded payments, or the key's creator is unknown on this server — the `detail` says which.
- `429`: Too Many Requests
- `500`: The deletion could not be saved.

---

[API](https://skmtc.dev/flexonthejob/apis/flex-api.md) · [All operations](https://skmtc.dev/flexonthejob/apis/flex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flexonthejob/apis/flex-api/revisions/19c8f4d27acf?raw)
