Plan
APIs for managing plan entities
List tenant plans sorted by creation date
Returns the first page of plans belonging to the specified tenant, sorted by creation date descending (most recent first). Call this to retrieve the current plan catalogue for a tenant. The caller must hold the READ_PLAN permission. **Note:** the current implementation always queries page 0 with a fixed page size of 10; pagination parameters are not exposed on this endpoint, so if the tenant has more than 10 plans, only the 10 most recent are returned. If the tenant has no plans, `data` is empty and `totalCount` is 0 (a downstream 404 is silently mapped to an empty result).
Create a new plan for a tenant
Creates a new plan and associates it with the specified tenant. This operation is **not idempotent** — submitting the same payload twice creates two separate plan records. The caller must hold the CREATE_PLAN permission. The request body's `data.payer` field is extracted and stored as the plan's `payerId`; the referenced payer is not validated for existence before the plan is created. `data`'s full shape is defined by the external Plan JSON schema and may include required fields beyond `payer`.
Fully replace an existing plan by ID
Replaces the entire plan record identified by `{id}` with the supplied payload. This is a **full replacement** — fields omitted from `data` are not preserved from the prior version, so submit the complete desired plan `data` on every call, not a partial diff. Submitting the same payload twice for the same `{id}` is idempotent. The caller must hold the UPDATE_PLAN permission. As with plan creation, `data.payer` is extracted and stored as `payerId`, and the referenced payer is not validated for existence. `data`'s full shape is defined by the external Plan JSON schema and may include required fields beyond `payer`.