# Billing

> Flat monthly price per number. Never per message. Until billing is switched on, every /v1/billing route answers 503 billing_disabled (details.billing_enabled=false).

Canonical: https://docs.whabuzz.com/api/billing/

Flat monthly price per number. Never per message. Until billing is switched on, every /v1/billing route answers 503 billing_disabled (details.billing_enabled=false).

Base URL `https://api.whabuzz.com`. Every request needs `Authorization: Bearer <key>` unless the operation says otherwise; see [Authentication](https://docs.whabuzz.com/authentication.md). Errors follow the [two-source contract](https://docs.whabuzz.com/errors.md).

Operations on this page:

- [`GET /v1/billing`](#getBilling): Plan, active numbers and next charge
- [`POST /v1/billing/mandate`](#createMandate): Set up autopay
- [`GET /v1/billing/invoices`](#listInvoices): Invoices
- [`GET /v1/billing/invoices/{invoice_id}`](#getInvoice): Printable invoice (HTML) or JSON with Accept application/json
- [`POST /v1/billing/invoices/{invoice_id}/pay`](#payInvoice): Pay a failed invoice now

## Plan, active numbers and next charge {#getBilling}

`GET /v1/billing`

**Auth:** API key (tenant key, or app key with `X-WhaBuzz-Tenant`). **Operation id:** `getBilling`.

cURL:

```bash
curl -X GET "https://api.whabuzz.com/v1/billing" \
  -H "Authorization: Bearer $WHABUZZ_KEY"
```

**Responses**

**200** Billing summary

```json
{
  "plan": "₹500/month first number + ₹250/month each additional, ex-GST",
  "billing_status": "trialing",
  "trial_ends_at": "2026-10-30T09:00:00Z",
  "active_numbers": 2,
  "next_charge": {
    "period": "2026-11-01",
    "amount_paise": 75000,
    "gst_paise": 13500,
    "total_paise": 88500,
    "charge_on": "2026-11-03"
  },
  "mandate": {
    "status": "not_set_up"
  }
}
```

## Set up autopay {#createMandate}

`POST /v1/billing/mandate`

Returns Cashfree's authorisation link. Open it, approve the mandate (UPI Autopay, eNACH or card), and WhaBuzz charges the monthly total on the 3rd.

**Auth:** API key (tenant key, or app key with `X-WhaBuzz-Tenant`). **Operation id:** `createMandate`.

cURL:

```bash
curl -X POST "https://api.whabuzz.com/v1/billing/mandate" \
  -H "Authorization: Bearer $WHABUZZ_KEY"
```

**Responses**

**201** Authorisation link

```json
{
  "subscription_id": "wb_sub_a578246e",
  "authorization_url": "https://sandbox.cashfree.com/pg/view/subscription/…",
  "max_amount_paise": 200000
}
```

**503** Billing not enabled yet

```json
{
  "source": "whabuzz",
  "error": {
    "code": "billing_disabled",
    "message": "Billing is not enabled yet",
    "details": {
      "billing_enabled": false
    }
  },
  "request_id": "req_01JAB41B6E9G2J5M8P1S4V7Y0B"
}
```

## Invoices {#listInvoices}

`GET /v1/billing/invoices`

**Auth:** API key (tenant key, or app key with `X-WhaBuzz-Tenant`). **Operation id:** `listInvoices`.

cURL:

```bash
curl -X GET "https://api.whabuzz.com/v1/billing/invoices" \
  -H "Authorization: Bearer $WHABUZZ_KEY"
```

**Responses**

**200** Invoices

```json
{
  "data": [
    {
      "id": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
      "number": "WB/2026-27/000001",
      "period": "2026-11-01",
      "amount_paise": 75000,
      "gst_paise": 13500,
      "total_paise": 88500,
      "status": "paid",
      "paid_at": "2026-11-03T04:00:00Z",
      "html_url": "https://api.whabuzz.com/v1/billing/invoices/9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d"
    }
  ]
}
```

## Printable invoice (HTML) or JSON with Accept application/json {#getInvoice}

`GET /v1/billing/invoices/{invoice_id}`

**Auth:** API key (tenant key, or app key with `X-WhaBuzz-Tenant`). **Operation id:** `getInvoice`.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `invoice_id` | path | string (uuid) | yes |  |

cURL:

```bash
curl -X GET "https://api.whabuzz.com/v1/billing/invoices/$INVOICE_ID" \
  -H "Authorization: Bearer $WHABUZZ_KEY"
```

**Responses**

**200** Invoice

Body: `text/html`.

## Pay a failed invoice now {#payInvoice}

`POST /v1/billing/invoices/{invoice_id}/pay`

**Auth:** API key (tenant key, or app key with `X-WhaBuzz-Tenant`). **Operation id:** `payInvoice`.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `invoice_id` | path | string (uuid) | yes |  |

cURL:

```bash
curl -X POST "https://api.whabuzz.com/v1/billing/invoices/$INVOICE_ID/pay" \
  -H "Authorization: Bearer $WHABUZZ_KEY"
```

**Responses**

**201** Cashfree checkout link

```json
{
  "payment_url": "https://sandbox.cashfree.com/pg/view/order/…"
}
```
