<a id="cloud-billing-invoices-costs"></a>

# Retrieve Invoices and Costs in Confluent Cloud

Use the Confluent Cloud Console to view or download invoices, or use the
[Costs API](https://docs.confluent.io/cloud/current/ccloud/costs-billing-v-1/)
to retrieve costs for a date range.

<a id="view-invoice"></a>

## View or download invoices

You can view or download current and past monthly invoices using
Confluent Cloud Console. For information about line items on your invoice, see
[Billing Dimensions in Confluent Cloud](billing-dimensions.md#billing-dimensions).

**Requirements**

- You must be assigned the [OrganizationAdmin role](../security/access-control/rbac/predefined-rbac-roles.md#organizationadmin-role)
  or [BillingAdmin role](../security/access-control/rbac/predefined-rbac-roles.md#billingadmin-role).

**To view an invoice**:

1. Sign in to your Confluent Cloud account.
2. Open the Administration menu in the upper right, select **Billing and
   payment**.
3. From **Billing**, view the current month and year, or select a different
   month and year.
   ![Billing screen with month and year drop-down selectors for choosing
   invoice period](images/_billing/billing-month-year-selectors.png)
4. Choose an environment.

   A billing statement appears that identifies a resource, usage, and cost per
   unit for that environment.

**To download an invoice**:

1. Sign in to your Confluent Cloud account.
2. Open the Administration menu in the upper right, select **Billing and
   payment**.
3. From **Billing**, select the desired month and year.
4. Select the download icon: ![Download icon for billing CSV export](images/_billing/billing-download-icon.png)

   Your browser downloads a CSV file containing the billing details for the
   selected month and year. The file name is your Confluent Cloud Organization ID.

<a id="costs-api"></a>

## Retrieve costs for a range of dates

Use the
[Costs API](https://docs.confluent.io/cloud/current/ccloud/costs-billing-v-1/)
to get your costs for a specific range of dates.

**Requirements**

- You must be assigned the [OrganizationAdmin role](../security/access-control/rbac/predefined-rbac-roles.md#organizationadmin-role)
  or [BillingAdmin role](../security/access-control/rbac/predefined-rbac-roles.md#billingadmin-role).

**Notes**

- Use UTC time for dates with the Costs API.
- Specify a start date (inclusive) and end date (exclusive) as strings in this
  format: `yyyy-mm-dd`.
- Cost data can take up to 72 hours to become available.
- The start date can be up to one year in the past.
- One month is the maximum window between start and end dates.
- The Costs API aggregates all line values at a daily level.

**Related**

- To map dimensions to Costs API line items, see [Billing Dimensions in Confluent Cloud](billing-dimensions.md#billing-dimensions).

#### NOTE
For accuracy, Confluent recommends using a `start_date` that is at least
72 hours prior to the current date and time.

**To retrieve costs**

### Confluent Cloud APIs

Use a `GET` request, and include a start date and end date.

**Request**

```bash
GET /billing/v1/costs?start_date={yyyy-mm-dd}&end_date={yyyy-mm-dd}
Host: api.confluent.cloud
Authorization: Basic <base64-encoded-key-and-secret>
```

**Response**

Highlighted lines indicate the range of dates from your request and total
costs.

```json
{
   "api_version": "v1",
   "kind": "CostList",
   "metadata": {
      "first": "https://api.confluent.cloud/billing/v1/costs",
      "last": "https://api.confluent.cloud/billing/v1/costs?page_token=bcAOehAY8F16YD84Z1wT",
      "prev": "https://api.confluent.cloud/billing/v1/costs?page_token=YIXRY97wWYmwzrax4dld",
      "next": "https://api.confluent.cloud/billing/v1/costs?page_token=UvmDWOB1iwfAIBPj6EYb",
      "total_size": 123
   },
   "data": [
      {
         "api_version": "v1",
         "kind": "Cost",
         "start_date": "2024-04-01",
         "end_date": "2024-05-01",
         "granularity": "DAILY",
         "network_access_type": "INTERNET",
         "product": "KAFKA",
         "line_type": "KAFKA_NUM_CKUS",
         "price": 1.5,
         "unit": "GB",
         "quantity": 99.95,
         "original_amount": 99.95,
         "discount_amount": 20.95,
         "amount": 79,
         "resource": {
            "environment": {
                  "id": "env-devexamp34"
            },
            "id": "lkc-devexamp12"
         },
      }
   ]
}
```

If your organization was created before May 15, 2024, the response uses
a different format. For details, see the
[legacy Costs API response format](legacy-billing.md#legacy-costs-api-response).

For more information, see
[Costs API](https://docs.confluent.io/cloud/current/ccloud/costs-billing-v-1/).

### Confluent CLI

- Use the Confluent CLI and the `confluent billing cost list` command
  to retrieve your costs:
  ```bash
  confluent billing cost list --start-date <start-date> --end-date <end-date>
  ```

For more information, see
[confluent billing cost list](https://docs.confluent.io/confluent-cli/current/command-reference/billing/cost/confluent_billing_cost_list.html).
