Delete invoices of a company (group level)
const url = 'https://app.commitly.com/api/companies/117/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/companies/117/invoices/ \ --header 'Authorization: Bearer <token>'Warning: A DELETE without
id,referenceorsource_iddeletes every invoice of the company these credentials can access (narrowed only by list filters sent in the same request) and still returns 204. Always send a selector.
Group level, requires Enterprise Edition. Deletes the selected invoices of
the given company. Same selectors as DELETE /invoices/:
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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ID of a company in the group.
Example
117Query 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."}The resource does not exist or is not accessible with these credentials.
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Examplegenerated
{ "detail": "example", "code": "example"}
