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

# Billing

> Understand API billing setup, billing gates, and charge tracking.

Production API usage requires active billing.

## Add billing

Open the developer dashboard and click **Add billing**. Batch Relay uses Stripe test mode in development.

Use Stripe's test card:

```text theme={null}
4242 4242 4242 4242
```

Any future expiration date, CVC, and ZIP code are accepted in Stripe test mode.

## Billing states

| State            | Meaning                               |
| ---------------- | ------------------------------------- |
| `not_configured` | No usable billing method is attached. |
| `active`         | Billing setup is complete.            |
| `past_due`       | Billing needs attention.              |
| `disabled`       | API billing is disabled.              |

## Sandbox billing tests

Sandbox order creation is normally free. To test billing without production fulfillment, include:

```json theme={null}
{
  "billing": {
    "required": true
  }
}
```

Inactive billing returns:

```http theme={null}
HTTP/1.1 402 Payment Required
```

```json theme={null}
{
  "error": {
    "code": "billing_required",
    "message": "This sandbox request requires active billing for billing-flow testing."
  },
  "request_id": "req..."
}
```

## Total charged

The developer dashboard reports captured API charges. During setup-mode testing, saved cards do not create charges, so the total remains `$0.00` until PaymentIntent-based order charging is enabled.
