Skip to main content
POST
Bulk Delete Invoices
← Invoices API
Deprecated. Use POST /v2/invoices/delete: up to 5,000 invoices of any category per request, idempotent, deleted asynchronously with their distributed siblings and emissions, with webhooks. To also move to the trash the uploaded files that no record uses after the delete (delete_source_files), use this endpoint: the v2 delete does not. This endpoint keeps working; its responses carry Deprecation and Link: </v2/invoices/delete>; rel="successor-version" headers. Its responses also carry Sunset: Fri, 30 Apr 2027 00:00:00 GMT: the endpoint is retired on April 30, 2027 (see the changelog).
Delete multiple invoices by their IDs. Invoices must belong to the specified facility and match the given type. Related emission records and distributed siblings are automatically cleaned up.

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Body Parameters

string[]
required
Array of invoice UUIDs to delete (1–100,000)
string
required
UUID of the facility the invoices belong toRetrieve available options from GET /v1/facilities
string
required
Invoice type: electricity, heat, water, recharge
boolean
default:"false"
Also move to the trash the files uploaded for these records that no record uses after the delete.

Response

integer
Number of invoices successfully deleted
string[]
UUIDs of successfully deleted invoices
integer
Number of invoices that failed to delete
string[]
UUIDs of invoices that failed to delete
string
Human-readable summary message

Example

Successful Response

Common Errors

401 Unauthorized

Cause: Missing or invalid API key

403 Forbidden

Cause: The authenticated user is not a member of the organization

422 Unprocessable Entity

Cause: Missing required fields or invalid invoice type

422 Net consumption below zero

Cause: The selection would take a facility’s consumption of one energy (same fuel and unit, all its invoices added up) below zero, because of the credit notes (negative invoices) left out of it. Nothing is deleted. Include the credit notes, or delete them first.
A companion endpoint, POST /v1/invoices/bulk-delete-preview, returns what a bulk delete would remove before you confirm it. It is not documented yet.

Bulk Delete by Filters

Delete invoices matching filter criteria