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

GET /billing/costs/{organization_id}/items

EXPERIMENTAL (it may change in future versions): Retrieves the itemized costs for the organization.

Path parameters

Query parameters

  • from string

    A datetime for the beginning of the desired range for which to fetch costs. Defaults to start of current month.

  • to string

    A datetime for the end of the desired range for which to fetch costs. Defaults to the current date.

Responses

  • The costs associated to a set of items

    Hide response attributes Show response attributes object

    Costs associated to a set of Elastic Cloud resources for an organization. All of the costs are expressed in Elastic Consumption Unit (ECU).

    • costs object Required

      Costs for the organization

      Hide costs attributes Show costs attributes object
      • total number(double) Required

        Total costs

      • dimensions array[object] Required

        A collection of billing details by dimension.

        Hide dimensions attributes Show dimensions attributes object

        Billing dimension

        • type string Required

          The type of the billing dimension

          Values are capacity, data_in, data_internode, data_out, storage_api, or storage_bytes.

        • cost number(double) Required

          The cost of the billing dimension

    • data_transfer_and_storage array[object] Required

      List of the detailed costs associated to the Data Transfer and Storage (DTS) dimensions

      Hide data_transfer_and_storage attributes Show data_transfer_and_storage attributes object

      The costs associated to a Data Transfer and Storage (DTS) dimension for an organization. All of the costs, credits, and trials are expressed in Elastic Consumption Units (ECU).

      • cost number(double) Required

        Costs associated to the Data Transfer and Storage (DTS) dimensions for an organization

      • name string Required

        DTS dimension name

      • quantity object Required

        DTS usage

        Hide quantity attributes Show quantity attributes object
      • rate object Required

        Cost per unit

        Hide rate attributes Show rate attributes object
      • sku string Required

        DTS dimension Stock Keeping Unit (SKU)

      • type string Required

        Type of the DTS dimension usage

    • resources array[object] Required

      Costs of the list of resources

      Hide resources attributes Show resources attributes object

      Detailed costs associated to an Elastic Cloud Resource for an organization. All of the costs are expressed in Elastic Consumption Unit (ECU).

      • hours integer(int64) Required

        Resource usage in hours

      • instance_count integer(int32) Required

        Number of instances

      • period object Required

        Period

        Hide period attributes Show period attributes object
        • start string(date-time) Required

          Start

        • end string(date-time) Required

          End

      • kind string Required

        Kind of resource

        Values are elasticsearch, kibana, apm, integrations_server, appsearch, or enterprise_search.

      • price number(double) Required

        Resource price

      • price_per_hour number(double) Required

        Price per hour

      • name string Required

        Resource name

      • sku string Required

        Stock Keeping Unit (SKU)

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

    Hide headers attribute Show headers attribute
    • The error codes associated with the response

      Value is costs.invalid_date_range.

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

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

    Hide headers attribute Show headers attribute
    • The error codes associated with the response

      Value is organization.invalid_access.

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

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

    Hide headers attribute Show headers attribute
    • The error codes associated with the response

      Value is organization.not_found.

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

  • Error fetching the itemized costs for the organization. (code: billing_service.failed_request)

    Hide headers attribute Show headers attribute
    • The error codes associated with the response

      Value is billing_service.failed_request.

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

GET /billing/costs/{organization_id}/items
curl \
 -X GET https://api.elastic-cloud.com/api/v1/billing/costs/{organization_id}/items
Response examples (200)
{
  "costs": {
    "total": 42.0,
    "dimensions": [
      {
        "type": "capacity",
        "cost": 42.0
      }
    ]
  },
  "data_transfer_and_storage": [
    {
      "cost": 42.0,
      "name": "string",
      "quantity": {
        "value": 42,
        "formatted_value": "string"
      },
      "rate": {
        "value": 42.0,
        "formatted_value": "string"
      },
      "sku": "string",
      "type": "string"
    }
  ],
  "resources": [
    {
      "hours": 42,
      "instance_count": 42,
      "period": {
        "start": "2024-05-04T09:42:00+00:00",
        "end": "2024-05-04T09:42:00+00:00"
      },
      "kind": "elasticsearch",
      "price": 42.0,
      "price_per_hour": 42.0,
      "name": "string",
      "sku": "string"
    }
  ]
}
Response examples (400)
# Headers
x-cloud-error-codes: costs.invalid_date_range

# Payload
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
Response examples (403)
# Headers
x-cloud-error-codes: organization.invalid_access

# Payload
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
Response examples (404)
# Headers
x-cloud-error-codes: organization.not_found

# Payload
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
Response examples (500)
# Headers
x-cloud-error-codes: billing_service.failed_request

# Payload
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}