Invoices API
The Invoices API allows you to retrieve, update, and delete invoice records for tracking energy consumption emissions. Invoices cover multiple energy sources including electricity, natural gas, fuel deliveries, water, electric vehicle recharging, and industrial processes.GHG Protocol — Multiple ScopesInvoices cover emissions across multiple GHG Protocol scopes:
- Scope 1: Direct emissions from fuel combustion —
heat,recharge, andprocessinvoices - Scope 2: Indirect emissions from purchased energy —
electricityinvoices
Key Features
- Discriminated Response: Response shape varies by invoice type (
heat,electricity,water,recharge,process) - 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: Support for electricity, heat, water, recharging, and process invoices
Authentication
All endpoints require authentication using either:- API Key: Include in
x-api-keyheader - JWT Token: Include in
Authorizationheader asBearer {JWT_TOKEN}
Headers
All requests must include:Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faYour API key for authenticationExample:
sk_live_1234567890abcdefAvailable Endpoints
List Invoices
Retrieve all invoices with filtering and pagination
Get Invoice
Get a specific invoice by ID with full detail
Update Invoice
Modify invoice details
Delete Invoice
Remove an invoice from your organization
Data Model
Invoice Object
The invoice object contains detailed information about an energy or utility invoice. The response is a discriminated union — thetype field determines which additional fields are present:
Invoice Attributes
| Field | Type | Description |
|---|---|---|
id | UUID | Unique identifier for the invoice |
type | string | Invoice type: heat, electricity, water, recharge, process |
quantity | float | Consumption amount after facility allocation |
base_quantity | float | Original consumption amount before facility allocation |
percentage | float | Facility allocation percentage (0-1) |
status | string | Invoice status (see Status Types) |
co2e | float | Calculated CO2 equivalent emissions (kg) |
co2e_biomass | float | CO2e from biomass sources (kg) |
start_date | datetime | Billing period start date |
end_date | datetime | Billing period end date |
unit_id | UUID | Unit of measurement |
original_quantity | float | Original quantity before conversions |
original_unit_id | UUID | Original unit before conversions |
facility_id | UUID | Associated facility |
uploaded_by | UUID | User who uploaded the invoice |
invoice_id | string | External invoice identifier from utility provider |
cups | string | CUPS code (for Spanish electricity) |
file_url | string | URL to download linked file |
source_invoice_id | UUID | Source invoice (if derived from another invoice) |
enabled | boolean | Whether invoice is enabled |
created_at | datetime | When the invoice was created |
updated_at | datetime | When the invoice was last updated |
toc_id | UUID | TOC identifier |
invofox_id | string | Invofox integration ID |
facility_percentages | array | Facility percentage allocations (see below) |
Type-Specific Fields
| Field | Types | Description |
|---|---|---|
facility_fuel_id | heat, recharge | Fuel type UUID |
custom_emission_factor_id | heat, electricity, recharge | Custom emission factor UUID |
custom_emission_factor | heat, electricity, recharge | Custom emission factor details (object) |
supplier_id | heat, electricity, recharge | Energy supplier UUID |
Facility Percentage Object
| Field | Type | Description |
|---|---|---|
organization_id | UUID | Organization UUID |
facility_id | UUID | Facility UUID |
percentage | float | Allocation percentage (0-1) |
company_name | string | Company name |
facility_name | string | Facility name |
Invoice Types
| Type | Description | GHG Scope |
|---|---|---|
heat | Natural gas and fuel delivery invoices | Scope 1 |
electricity | Electricity consumption invoices | Scope 2 |
water | Water consumption invoices | Scope 3 (if applicable) |
recharge | Electric vehicle recharging | Scope 2 |
process | Industrial process emissions | Scope 1 |
Status Types
| Status | Description |
|---|---|
uploaded | Invoice uploaded, awaiting processing |
loading | Invoice being processed |
active | Invoice active and included in calculations |
inactive | Invoice inactive (excluded from calculations) |
review | Invoice under review |
error | Error occurred during processing |
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
| Status | Meaning | Solution |
|---|---|---|
| 200 | Success | - |
| 204 | No Content (delete successful) | - |
| 400 | Bad Request | Check request parameters and format |
| 401 | Unauthorized | Verify API key |
| 403 | Forbidden | Invoice doesn’t belong to your organization |
| 404 | Not Found | Check resource ID |
| 422 | Validation Error | Review error details in response |
| 500 | Server Error | Contact support if persists |

