Billing and Plans

Razorpay subscriptions, plan-key redemption, invoices, AI credit top-ups and usage analytics. Conventions are on API Reference.

Endpoints

Method

Path

Description

Auth

GET

/api/billing/me

Return the current user’s billing plan, subscription status and credit breakdown.

Signed in

POST

/api/billing/customer

Create a Razorpay customer for the logged-in user (idempotent).

Signed in

POST

/api/billing/subscription

Create a Razorpay subscription for the requested plan.

Signed in

GET

/api/billing/subscription

Fetch the current user’s Razorpay subscriptions from the local database.

Signed in

POST

/api/billing/cancel-subscription

Cancel the active subscription at period end (cancel_at_cycle_end=1).

Signed in

POST

/api/billing/verify-payment

Verify the Razorpay payment signature returned by Checkout.

Signed in

POST

/api/billing/refund

Initiate a refund for a given Razorpay payment ID.

Signed in

POST

/api/billing/webhook

Razorpay webhook receiver (verified via X-Razorpay-Signature).

Webhook signature

GET

/api/billing/invoices

Fetch invoices for the current user’s subscription and one-off payments.

Signed in

POST

/api/billing/redeem-key

Redeem an admin-issued key for a time-limited plan upgrade.

Signed in

GET

/api/billing/grants

List the current user’s redeemed plan keys and active grants.

Signed in

POST

/api/billing/switch-plan

Allow an admin to switch which owned plan they are currently consuming.

Admin

POST

/api/billing/ai-topup/order

Create a Razorpay order for purchasing AI credits (in USD).

Signed in

POST

/api/billing/ai-topup/verify

Verify an AI top-up payment and credit the user’s AI wallet atomically.

Signed in

GET

/api/billing/ai-usage

Return the current user’s AI wallet balance and recent usage receipts.

Signed in

GET

/api/billing/usage-overview

Return user usage analytics (projects, simulations, AI spend) from the database.

Signed in

See also

Billing and Plans for plan capabilities and version-history retention, and Workspaces and Collaboration for workspace plan resolution.