Add plan set
const url = 'https://example.com/api/v1/provision/admin/usage-plans/plan-sets';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"productId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","suiteId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example","description":"example","plans":[{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example","description":"example","sortOrder":1,"pricingMode":"Absolute","monthlyPrice":{"amount":1,"currency":"example"},"relativeWeight":1,"lineItems":[{"productId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","included":true,"featureValues":[{"featureCode":"example","metricName":"example","featureName":"example","units":"example","featureType":"Boolean","enforcementType":"SingleValue","value":"example","usageTiers":[{"startUsage":1,"startPercentage":1,"endUsage":1,"endPercentage":1,"baseCredits":1,"creditsPerUnitOfConsumption":1,"name":"example","quotaUsageLevel":"None","quotaUsagePolicy":"None","fundingBalanceMetric":"example"}],"consumptionPeriod":"None"}]}]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/provision/admin/usage-plans/plan-sets \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "productId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "suiteId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "description": "example", "plans": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "description": "example", "sortOrder": 1, "pricingMode": "Absolute", "monthlyPrice": { "amount": 1, "currency": "example" }, "relativeWeight": 1, "lineItems": [ { "productId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "included": true, "featureValues": [ { "featureCode": "example", "metricName": "example", "featureName": "example", "units": "example", "featureType": "Boolean", "enforcementType": "SingleValue", "value": "example", "usageTiers": [ { "startUsage": 1, "startPercentage": 1, "endUsage": 1, "endPercentage": 1, "baseCredits": 1, "creditsPerUnitOfConsumption": 1, "name": "example", "quotaUsageLevel": "None", "quotaUsagePolicy": "None", "fundingBalanceMetric": "example" } ], "consumptionPeriod": "None" } ] } ] } ] }'Creates a new usage plan set.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”An id of your own for the call. The answer returns it in the same header, and the server log carries it; when you send none, the server makes one.
A key of your own that makes a retry safe: a call repeated with the same key and the same body answers the first call’s result instead of running again. Send one key per call, and reuse it only to retry that call.
Request Bodyrequired
Section titled “Request Bodyrequired”Plan set creation payload.
Admin request to create a plan set for a product, optionally with its initial plans. The set is always created as Draft; publish it with SetPlanSetStatus.
object
The suite to scope the plan set to. Leave null to have the server resolve (or implicitly create) the single-member suite for ProductId — the common case for a vendor who has never created a suite explicitly. Set only when the product already belongs to more than one suite and the target must be named.
A usage plan such as “basic”, “standard”, or “professional”.
object
Whether the plan states its worth in money or in relative units. Every plan in one set
shares a mode — a set is one price list — and a plan carries only its own mode’s fields:
an Absolute plan is refused a RelativeWeight, a Relative plan is refused a
MonthlyPrice. So nothing ever has to pick a winner
between two answers to “what is this plan worth”.
What the plan charges per month, when PricingMode is
Absolute. Three states: null = not priced yet (missing data —
never treated as free), 0 = free/trial, positive = paid. Revenue reporting excludes
null-priced plans and reports them separately.
object
The amount, as a decimal number in the currency’s major unit (49.00 is forty-nine euros).
The ISO 4217 code of the currency, upper-case (for example EUR).
What the plan is worth relative to its siblings, when PricingMode is
Relative — an unbounded weight, not a percentage, so
“Enterprise is 10x Basic” stays expressible and adding a plan never re-keys the others.
Reporting turns weights into a share of the total, so the shares add up on their own.
Three states mirroring MonthlyPrice: null = not weighted yet (never treated
as zero), 0 = carries no weight, positive = counts.
One entry per suite member the tier speaks about.
How one tier lands on one suite member: whether the tier includes that product at all, and — when included — the feature values it stamps for it.
object
The suite member this line item configures. Required on every line item except when creating a plan set for a suite of one, where the server stamps the sole member.
Defines a feature value override for a specific plan tier. Value is stored as string to support bool, enum, string, and json field values.
object
The metric name this feature’s meter is keyed by — the identity every usage read and
usage report must quote. It is NOT the feature code: codes are uppercase
(MIRAGE.IMAGE.RENDERS), metric names are lowercase (mirage.image.renders),
and the meter is resolved by an exact, case-sensitive match. Passing the code where the
metric name belongs silently finds nothing.
The feature’s display name from its catalog entry, for rendering. Server-populated on read alongside MetricName and ignored on write; null when the code resolves to no catalog entry.
What the value is counted in (GB, seats, calls), from the feature’s catalog entry. Server-populated on read alongside FeatureName and ignored on write; null when the catalog names none.
How a plan enforces a feature’s value.
Represents a tier of usage with associated credits and severity status.
object
Gets or sets the start usage for the tier.
Tier start as a percentage of the feature value (percentage-based enforcement).
Gets or sets the end usage for the tier. Nullable.
Tier end as a percentage of the feature value (percentage-based enforcement).
Gets or sets the flat fee credits for the tier.
Gets or sets the credits per unit of consumption for the tier.
Gets or sets the name of the usage tier.
Gets or sets the overage severity status for the tier.
What the server does with usage in a quota tier. Only Deny and SuspendUsage refuse a consume; every other policy accepts it and is reported in the usage status, which carries the policy the tier’s level made apply.
Metric name of the credit balance, on the same entitlement, that pays for consumption in this tier. Only meaningful on an OverUsage tier whose policy is AllowWithOverage, the one level where that policy applies as configured: name a balance and every unit past the tier’s start is priced and charged to it on commit, refusing the commit when it cannot be paid for; leave it empty and the overage is allowed and merely reported.
The period this row’s tier ladder resets on, written onto the customer’s meter when the plan is applied. Null keeps the period the product’s meter declares (a meter made for a feature with no product meter resets monthly). ConsumptionPeriod.None is a quota that never resets. Only a tiered row (UsagePlanFeatureEnforcementType.TieredAbsolute or UsagePlanFeatureEnforcementType.TieredPercentage) can carry one, and the period must be one of the named periods; a value the platform does not recognise is refused.
Responses
Section titled “Responses”Created
A named collection of usage plans (e.g. “My SaaS Plans”).
object
The suite this plan set belongs to. A single-product plan set belongs to that product’s implicit suite-of-one. Which member each tier configures is on the plan’s line items — the set itself names no product.
Lifecycle state of a usage plan set.
A usage plan such as “basic”, “standard”, or “professional”.
object
Whether the plan states its worth in money or in relative units. Every plan in one set
shares a mode — a set is one price list — and a plan carries only its own mode’s fields:
an Absolute plan is refused a RelativeWeight, a Relative plan is refused a
MonthlyPrice. So nothing ever has to pick a winner
between two answers to “what is this plan worth”.
What the plan charges per month, when PricingMode is
Absolute. Three states: null = not priced yet (missing data —
never treated as free), 0 = free/trial, positive = paid. Revenue reporting excludes
null-priced plans and reports them separately.
object
The amount, as a decimal number in the currency’s major unit (49.00 is forty-nine euros).
The ISO 4217 code of the currency, upper-case (for example EUR).
What the plan is worth relative to its siblings, when PricingMode is
Relative — an unbounded weight, not a percentage, so
“Enterprise is 10x Basic” stays expressible and adding a plan never re-keys the others.
Reporting turns weights into a share of the total, so the shares add up on their own.
Three states mirroring MonthlyPrice: null = not weighted yet (never treated
as zero), 0 = carries no weight, positive = counts.
One entry per suite member the tier speaks about.
How one tier lands on one suite member: whether the tier includes that product at all, and — when included — the feature values it stamps for it.
object
The suite member this line item configures. Required on every line item except when creating a plan set for a suite of one, where the server stamps the sole member.
Defines a feature value override for a specific plan tier. Value is stored as string to support bool, enum, string, and json field values.
object
The metric name this feature’s meter is keyed by — the identity every usage read and
usage report must quote. It is NOT the feature code: codes are uppercase
(MIRAGE.IMAGE.RENDERS), metric names are lowercase (mirage.image.renders),
and the meter is resolved by an exact, case-sensitive match. Passing the code where the
metric name belongs silently finds nothing.
The feature’s display name from its catalog entry, for rendering. Server-populated on read alongside MetricName and ignored on write; null when the code resolves to no catalog entry.
What the value is counted in (GB, seats, calls), from the feature’s catalog entry. Server-populated on read alongside FeatureName and ignored on write; null when the catalog names none.
How a plan enforces a feature’s value.
Represents a tier of usage with associated credits and severity status.
object
Gets or sets the start usage for the tier.
Tier start as a percentage of the feature value (percentage-based enforcement).
Gets or sets the end usage for the tier. Nullable.
Tier end as a percentage of the feature value (percentage-based enforcement).
Gets or sets the flat fee credits for the tier.
Gets or sets the credits per unit of consumption for the tier.
Gets or sets the name of the usage tier.
Gets or sets the overage severity status for the tier.
What the server does with usage in a quota tier. Only Deny and SuspendUsage refuse a consume; every other policy accepts it and is reported in the usage status, which carries the policy the tier’s level made apply.
Metric name of the credit balance, on the same entitlement, that pays for consumption in this tier. Only meaningful on an OverUsage tier whose policy is AllowWithOverage, the one level where that policy applies as configured: name a balance and every unit past the tier’s start is priced and charged to it on commit, refusing the commit when it cannot be paid for; leave it empty and the overage is allowed and merely reported.
The period this row’s tier ladder resets on, written onto the customer’s meter when the plan is applied. Null keeps the period the product’s meter declares (a meter made for a feature with no product meter resets monthly). ConsumptionPeriod.None is a quota that never resets. Only a tiered row (UsagePlanFeatureEnforcementType.TieredAbsolute or UsagePlanFeatureEnforcementType.TieredPercentage) can carry one, and the period must be one of the named periods; a value the platform does not recognise is refused.
Example
{ "status": "Draft", "plans": [ { "pricingMode": "Absolute", "lineItems": [ { "featureValues": [ { "featureType": "Boolean", "enforcementType": "SingleValue", "usageTiers": [ { "quotaUsageLevel": "None", "quotaUsagePolicy": "None" } ], "consumptionPeriod": "None" } ] } ] } ]}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
The URL of the resource the call created: its item URL.
Bad Request
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
The request carries no valid access token (auth.required).
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
How to authenticate: the bearer challenge.
The caller may not make this call. The code and requires members say why: a missing scope, or a plan that does not include it.
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
Not Found
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
A call with the same Idempotency-Key is still running. Send the call again once it has finished.
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
The body is not sent as application/json (request.unsupported).
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
The Idempotency-Key was used before with a different request body (operation.idempotency-key-reused).
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
Too many requests. Wait the seconds in Retry-After, then send the call again (service.too-many-requests).
The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.
object
A reference to the code’s entry on the error-codes page.
A short summary of the problem.
The HTTP status of the answer.
What went wrong in this call, in a sentence.
The path of the call.
The stable numeric error code. The error-codes page lists them.
The stable name of the error code, for example resource.not_found.
The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.
The scope or condition the caller is missing, on a refusal that names one.
The limiter that shed the call, on a 429.
On a validation failure, the messages for each field, keyed by the field’s name.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": 1, "codeName": "example", "traceId": "example", "requires": "example", "scope": "example", "errors": "example"}Headers
Section titled “Headers”The correlation id of the call: the one you sent, or the one the server made.
The seconds to wait before the call is sent again.
The calls the limiter allows in its window, when it knows.
The calls left in the window, when the limiter knows.
The seconds until the window resets, when the limiter knows.
Names the limiter that shed the call.