---
type: api
title: Get costs overview for the organization. Currently unavailable in self-hosted ECE.
description: Retrieves an overview of the costs by organization ID.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/operation/operation-get-costs-overview
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/operation/operation-get-costs-overview
products:
  - Elastic Cloud Enterprise
---

# Get costs overview for the organization. Currently unavailable in self-hosted ECE.

deprecated

Authentication: required

## Paths

- `GET` `/billing/costs/{organization_id}`

#### Path parameters

- `organization_id` (string) — required
  Identifier for the organization

## Description

Retrieves an overview of the costs by organization ID.

## Query string parameters

- `from` (string) — optional
  A datetime for the beginning of the desired range for which to fetch costs. Defaults to start of current month.
- `to` (string) — optional
  A datetime for the end of the desired range for which to fetch costs. Defaults to the current date.

## Responses

#### `200`

Top-level cost overview for the organization

`application/json`

- `costs` (object)
  Costs overview for an organization. All of the costs, credits, trials are expressed in Elastic Consumption Unit (ECU).
  - `total` (number · format: double)
    Total costs
  - `dimensions` (object[])
    A collection of billing details by dimension.
    - `type` (enum)
      The type of the billing dimension
      Values: `capacity`, `data_in`, `data_internode`, `data_out`, `storage_api`, `storage_bytes`
    - `cost` (number · format: double)
      The cost of the billing dimension
- `trials` (number · format: double)
  Trial costs for the organization
- `hourly_rate` (number · format: double)
  Hourly rate applied.
- `balance` (object)
  The available balance for an organization
  - `available` (number · format: double)
    Available balance
  - `remaining` (number · format: double)
    Remaining balance
  - `line_items` (object[])
    A collection of order line items for for an organization
    - `id` (string)
      Line Item ID
    - `ecu_quantity` (number · format: double)
      Original Elastic Consumption Unit (ECU) quantity
    - `ecu_balance` (number · format: double)
      Elastic Consumption Unit (ECU) Balance
    - `start` (string · format: date-time)
      Start of the line item's validity
    - `end` (string · format: date-time)
      Expiration of the line item
#### `400`

The specified date range is invalid. (code: `costs.invalid_date_range`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `403`

The current user does not have access to the requested organization. (code: `organization.invalid_access`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `404`

Organization not found. (code: `organization.not_found`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `500`

An error occurred when fetching an overview of the costs for the organization. (code: `billing_service.failed_request`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code examples

#### curl

```curl
curl -X GET "${API_URL}/billing/costs/${ORGANIZATION_ID}" \
  -u "${USERNAME}:${PASSWORD}"
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "costs": {
    "total": 0,
    "dimensions": [
      {
        "type": "capacity",
        "cost": 0
      }
    ]
  },
  "trials": 0,
  "hourly_rate": 0,
  "balance": {
    "available": 0,
    "remaining": 0,
    "line_items": [
      {
        "id": "string",
        "ecu_quantity": 0,
        "ecu_balance": 0,
        "start": "string",
        "end": "string"
      }
    ]
  }
}
```

#### 400

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
```

#### 403

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
```

#### 404

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
```

#### 500

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
```

