Billing
Overview
Payment orchestration against configured billing providers: settings, customers, checkouts, payments, purchases, refunds, subscription cancel, and provider webhooks.
API
{pe} = /projects/{projectId}/environments/{environmentId}.
| Method | Path | Notes |
|---|---|---|
| GET | /billing/health | Health |
| POST | /billing/webhooks/{provider} | Webhook; projectId / environmentId query params |
| GET/PUT | /billing{pe}/settings | RequireAuthorization |
| POST | /billing{pe}/customers | RequireAuthorization |
| POST | /billing{pe}/checkouts | RequireAuthorization |
| GET | /billing{pe}/payments/{externalId} | RequireAuthorization |
| GET | /billing{pe}/purchases | RequireAuthorization |
| POST | /billing{pe}/payments/{externalId}/refunds | RequireAuthorization |
| POST | /billing{pe}/subscriptions/{externalId}/cancel | RequireAuthorization |
Clients
| Package | Runtime |
|---|---|
@vijihub/billing | server |
VijiHub.Billing | .NET |
Implementation
- Enable Billing and configure the provider (secrets, webhook endpoints).
- Point the provider’s webhook to
/billing/webhooks/{provider}?projectId=…&environmentId=…. - Create customers/checkouts from your backend with Bearer auth.
- Handle refunds and subscription cancel via the documented paths.
Constraints
- Management APIs require authorization.
- Webhook route authenticity depends on provider signature verification in the service — keep webhook URLs secret where applicable.
- Never expose provider secret keys to browsers.