Skip to main content
The Invoices API lets you send, read, update and delete the invoices of what a facility consumes: electricity, fuels burned on site (natural gas, diesel…), refrigerant gas recharged, water, heat or cold bought from a district network, and industrial process emissions. Dcycle calculates the emissions of every invoice. To send invoices, use the v2 route of their kind (see which route to use): up to 5,000 per request, each route taking only the fields that kind of invoice has. To read or update them one by one, use the /v1/invoices routes below; they see the invoices sent through v2 too. To delete them, of any kind, use POST /v2/invoices/delete.
GHG Protocol — Multiple ScopesInvoices cover emissions across multiple GHG Protocol scopes:
  • Scope 1: direct emissions: fuel burned on site (heat), refrigerant gas that leaked and was recharged (recharge) and industrial processes (process)
  • Scope 2: indirect emissions of energy bought: electricity and district heating or cooling (district_heat_and_steam)
  • Scope 3: the upstream of fuels (well-to-tank), the generation and transmission & distribution of electricity and of district heating or cooling, and water
This API helps you manage the data needed for accurate Scope 1 and 2 reporting.

Key Features

  • Discriminated Response: Response shape varies by invoice type (heat, electricity, water, recharge, process, district_heat_and_steam)
  • Facility Allocation: View how invoices are allocated across facilities with percentage breakdowns
  • CO2e Tracking: View calculated emissions including biomass breakdown for each invoice
  • Custom Emission Factors: Support for supplier-specific and custom emission factors
  • Multiple Energy Types: electricity, fuels, refrigerants, water, district heating and cooling, and process emissions

Which route to use

Each kind of consumption has its own v2 create route. The table also says how v1 stores it (type), which units it takes and which activity_categories a custom emission factor record needs to be usable on it. Every route also needs the facilities and the unit: facility_percentages lists each facility (an id from List Facilities) with its share of the invoice, [{"facility_id": "...", "percentage": 1}] when it is all one facility’s, and unit_id comes from List Units.

Sending invoices (v2)

The v2 routes share one contract, the bulk ingest API (see how bulk ingestion works):
  1. Send 1 to 5,000 invoices in records, with an Idempotency-Key header. Every record is checked first: if any is invalid the whole request is rejected (422 BULK_RECORDS_REJECTED: rejected is the number of invalid records and errors lists them, up to 100) and nothing is written. ?dry_run=true runs the checks only.
  2. The answer is 202 Accepted with an ingest job: the invoices are already written (status loading), and the job calculates their emissions in the background.
  3. Follow the job with GET /v2/ingest-jobs/{id}, or, for a job submitted with an API key, receive the ingest_job.finished webhook when it ends.
  4. Read the outcome per record with GET /v2/ingest-jobs/{id}/items: each item has the invoice id (entity_id) and, if it could not be calculated, an error_code. Then read the invoices and their emissions with List Invoices.
To delete invoices of any kind in bulk, use POST /v2/invoices/delete, which works the same way.

Authentication

All endpoints require authentication using an API key included in the x-api-key header (see Authentication).

Headers

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

Available Endpoints

List Invoices

Retrieve all invoices with filtering and pagination

Get Invoice

Get a specific invoice by ID with full detail

Create Electricity Invoices (v2)

Up to 5,000 electricity invoices per request, only the fields electricity needs

Create Fuel Invoices (v2)

Up to 5,000 fuel (stationary combustion) invoices per request

Create Refrigerant Invoices (v2)

Up to 5,000 refrigerant recharges (fugitive emissions) per request

Create Water Invoices (v2)

Up to 5,000 water invoices per request

Create District Heating Invoices (v2)

Up to 5,000 district heating invoices per request

Create District Cooling Invoices (v2)

Up to 5,000 district cooling invoices per request

Create Process Invoices (v2)

Up to 5,000 process emissions per request, with your own emission factor

Delete Invoices (v2)

Delete invoices of any category, asynchronously

Create Invoice (v1, deprecated)

Superseded by the v2 route of each kind of invoice

Update Invoice

Modify invoice details

Delete Invoice (v1, deprecated)

Superseded by Delete Invoices (v2)

Data Model

Invoice Object

The invoice object contains detailed information about an energy or utility invoice. The response is a discriminated union — the type field determines which additional fields are present:

Invoice Attributes

Type-Specific Fields

Facility Percentage Object

Invoice Types

Status Types

CO2e Calculation

Emissions are calculated based on invoice type and associated emission factors:

Electricity (Scope 2)

Heat/Combustion (Scope 1)

Process (Scope 1)

Error Handling

Common HTTP Status Codes

Error Response Format

The /v1/invoices routes answer errors as:
The /v2/invoices/* routes answer with problem details (application/problem+json), with one entry per invalid record in errors (up to 100; rejected is the number of invalid records).

Use Cases

Scope 1 and 2 emissions of your invoices

An invoice’s co2e adds every scope it has, scope 3 included. For the scope 1 or 2 part alone:
  • Electricity (scope 2, market-based), fuels (heat, scope 1) and district heating or cooling (scope 2): co2e_consumption of each invoice in List Invoices, or total_co2e_consumption of Totals for one facility and invoice type. The location-based scope 2 of electricity is co2e_location_based.
  • Refrigerants (recharge) and process: scope 1 whole, in co2e.
  • Water: scope 3 whole, in co2e.

Scope 1 & 2 Guide

Complete tutorial for tracking Scope 1 and 2 emissions

Facilities API

Manage facility data

Authentication Guide

Learn how to authenticate API requests

Custom Emission Factors

Your own factors, usable on invoices with custom_ef_record_id

MCP Tools

Query invoice data from AI assistants via MCP