# Subscription controls

The new billing routes use an authenticated organization owner/billing session plus `X-JB-Client: dashboard` for mutations. A scoped calculation key cannot create a mandate, change a plan or refund money. Keep provider secrets server-side. Obtain the organization from `/v2/organizations`, then use `/v2/organizations/{org}/billing`.

1. GET `/catalog?environment=test` to inspect the synthetic plan/term version. Its INR amounts are test fixtures, not public selling prices.
2. PUT `/profile` with authorized billing business name, country, address, city and postal code. Profile details are encrypted and not added to calculation requests.
3. POST `/checkout` with `environment`, `plan`, `terms_version`, `recurring_consent: true` and an `Idempotency-Key`. An optional `request_trial` uses only the declared bounded trial. Open the returned provider-hosted checkout URL only in your own authorized test/account workflow. A successful browser return grants no paid credits.
4. Configure a separate raw-body Razorpay webhook at `/v2/billing/razorpay/test/events` using the Cloud Astrology API test secret. The backend re-fetches authoritative provider records. Do not reuse a browser callback or fabricate a captured payment.
5. GET `/subscription` and GET the calculation API `/v2/usage` to inspect actual entitlement periods, quota and hard cap. Receipts and ledger rows expose the exact credit-cycle reference.
6. POST `/preview` before a change or cancellation, then POST `/confirm` with its preview ID, consent and a new financial operation key. Supported card-plan changes take effect at the cycle boundary; immediate proration and unsupported mandate updates are not silently substituted.
7. GET `/records?format=csv` for monetary records, separately from `/v2/usage/ledger`. Provider invoice details are available only through the authorized `/invoices/{id}` route. These records are not tax-compliance approval or bank payout proof.
8. Unknown provider mutation results are recovered through `/operations/{operation}/recover` using read-only evidence. Never create a new mandate/refund merely because a response timed out. Any unproven result requires merchant review.

Real self-service refunds require an independently approved unused-period/capture-time policy; otherwise merchant review applies. Pending/processed refunds and disputes affect access without deleting keys or financial evidence. Default subscription mode is disabled, and no existing Jyotishbhava credentials or mandates are migrated automatically. Read the acceptance document and approval template before actual merchant activation. The local HTTP simulator is not a real Razorpay test-mode transaction.
