> For the complete documentation index, see [llms.txt](https://docs.warpstream.com/warpstream/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.warpstream.com/warpstream/reference/api-reference/invoices/get-pending-invoice-2.md).

# Get Past Chargebacks

```bash
POST /api/v1/billing/chargebacks/get_past
```

## CURL Example:

```bash
curl https://api.warpstream.com/api/v1/billing/chargebacks/get_past \
    -H 'warpstream-api-key: XXXXXXXXXX' \
    -H 'Content-Type: application/json' \
    -d '{
        "date_start": "2026-05-01",
        "entity_kind": "topic",
        "virtual_cluster_id": "vci_xxx",
        "max_entities_per_cluster": 500,
        "min_total": 0
    }'
```

## **Available Filters:**

* `date_start`: Required. Selects the billing month to retrieve. Pass any date within the desired month, formatted as `YYYY-MM-DD`.
* `entity_kind`: Optional. Filters the response to clusters whose chargeback entity type matches the value. Allowed values are `topic`, `subject`, and `table`.
* `virtual_cluster_id`: Optional. Filters the response to a single virtual cluster.
* `max_entities_per_cluster`: Optional. Limits the number of entities returned per cluster. Defaults to `500`; maximum value is `5000`.
* `min_total`: Optional. Excludes entities whose total chargeback amount is less than this value, in USD.

## **Response Body (JSON):**

```json
{
    "date_from": "YYYY-MM-DD",
    "date_to": "YYYY-MM-DD",
    "covers_products": [
        "Cluster minutes",
        "Uncompressed GiB written",
        "GiB minutes",
        "Network ingress",
        "Network egress"
    ],
    "tenants": [
        {
            "tenant_id": "ti_xxx",
            "workspaces": [
                {
                    "workspace_id": "wi_xxx",
                    "workspace_name": "xxx",
                    "clusters": [
                        {
                            "virtual_cluster_id": "vci_xxx",
                            "cluster_name": "vcn_xxx",
                            "cluster_regions": [
                                "us-east-1"
                            ],
                            "cluster_type": "byoc",
                            "entity_kind": "topic",
                            "storage_attribution_method": "write_bytes_times_retention",
                            "entities": [
                                {
                                    "name": "orders",
                                    "chargebacks": [
                                        {
                                            "product": "Cluster minutes",
                                            "unit_price": 0.23148,
                                            "quantity": 2340,
                                            "total": 5.42
                                        }
                                    ],
                                    "total": 5.42
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.warpstream.com/warpstream/reference/api-reference/invoices/get-pending-invoice-2.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
