Skip to main content
GET
/
v1
/
invoices
/
filter-options
curl -X GET "https://api.dcycle.io/v1/invoices/filter-options?facility_id=660e8400-e29b-41d4-a716-446655440000&type=heat" \
  -H "x-organization-id: YOUR_ORGANIZATION_ID" \
  -H "x-api-key: YOUR_API_KEY"
{
  "cups": ["ES0022000007171638YH1P"],
  "suppliers": [
    { "id": "770e8400-e29b-41d4-a716-446655440000", "name": "Iberdrola" }
  ],
  "uploaded_by": [
    {
      "id": "990e8400-e29b-41d4-a716-446655440000",
      "first_name": "Ana",
      "last_name": "García",
      "email": "ana@example.com"
    }
  ],
  "sources": ["manual", "datadis", "bulk_file"],
  "stationary_fuels": [
    { "id": "aa0e8400-e29b-41d4-a716-446655440000", "name": "Natural gas" }
  ],
  "facility_fuels": [
    { "id": "bb0e8400-e29b-41d4-a716-446655440000", "name": "Facility boiler" }
  ],
  "supply_contracts": [
    { "id": "cc0e8400-e29b-41d4-a716-446655440000", "name": "ES0022000007171638YH1P" }
  ]
}

Overview

Returns the distinct values that can be used to populate filter dropdowns for the invoices list of a given facility and invoice type (heat, electricity, water, recharge, process, waste_water_treatment). The response represents the universe of values that exist for that facility + type. It is not scoped by the filters the user has already selected — this lets the UI offer cross-filter combinations without a cascade that hides valid options.

Query Parameters

facility_id
UUID
required
Facility whose invoices should be scanned.
type
string
required
Invoice type.Allowed values: heat, electricity, water, recharge, process, waste_water_treatment

Response

cups
string[]
Distinct CUPS codes seen on invoices of that facility + type.
suppliers
array
Suppliers referenced on existing invoices.
uploaded_by
array
Users who have uploaded invoices.
sources
string[]
Distinct invoice sources. Known values: manual, pdf, bulk_file, datadis. Invoices with a NULL source are surfaced as "manual" so the UI can offer a single “Manual” option that also matches legacy rows.
stationary_fuels
array
Stationary fuels referenced on heat invoices.
facility_fuels
array
Facility fuels referenced on existing invoices.
supply_contracts
array
Supply contracts referenced on existing invoices.
curl -X GET "https://api.dcycle.io/v1/invoices/filter-options?facility_id=660e8400-e29b-41d4-a716-446655440000&type=heat" \
  -H "x-organization-id: YOUR_ORGANIZATION_ID" \
  -H "x-api-key: YOUR_API_KEY"
{
  "cups": ["ES0022000007171638YH1P"],
  "suppliers": [
    { "id": "770e8400-e29b-41d4-a716-446655440000", "name": "Iberdrola" }
  ],
  "uploaded_by": [
    {
      "id": "990e8400-e29b-41d4-a716-446655440000",
      "first_name": "Ana",
      "last_name": "García",
      "email": "ana@example.com"
    }
  ],
  "sources": ["manual", "datadis", "bulk_file"],
  "stationary_fuels": [
    { "id": "aa0e8400-e29b-41d4-a716-446655440000", "name": "Natural gas" }
  ],
  "facility_fuels": [
    { "id": "bb0e8400-e29b-41d4-a716-446655440000", "name": "Facility boiler" }
  ],
  "supply_contracts": [
    { "id": "cc0e8400-e29b-41d4-a716-446655440000", "name": "ES0022000007171638YH1P" }
  ]
}