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

GET /billing/costs/{organization_id}

EXPERIMENTAL (it may change in future versions): Retrieves an overview of the costs by organization ID.

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

  • Top-level cost overview for the organization

    Hide response attributes Show response attributes object

    The top level costs overview for an organization. All of the costs, credits, trials 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

    • trials number(double) Required

      Trial costs for the organization

    • hourly_rate number(double) Required

      Hourly rate applied.

    • balance object

      Balance for the organization

      Hide balance attributes Show balance attributes object
      • available number(double) Required

        Available balance

      • remaining number(double) Required

        Remaining balance

      • line_items array[object] Required

        A collection of order line items for for an organization

        Hide line_items attributes Show line_items attributes object

        Line Item

        • id string Required

          Line Item ID

        • ecu_quantity number(double) Required

          Original Elastic Consumption Unit (ECU) quantity

        • ecu_balance number(double) Required

          Elastic Consumption Unit (ECU) Balance

        • start string(date-time) Required

          Start of the line item's validity

        • end string(date-time) Required

          Expiration of the line item

  • 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

  • An error occurred when fetching an overview of the 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}
curl \
 -X GET https://api.elastic-cloud.com/api/v1/billing/costs/{organization_id}
Response examples (200)
{
  "costs": {
    "total": 42.0,
    "dimensions": [
      {
        "type": "capacity",
        "cost": 42.0
      }
    ]
  },
  "trials": 42.0,
  "hourly_rate": 42.0,
  "balance": {
    "available": 42.0,
    "remaining": 42.0,
    "line_items": [
      {
        "id": "string",
        "ecu_quantity": 42.0,
        "ecu_balance": 42.0,
        "start": "2024-05-04T09:42:00+00:00",
        "end": "2024-05-04T09:42:00+00:00"
      }
    ]
  }
}
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"
      ]
    }
  ]
}