Delete invoices
const url = 'https://app.commitly.com/api/invoices/';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://app.commitly.com/api/invoices/ \ --header 'Authorization: Bearer <token>'Warning: A DELETE without
id,referenceorsource_iddeletes every invoice these credentials can access (narrowed only by list filters sent in the same request) and still returns 204. Always send a selector.
Deletes the invoices selected by one of these query parameters:
reference: exact match on the invoice number. Repeat the parameter to delete several invoices (?reference=AR-007&reference=AR-008).id: internal invoice ID.source_idtogether withsource.
There is no path per reference; /invoices/{id}/ uses the internal ID only.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Invoice number, exact match. Repeat the parameter to select several invoices.
Internal invoice ID.
source_id of the invoice. Send together with source.
source of the invoice. Send together with source_id.
Responses
Section titled “Responses”Selected invoices deleted.
The access token is invalid or has expired. Request a new token. The message is
localized (see Accept-Language).
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Example
{ "detail": "Invalid token."}Headers
Section titled “Headers”Authentication scheme, Bearer.
Example
BearerNo access token was sent, or the credentials are not allowed to call this
endpoint. If the company’s COMMITLY edition does not include the requested
function, the body additionally contains
"code": "billing_plan_permission_denied".
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Example
{ "detail": "User must be authenticated to access this resource."}
