---
type: api
title: Get itemized costs for the organization.
description: Retrieves costs associated with all items for the organization.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-billing/operation/operation-getcostsbyitemsv2
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-billing/operation/operation-getcostsbyitemsv2
products:
  - Elastic Cloud Hosted
---

# Get itemized costs for the organization.

- Server: `https://cloud.elastic.co` (Public)

## Paths

- `GET` `/api/v2/billing/organizations/{organization_id}/costs/items`

#### Path parameters

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

## Description

Retrieves costs associated with all items for the organization.
Platform callers (organization:get:all) and organization billing admins
see unfiltered results; other billing-organization:get callers are filtered to
items billed against accessible instances.

## Query string parameters

- `from` (string) — required
  A datetime for the beginning of the desired range. Any timezone offset is accepted and converted to UTC internally. Responses always contain UTC values. If no timezone offset is specified, UTC is assumed.
  Example: `2021-04-21T00:00:00+00:00`
- `to` (string) — required
  A datetime for the end of the desired range. Any timezone offset is accepted and converted to UTC internally. Responses always contain UTC values. If no timezone offset is specified, UTC is assumed.
  Example: `2021-04-21T00:00:00+00:00`
- `serverless_group_by` (enum) — optional
  How to group the serverless items.
  Values: `product`, `product_family`

## Responses

#### `200`

Success. The costs associated to a set of items.

`application/json`

- `products` (object[])
  - `product_line_items` (object[])
    - `display_quantity` (object)
      Display quantity
      - `formatted_value` (string)
      - `type` (enum)
        Values: `default`, `normalized`
      - `value` (integer | number)
    - `kind` (string)
    - `name` (string)
    - `quantities` (object[])
      - `from` (string · format: date-time)
      - `quantity` (object)
        Quantity
        - `formatted_value` (string)
        - `value` (integer | number)
      - `rate` (object)
        Rate(value: 'int', formatted_value: 'str')
        - `formatted_value` (string)
        - `value` (integer)
      - `tiers` (object[])
        - `max` (integer)
        - `min` (integer)
        - `quantity` (object)
          Quantity
          - `formatted_value` (string)
          - `value` (integer | number)
        - `rate` (object)
          Rate(value: 'int', formatted_value: 'str')
          - `formatted_value` (string)
          - `value` (integer)
        - `total_ecu` (integer)
      - `to` (string · format: date-time)
      - `total_ecu` (integer)
    - `quantity` (object)
      Quantity
      - `formatted_value` (string)
      - `value` (integer | number)
    - `rate` (object)
      Rate(value: 'int', formatted_value: 'str')
      - `formatted_value` (string)
      - `value` (integer)
    - `sku` (string)
    - `total_ecu` (integer)
    - `type` (string)
    - `unit` (string)
  - `total_ecu` (integer)
  - `type` (string)
- `total_ecu` (integer)
#### `400`

The specified data range is invalid.

#### `403`

Current user does not have access to the requested organization.

#### `404`

Organization not found.

#### `500`

Internal server error.

## Code examples

#### curl

```curl
curl -X GET "https://cloud.elastic.co/api/v2/billing/organizations/${ORGANIZATION_ID}/costs/items?from=2021-04-21T00%3A00%3A00%2B00%3A00&to=2021-04-21T00%3A00%3A00%2B00%3A00"
```

## 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
{
  "products": [
    {
      "product_line_items": [
        {
          "display_quantity": {
            "formatted_value": "string",
            "type": "default",
            "value": 0
          },
          "kind": "string",
          "name": "string",
          "quantities": [],
          "quantity": {
            "formatted_value": "string",
            "value": 0
          },
          "rate": {
            "formatted_value": "string",
            "value": 0
          },
          "sku": "string",
          "total_ecu": 0,
          "type": "string",
          "unit": "string"
        }
      ],
      "total_ecu": 0,
      "type": "string"
    }
  ],
  "total_ecu": 0
}
```

