Cancel an invoice
POST
/invoices/{id}/void
const url = 'https://example.com/invoices/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/void';const options = { method: 'POST', headers: {cookie: 'bottle.session_token=<bottle.session_token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/invoices/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/void \ --cookie bottle.session_token=<bottle.session_token>Kept on the books marked cancelled rather than deleted: a number that vanishes is a question from the accountant.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
UUID v7
string format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Responses
Section titled “Responses”Cancelled
Media typeapplication/json
object
id
required
UUID v7
string format: uuid
customerId
required
UUID v7
string format: uuid
customerName
required
string | null
billToAddress
required
Array<string>
orderId
required
UUID v7
string | null format: uuid
number
required
string
status
required
string
periodFrom
required
string | null format: date
periodTo
required
string | null format: date
issuedOn
required
string format: date
dueOn
required
string format: date
netPence
required
integer
vatPence
required
integer
totalPence
required
integer
lines
required
Array<object>
object
id
required
UUID v7
string format: uuid
productId
required
UUID v7
string | null format: uuid
description
required
string
quantity
required
number
unitPrice
required
integer
vatRate
required
integer
netPence
required
integer
paymentLink
required
string | null format: uri
paidAt
required
string | null format: date-time
paidVia
required
string | null
cashTakenPence
required
integer
sentAt
required
string | null format: date-time
createdAt
required
string format: date-time
Example
{ "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "customerId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "orderId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "number": "INV-0042", "status": "sent", "lines": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "paidVia": "stripe"}Not signed in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not a member, or without the permission this needs
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}No such invoice
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Only an unpaid invoice can be cancelled
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
Media typeapplication/json
object
error
required
string
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}