> ## Documentation Index
> Fetch the complete documentation index at: https://code.dcycle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List Suppliers (v2)

> The energy suppliers your organization can use: the ids for supplier_id on electricity and district heating or cooling invoices

[← Invoices API](/api-reference/invoices/overview)

List the suppliers your organization can use: Dcycle's official suppliers plus the custom ones of your organization
and the organizations above and below it. Use their `id` as `supplier_id` in
[electricity](/api-reference/invoices/electricity-create-v2),
[district heating](/api-reference/invoices/district-heating-create-v2) and
[district cooling](/api-reference/invoices/district-cooling-create-v2) invoices. Each route only accepts suppliers of
its own type, so filter by `supplier_type`:

| Invoice route | `supplier_type` |
| - | - |
| `POST /v2/invoices/electricity` | `electricity` |
| `POST /v2/invoices/district-heating` | `heat_steam` |
| `POST /v2/invoices/district-cooling` | `cooling` |

Fuels, water, refrigerants and process invoices take no supplier.

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl "https://api.dcycle.io/v2/suppliers?supplier_type=electricity&country=ES" \
    -H "x-api-key: ${DCYCLE_API_KEY}" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "suppliers": [
      {
        "id": "5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c",
        "name": "Example Energía",
        "type": "electricity",
        "country": "ES",
        "enable": true,
        "organization_id": null
      }
    ],
    "total": 1
  }
  ```
</ResponseExample>

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key (see [Authentication](/api-reference/introduction#authentication)).
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID. It decides which custom suppliers are listed.
</ParamField>

### Query Parameters

<ParamField query="supplier_type" type="string">
  `electricity`, `heat_steam`, `cooling`, `water` or `heat`. See the table above for the one each invoice route takes.
</ParamField>

<ParamField query="country" type="string">
  ISO 3166-1 alpha-2 country code, e.g. `ES`: the supplier's country.
</ParamField>

<ParamField query="enabled" type="boolean">
  Only enabled (`true`) or disabled (`false`) suppliers.
</ParamField>

## Response

<ResponseField name="suppliers" type="array[object]">
  <Expandable title="supplier">
    <ResponseField name="id" type="uuid">The id to send as `supplier_id`.</ResponseField>
    <ResponseField name="name" type="string">The supplier's name.</ResponseField>
    <ResponseField name="type" type="string">The supplier type (see `supplier_type`).</ResponseField>
    <ResponseField name="country" type="string">ISO 3166-1 alpha-2 country code.</ResponseField>
    <ResponseField name="enable" type="boolean">Whether the supplier is enabled.</ResponseField>

    <ResponseField name="organization_id" type="uuid | null">
      `null` for Dcycle's official suppliers; otherwise the organization that owns this custom supplier.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="integer">The number of suppliers listed.</ResponseField>

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Create Electricity Invoices (v2)" icon="bolt" href="/api-reference/invoices/electricity-create-v2">
    Uses `supplier_type=electricity`
  </Card>

  <Card title="Create District Heating Invoices (v2)" icon="temperature-high" href="/api-reference/invoices/district-heating-create-v2">
    Uses `supplier_type=heat_steam`
  </Card>

  <Card title="Create District Cooling Invoices (v2)" icon="temperature-low" href="/api-reference/invoices/district-cooling-create-v2">
    Uses `supplier_type=cooling`
  </Card>

  <Card title="Invoices API" icon="receipt" href="/api-reference/invoices/overview">
    Which route for which consumption
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.