# Billing and plans

> Plans, quotas, invoices in halalas, subscriptions and what "paid" means.

URL: https://chatwork.io/en/docs/billing
Section: Platform

## Plans

| Plan | Monthly | Yearly | AI replies / month | Token quota |
|---|---|---|---|---|
| Starter | 299 SAR | 2,990 SAR | 1,500 | 300k |
| Growth | 799 SAR | 7,990 SAR | 5,000 | 1M |
| Enterprise | 1,999 SAR | 19,990 SAR | 50,000 | 10M |

The catalogue is one file, `pricing/catalog.json`. The bridge loads it for invoices and quotas, the site reads it at build time, and operators override fields at runtime with `DOT_PLANS_JSON`.

## Quotes and the calculator

`GET /api/v1/pricing` returns each plan with a computed quote per interval: subtotal, 15 % VAT rounded half-up to the halala, total, the monthly equivalent of a yearly price, the yearly saving and the cost per 1,000 AI replies. The total is, by construction and by test, the `total_halalas` of the invoice the checkout issues, because both use the same functions.

`GET /api/v1/pricing/quote?replies=3200&interval=year` answers the question buyers actually ask: for this many AI replies a month, which plan fits and what does each plan cost. Above the largest quota the answer is `custom_required`; the product has no overage price and does not invent one. The [pricing page](/en/pricing) runs the same arithmetic in the browser (shared fixtures keep the two implementations identical) and refreshes from the API so an operator's override shows without a rebuild.

## Quotas

Each AI reply reserves one unit before the model is called and settles with real token usage afterwards; a provider failure releases the reservation. Over quota, API routes answer `429 quota_exceeded`; the webhook stays silent towards the customer, posts a private note and hands off. Only `active` or live `trial` subscriptions may consume quota.

## Money

Amounts are integer halalas; VAT is 15 %, rounded half-up to the halala; `*_sar` fields are presentation only. Invoice ids look like `INV-YYYYMM-XXXXXXXX`. An invoice is `draft` until the seller tax fields are configured, then `issued`; it becomes `paid` only through a payment record, either a Moyasar payment re-fetched server-side or a bank transfer confirmed by an admin with a reference. A plan change never switches the plan or quota before activation.

ZATCA: invoices carry phase-1 QR TLV data (tags 1–5). This is not a compliance claim; phase-2 onboarding is an owner task.
