Skip to main content
POST
← Invoices API Delete invoices by id, whatever their category, with their emissions. The request checks every id and answers 202 Accepted with a job; the invoices are deleted in the background. Follow it with GET /v2/ingest-jobs/{id} or the ingest_job.finished webhook.
Permanent. Deleted invoices and their emissions cannot be recovered. Use dry_run=true first if you are not sure.
Beta. Part of the bulk ingest API, currently in beta. The contract may still change before general availability.

How it works

  1. The request checks every id. One that does not exist, is outside your organization’s perimeter or repeats an invoice already in the request rejects the whole request with 422, and nothing is deleted.
  2. An invoice split across facilities goes whole, whichever of its per-facility invoices the id names.
  3. Invoices imported by Datadis are refused (DATADIS_MANAGED): the next sync would bring them back. Remove the supply contract instead.
  4. The job deletes them in the background with their emissions and calculation data. When every chunk is done the job is completed (or completed_with_errors), and ingest_job.finished is sent with "operation": "delete".

Request

Headers

string
required
Your API key for authentication
string
required
Your organization UUID
string
required
1 to 255 characters, unique per batch. A retry with the same key and body returns the original job; the same key with another body is 422 IDEMPOTENCY_KEY_REUSED.

Query Parameters

boolean
default:"false"
Check only: the same 422 for bad ids, nothing deleted, no job.

Body Parameters

array[uuid]
required
Invoice ids, of any category, 1 to 5,000, each invoice once.

Response

202 Accepted, the job (operation: delete) and a Location header to it. One item per invoice, in the order sent.

Errors

Problem details. Per-id codes in errors[].error_code:

Create Electricity Invoices (v2)

Create up to 5,000 electricity invoices

Get Ingest Job

Follow the deletion