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: '__Host-bottle.session_token=<__Host-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 __Host-bottle.session_token=<__Host-bottle.session_token>Kept on the books marked cancelled rather than deleted: a number that vanishes is a question from the accountant. Cancelling a customer’s latest weekly, monthly or quarterly invoice also puts its orders and deposit refunds back as unbilled, and its period back on their pending invoice for the usual date.
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
replacesInvoiceId
required
UUID v7
string | null format: uuid
reissueReason
required
string | null
voidedAt
required
string | null format: date-time
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
deliveredOn
required
string | null format: date
orderReference
required
string | null
customerReference
required
string | null
quantity
required
number
unitPrice
required
integer
priceIncludesVat
required
boolean
vatRate
required
integer
netPence
required
integer
vatPence
required
integer
paymentLink
required
string | null format: uri
paidAt
required
string | null format: date-time
paidVia
required
string | null
paymentProvider
required
string | null
cashTakenPence
required
integer
receivedPence
integer
balanceDuePence
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", "replacesInvoiceId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "lines": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "paidVia": "online"}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" } ]}