# Get Pending Chargebacks

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

## CURL Example:

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

## Available Filters:

* `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
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
```