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

# billing_grace_period

> HTTP 402 / 403 — subscription has lapsed but the tenant is still inside the grace period.

|                 |                                                                                                                         |
| --------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **HTTP status** | `402 Payment Required` (with grace flag) — sometimes 403 in admin paths                                                 |
| **Code**        | `billing_grace_period`                                                                                                  |
| **Retry?**      | Requests *do* succeed during grace if the operator has enabled it, but you should resolve billing before grace expires. |

## When this happens

The subscription has gone past due (Stripe could not charge the card),
but the tenant is still inside the configured **grace period**
(`BILLING_GRACE_PERIOD_DAYS`, default 7 days). During grace:

* The API continues to serve requests.
* Every response carries
  `X-Subscription-Status: past_due_grace` and
  `X-Grace-Days-Remaining: <n>`.
* Once grace expires the API switches to
  [`billing_required`](/errors/billing_required) (a hard block).

The exact mix of "warn vs block" during grace depends on operator
configuration; some tenants see this code as a hard error on admin
paths and a soft warning on analyzer paths.

## Example response

```http theme={null}
HTTP/1.1 402 Payment Required
X-Subscription-Status: past_due_grace
X-Grace-Days-Remaining: 3
```

```json theme={null}
{
  "detail": "Subscription is past due. 3 grace days remaining.",
  "code": "billing_grace_period",
  "request_id": "5b3f6c7e-7d24-4d40-9b12-3a59c01c6e91",
  "doc_url": "https://docs.lasscyber.com/errors/billing_grace_period"
}
```

## How to fix

1. Sign in at
   [`agnes.lasscyber.com/agnes-info/billing`](https://agnes.lasscyber.com/agnes-info/billing).
2. Update the payment method or pay the outstanding invoice in the
   Stripe Customer Portal.
3. Wait a few seconds for the Stripe webhook to update Agnes; the
   header set returns to normal on the next request.

## SDK behaviour

| SDK        | Exception                                              |
| ---------- | ------------------------------------------------------ |
| Python     | `agnes.BillingError` with `grace_period_end: datetime` |
| TypeScript | `BillingError` with `gracePeriodEnd: Date`             |

SDKs do not retry — the recovery is operator-driven (update payment).

## Related

* [`billing_required`](/errors/billing_required) — what comes next if
  grace expires.
* [Billing](/administration/billing) — grace-period configuration
  and the customer portal.
