---
title: "Invalid billing date range (invalid-billing-date-range)"
description: "PubNio invalid-billing-date-range problem, HTTP 400: A billing usage or ledger from/to does not parse or is reversed, or a usage span is longer than the 90-day maximum."
---

> Documentation Index
> Fetch the complete documentation index at: https://pubnio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Invalid billing date range (invalid-billing-date-range)

HTTP 400 Invalid billing date range. A billing usage or ledger `from`/`to` does not parse or is reversed, or a usage span is longer than the 90-day maximum.

## When it happens

A negative monthly spend cap also returns it.

4 operations declare it: [`GET /api/v1/workspaces/{workspaceId}/billing`](https://pubnio.com/api/v1/docs#tag/billing/GET/api/v1/workspaces/{workspaceId}/billing), [`GET /api/v1/workspaces/{workspaceId}/billing/ledger`](https://pubnio.com/api/v1/docs#tag/billing/GET/api/v1/workspaces/{workspaceId}/billing/ledger), [`PATCH /api/v1/workspaces/{workspaceId}/billing/spend-controls`](https://pubnio.com/api/v1/docs#tag/billing/PATCH/api/v1/workspaces/{workspaceId}/billing/spend-controls), and [`GET /api/v1/workspaces/{workspaceId}/billing/usage`](https://pubnio.com/api/v1/docs#tag/billing/GET/api/v1/workspaces/{workspaceId}/billing/usage).

## Response body

```json
{
  "type": "https://pubnio.com/docs/problems/invalid-billing-date-range/",
  "status": 400,
  "title": "Invalid billing date range",
  "detail": "Billing query date range must have from <= to and span at most 90 days.",
  "code": "invalid_billing_date_range",
  "nextAction": "Provide valid YYYY-MM-DD bounds spanning at most 90 days.",
  "requestId": "0f8e4c2a-6b1d-4e3f-8a9b-7c6d5e4f3a21"
}
```

| Field        | Type   | Always present |
| ------------ | ------ | -------------- |
| `nextAction` | string | Yes            |

## Recovery for agents

- Do what `nextAction` says.

## Retryable

No: the SDKs mark HTTP 400 not `retryable`.

## Limits

- Match on `type` or `code`, not on `detail`.

## Related

- [Billing problems](https://pubnio.com/docs/problems/#billing)
- [API reference](https://pubnio.com/docs/api/)

Source: https://pubnio.com/docs/problems/invalid-billing-date-range/index.mdx
