Skip to main content
GET
List Units

List Units

Retrieve all measurement units available in the Dcycle system. These units are used when creating invoices, purchases, and other consumption records to specify quantities.
Units are reference data maintained by Dcycle. You cannot create or modify units through the API - this endpoint is read-only.

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: ff4adcc7-8172-45fe-9cf1-e90a6de53aa9
string
required
Your user UUIDExample: a1b2c3d4-e5f6-7890-abcd-ef1234567890

Query Parameters

string
Filter units by type categoryValid values:
  • energy - Energy units (kWh, MWh, GJ, etc.)
  • gas - Gas volume units (m³, ft³, etc.)
  • liquid - Liquid volume units (L, m³, gal, etc.)
  • solid - Solid mass/volume units (kg, ton, m³, etc.)
  • fiat_currency - Currency units (EUR, USD, etc.)
  • dimensionless - Unitless quantities
  • substance - Chemical substance units
  • waste_water_treatment_dbo - Biochemical oxygen demand
  • waste_water_treatment_dbo_out - BOD output measurements
  • waste_water_treatment_ch4 - Methane measurements
  • waste_water_treatment_nitrogen - Nitrogen measurements
  • waste_water_treatments_flow_total - Flow rate measurements
  • area_time - Area-time combined units
  • toxicity - Toxicity measurements
  • radioactivity - Radioactivity measurements
  • purchases_supplier_specific - Supplier-specific purchase units
Example: "energy"

Response

Returns an array of unit objects (not paginated - all matching units are returned).
array
Array of unit objects

Unit Object Fields:

string
Unique unit identifier (UUID v4)
string
Human-readable unit name (e.g., “kWh”, “m³”, “kg”)
string
Unit type category (see valid values above)

Example

Successful Response

Common Errors

400 Bad Request - Invalid Type

Cause: Invalid unit type
Solution: Verify that the type parameter matches one of the valid values listed above.

403 Forbidden

Cause: Organization ID doesn’t match your API key or user doesn’t belong to organization
Solution: Verify that x-organization-id matches your API key’s organization.

Use Cases

Get Energy Units for Invoice Creation

When creating an invoice, you need the unit ID for the base_quantity field:

Get All Units for Dropdown Selector

Build a complete unit selector for your application:

Cache Units for Performance

Since units are reference data that rarely changes, cache them:

Unit Types Breakdown

Most Common Types

Energy Units (type: "energy"):
  • Used for electricity invoices
  • Common units: kWh, MWh, GJ, kWh HHV, kWh LHV
  • Example: Electricity consumption from utility bills
Gas Units (type: "gas"):
  • Used for natural gas, propane, other gaseous fuels
  • Common units: m³, ft³, Nm³
  • Example: Natural gas heating consumption
Liquid Units (type: "liquid"):
  • Used for liquid fuels (diesel, gasoline, etc.)
  • Common units: L, m³, gal, bbl
  • Example: Diesel fuel for generators
Solid Units (type: "solid"):
  • Used for solid fuels and materials
  • Common units: kg, ton, tonne, lb
  • Example: Coal, biomass, waste materials

Specialized Types

Waste Water Treatment Units:
  • waste_water_treatment_dbo - Biochemical oxygen demand input
  • waste_water_treatment_dbo_out - BOD after treatment
  • waste_water_treatment_ch4 - Methane emissions from treatment
  • waste_water_treatment_nitrogen - Nitrogen content
  • waste_water_treatments_flow_total - Total flow rate
Other Specialized Units:
  • fiat_currency - For financial calculations (EUR, USD, etc.)
  • purchases_supplier_specific - Custom units from suppliers
  • substance - Chemical substances (kg CO2, kg NOx, etc.)
  • dimensionless - Ratios, percentages, counts
  • toxicity - Toxicity equivalents
  • radioactivity - Radioactive measurements

Best Practices

1. Cache Reference Data

Since units don’t change frequently, cache them in your application:

2. Use Type Filtering

Filter by type when you know the invoice category:

3. Store Unit IDs in Configuration

For common units, store their IDs in your configuration:

4. Validate Units Before Invoice Creation

Check that the unit type matches the invoice type:

Create Invoice

Create invoices using unit IDs

List Invoices

View invoices with their units

List Suppliers

Get suppliers for invoices

Authentication

Learn about API authentication