CreatePlan creates a new subscription plan.
POST/api/v1/billing/plans
Creates a new plan with the specified pricing, features, and limits. New plans are active by default and immediately available for subscriptions.
Authorization
Requires billing:admin permission. Typically restricted to system administrators.
Validation
- name: Required, must be unique across active plans
- slug: Required, URL-friendly identifier (e.g., "professional-monthly")
- tier: Must be one of: starter, professional, enterprise, custom
- currency: Must be one of: KES, USD
- billing_period: Must be one of: monthly, yearly
Response
Returns the created Plan with generated ID and timestamps.
Errors
- PERMISSION_DENIED: Caller lacks billing:admin permission
- INVALID_ARGUMENT: Validation failed (see field-level rules)
- ALREADY_EXISTS: Plan with same slug already exists
Request
Responses
- 200
- default
A successful response.
An unexpected error response.