DELETE
/api/Invoices/{id}
const url = 'https://example.com/api/Invoices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://example.com/api/Invoices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>'Deletes a Draft invoice. Sent or Paid invoices should be Voided instead - this is rejected.
The invoice is retained internally for history, but it is gone from this API: it disappears from the list endpoint and every read of it answers 404 afterwards. Its invoice number becomes free to reuse, and any transaction that referenced it keeps doing so.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string format: uuid
The invoice’s unique identifier.
Responses
Section titled “ Responses ”Invoice deleted.
No invoice with the given ID exists, or it has already been deleted.
Media type application/json
object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}The invoice isn’t a Draft, so it can’t be deleted. Void it instead.
Media type application/json
object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}