BillingController
| Base path | /api/billing |
| Module | Billing & Platform |
| Endpoints | 6 |
| OpenAPI tag | Billing |
| Source | backend/src/main/java/com/motorph/payroll/controller/BillingController.java |
Endpoints
| Method | Path | Requires | Handler |
|---|---|---|---|
GET | /api/billing/subscription | system.admin.billing.manage | getSubscription() |
POST | /api/billing/checkout | system.admin.billing.manage | createCheckout() |
POST | /api/billing/change-plan | system.admin.billing.manage | changePlan() |
DELETE | /api/billing/pending-change | system.admin.billing.manage | cancelPendingChange() |
POST | /api/billing/portal-session | system.admin.billing.manage | openCustomerPortal() |
POST | /api/billing/seats/sync | system.admin.billing.manage | syncSeats() |
Notes
POST /api/billing/checkout— Returns a checkout URL only.POST /api/billing/change-plan— Moves the existing subscription to another plan: an upgrade applies now (the difference is invoiced at once), a downgrade at the next renewal.DELETE /api/billing/pending-change— Drops a downgrade scheduled for renewal, keeping the current plan.POST /api/billing/portal-session— A short-lived link to the payment provider's portal, to update the payment method.POST /api/billing/seats/sync— Brings the billed seat count in line with today's active employees, rather than waiting for the nightly sync.
note
This controller carries one @PreAuthorize on the class, which Spring applies to every handler. 6 of its 6 endpoints inherit it rather than declaring their own.
Call chain
Dependencies
Constructor-injected by Lombok's @RequiredArgsConstructor: BillingService, SeatSyncService.
Tables reached
| Entity | Table | Tenant-scoped |
|---|---|---|
| BillingSubscription | billing_subscription | — |
| BillingWebhookEvent | billing_webhook_event | — |
| Employee | employee | Yes |
| Tenant | tenant | — |
| User | users | — |
Generated page
This page is rebuilt from the source on every docs build by docs-site/scripts/gen-code-wiki.mjs. Editing it has no effect — change the code, or, if what you want to say is prose, write it in docs/.