ZuploZuplo
LoginSign Up
  • Documentation
  • API Reference
Information
Analytics
    Get recent requests for a given deployment in the last 24 hoursgetGet statistics on requests by status code for a given deploymentget
API Keys - Buckets
    Lists bucketsgetCreates a bucketpostGets a bucketgetDeletes a bucketdeleteUpdates a bucketpatch
API Keys - Consumers
    Lists consumersgetCreates a consumerpostGets a consumergetDeletes a consumerdeleteUpdates a consumerpatchRoll consumer keyspost
API Keys - Keys
    Lists keysgetCreates an API keypostCreates multiple API keyspostGets an API keygetDeletes an API keydeleteUpdates an API keypatch
API Keys - Managers
    Lists managersgetCreates a managerpostDeletes a managerdelete
Audit Logs
    Query audit logsget
Build Logs
    Get build logsget
Client mTLS CA Certificates
    List Client mTLS CA CertificatesgetCreate Client mTLS CA CertificatepostDelete Client mTLS CA CertificatedeleteUpdate Client mTLS CA Certificatepatch
Custom Domains
    Get Custom DomainsgetCreate Custom DomainpostDelete a Custom DomaindeleteUpdate a Custom Domainpatch
Deployments
    Gets a deployment statusgetLists deploymentsgetUpload deployment sourcepostGet a deploymentgetDeletes a deploymentdeleteRe-deploy a deploymentpost
Environments
    Query environmentsgetGet an environmentget
MCP Servers
    API MCP ServerpostDocs MCP Serverpost
Metering - Features
    List featuresgetCreate featurepostGet featuregetDelete featuredelete
Metering - Meters
    List metersgetCreate meterpostGet metergetUpdate meterputDelete meterdeleteList meter group by valuesgetQuery metergetQuery meterpost
Metering - Plans
    List plansgetCreate a planpostGet plangetUpdate a planputDelete plandeleteArchive plan versionpostPublish planpost
Projects
    Create projectpost
Runtime Logs
    List request logsgetGet request log detailget
Tunnel Services
    Gets a provisioning statusgetGets a service configurationgetConfigures tunnel servicesput
Tunnels
    Lists tunnelsgetCreates a tunnelpostGets a tunnelgetDeletes a tunneldeleteRotates the tokenpostGets a teardown statusget
Variables
    Creates a variablepostUpdates a variablepatch
Other endpoints
    OpenAPI SpecificationgetLists accountsgetLists projectsgetWho Am Iget
Schemas
powered by Zudoku
Zuplo Developer API
Zuplo Developer API

Metering - Plans

API Metering plan management


List plans

GET
https://dev.zuplo.com
/v3/metering/{bucketId}/plans

⚠️ Preview: The Metering APIs are in preview and subject to change.

List all plans.

List plans › path Parameters

bucketId
​string · required

The id of the bucket. Zuplo automatically creates buckets for your project. You can find it in your Zuplo Portal under the Settings tab for your project.

List plans › query Parameters

includeDeleted
​boolean · style: form

Include deleted plans in response.

Usage: ?includeDeleted=true

Default: false
id
​string[] · style: form

Filter by plan.id attribute

key
​string[] · style: form

Filter by plan.key attribute

​object · style: deepObject

Filter by plan.key and plan.version attributes

status
​PlanStatus[] · style: form

Only return plans with the given status.

Usage:

  • ?status=active: return only the currently active plan
  • ?status=draft: return only the draft plan
  • ?status=archived: return only the archived plans
Enum values:
draft
active
archived
scheduled
currency
​CurrencyCode[] · style: form

Filter by plan.currency attribute

page
​integer · min: 1 · style: form

Page index.

Default is 1.

Default: 1
pageSize
​integer · min: 1 · max: 1000 · style: form

The maximum number of items per page.

Default is 100.

Default: 100
order
​SortOrder · enum · style: form

The order direction.

The order direction.

Enum values:
ASC
DESC
Default: ASC
orderBy
​PlanOrderBy · enum · style: form

The order by field.

Order by options for plans.

Enum values:
id
key
version
created_at
updated_at

List plans › Responses

The request has succeeded.

Paginated response
PlanPaginatedResponse
totalCount
​integer · required

The total number of items.

Example: 500
page
​integer · required

The page index.

Example: 1
pageSize
​integer · required

The maximum number of items per page.

Example: 100
​Plan[] · required

The items in the current page.

GET/v3/metering/{bucketId}/plans
curl https://dev.zuplo.com/v3/metering/:bucketId/plans
Example Responses
{ "totalCount": 500, "page": 1, "pageSize": 100, "items": [ { "id": "01G65Z755AFWAKHE12NY0CQ9FH", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "createdAt": "2024-01-01T01:01:01.001Z", "updatedAt": "2024-01-01T01:01:01.001Z", "deletedAt": "2024-01-01T01:01:01.001Z", "key": "key", "alignment": { "billablesMustAlign": true }, "version": 1, "currency": "USD", "billingCadence": "P1M", "proRatingConfig": { "enabled": true, "mode": "max_consumption_based" }, "effectiveFrom": "2023-01-01T01:01:01.001Z", "effectiveTo": "2023-01-01T01:01:01.001Z", "status": "draft", "phases": [ { "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "duration": "P1Y", "rateCards": [ { "type": "flat_fee", "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "featureKey": "featureKey", "entitlementTemplate": { "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "type": "metered", "isSoftLimit": false, "issueAfterReset": 0, "issueAfterResetPriority": 1, "preserveOverageAtReset": false, "usagePeriod": "P3D" }, "taxConfig": { "behavior": "inclusive", "stripe": { "code": "txcd_10000000" }, "customInvoicing": { "code": "code" } }, "billingCadence": "P3D", "price": { "type": "flat", "amount": "100", "paymentTerm": "in_arrears" }, "discounts": { "percentage": { "percentage": 50 }, "usage": { "quantity": "quantity" } } } ] } ], "validationErrors": [ { "field": "addons/pro/ratecards/token/featureKey", "code": "invalid_feature_key", "message": "not found feature by key", "attributes": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" } } ], "paymentMethodRequired": true } ] }
json
application/json

Create a plan

POST
https://dev.zuplo.com
/v3/metering/{bucketId}/plans

⚠️ Preview: The Metering APIs are in preview and subject to change.

Create a new plan or a new version of an existing plan.

If no plan exists with the given key, a new plan is created with version 1. If a plan with the given key already exists, a new draft version is created with an incremented version number. Only one draft version per plan key is allowed at a time.

Create a plan › path Parameters

bucketId
​string · required

The id of the bucket. Zuplo automatically creates buckets for your project. You can find it in your Zuplo Portal under the Settings tab for your project.

Create a plan › Request Body

Resource create operation model.
PlanCreate
name
​string · minLength: 1 · maxLength: 256 · required

Human-readable name for the resource. Between 1 and 256 characters.

key
​string · minLength: 1 · maxLength: 64 · pattern: ^[a-z0-9]+(?:_[a-z0-… · required

A semi-unique identifier for the resource.

currency
​string · minLength: 3 · maxLength: 3 · pattern: ^[A-Z]{3}$ · required

The currency code of the plan.

Example: USD
Default: USD
billingCadence
​string · duration · required

The default billing cadence for subscriptions using this plan. Defines how often customers are billed using ISO8601 duration format. Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).

Example: P1M
​PlanPhase[] · minItems: 1 · required

The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses. A phase switch occurs only at the end of a billing period, ensuring that a single subscription invoice will not include charges from different phase prices.

description
​string · maxLength: 1024

Optional description of the resource. Maximum 1024 characters.

​object | null

Additional metadata for the resource.

Example: {"externalId":"019142cc-a016-796a-8113-1a942fecd26d"}
​object

Default pro-rating configuration for subscriptions using this plan.

Default: {"enabled":true,"mode":"max_consumption_based"}
​object · deprecated

Alignment configuration for the plan.

Create a plan › Responses

The request has succeeded and a new resource has been created as a result.

Plans provide a template for subscriptions.
Plan
id
​string · readOnly · pattern: ^[0-7][0-9A-HJKMNP-T… · required

A unique identifier for the resource.

Example: 01G65Z755AFWAKHE12NY0CQ9FH
name
​string · minLength: 1 · maxLength: 256 · required

Human-readable name for the resource. Between 1 and 256 characters.

createdAt
​string · date-time · readOnly · required

Timestamp of when the resource was created.

Example: 2024-01-01T01:01:01.001Z
updatedAt
​string · date-time · readOnly · required

Timestamp of when the resource was last updated.

Example: 2024-01-01T01:01:01.001Z
key
​string · minLength: 1 · maxLength: 64 · pattern: ^[a-z0-9]+(?:_[a-z0-… · required

A semi-unique identifier for the resource.

version
​integer · min: 1 · readOnly · required

Version of the plan. Incremented when the plan is updated.

Default: 1
currency
​string · minLength: 3 · maxLength: 3 · pattern: ^[A-Z]{3}$ · required

The currency code of the plan.

Example: USD
Default: USD
billingCadence
​string · duration · required

The default billing cadence for subscriptions using this plan. Defines how often customers are billed using ISO8601 duration format. Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).

Example: P1M
status
​string · enum · readOnly · required

The status of the plan. Computed based on the effective start and end dates:

  • draft = no effectiveFrom
  • active = effectiveFrom <= now < effectiveTo
  • archived / inactive = effectiveTo <= now
  • scheduled = now < effectiveFrom < effectiveTo
Enum values:
draft
active
archived
scheduled
​PlanPhase[] · minItems: 1 · required

The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses. A phase switch occurs only at the end of a billing period, ensuring that a single subscription invoice will not include charges from different phase prices.

​array | null · readOnly · required

List of validation errors.

paymentMethodRequired
​boolean · readOnly · required

Indicates whether a payment method is required to create a subscription with this plan. Computed based on whether ANY phase has billable items (rate cards with prices). Aligns with the subscription validator's billing setup check which checks all phases.

description
​string · maxLength: 1024

Optional description of the resource. Maximum 1024 characters.

​object | null

Additional metadata for the resource.

Example: {"externalId":"019142cc-a016-796a-8113-1a942fecd26d"}
deletedAt
​string · date-time · readOnly

Timestamp of when the resource was permanently deleted.

Example: 2024-01-01T01:01:01.001Z
​object

Default pro-rating configuration for subscriptions using this plan.

Default: {"enabled":true,"mode":"max_consumption_based"}
effectiveFrom
​string · date-time · readOnly

The date and time when the plan becomes effective. When not specified, the plan is a draft.

Example: 2023-01-01T01:01:01.001Z
effectiveTo
​string · date-time · readOnly

The date and time when the plan is no longer effective. When not specified, the plan is effective indefinitely.

Example: 2023-01-01T01:01:01.001Z
​object · deprecated

Alignment configuration for the plan.

POST/v3/metering/{bucketId}/plans
curl https://dev.zuplo.com/v3/metering/:bucketId/plans \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "key": "key", "alignment": { "billablesMustAlign": true }, "currency": "USD", "billingCadence": "P1M", "proRatingConfig": { "enabled": true, "mode": "max_consumption_based" }, "phases": [ { "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "duration": "P1Y", "rateCards": [ { "type": "flat_fee", "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "featureKey": "featureKey", "entitlementTemplate": { "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "type": "metered", "isSoftLimit": false, "issueAfterReset": 0, "issueAfterResetPriority": 1, "preserveOverageAtReset": false, "usagePeriod": "P3D" }, "taxConfig": { "behavior": "inclusive", "stripe": { "code": "txcd_10000000" }, "customInvoicing": { "code": "code" } }, "billingCadence": "P3D", "price": { "type": "flat", "amount": "100", "paymentTerm": "in_arrears" }, "discounts": { "percentage": { "percentage": 50 }, "usage": { "quantity": "quantity" } } } ] } ] }'
Example Request Body
{ "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "key": "key", "alignment": { "billablesMustAlign": true }, "currency": "USD", "billingCadence": "P1M", "proRatingConfig": { "enabled": true, "mode": "max_consumption_based" }, "phases": [ { "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "duration": "P1Y", "rateCards": [ { "type": "flat_fee", "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "featureKey": "featureKey", "entitlementTemplate": { "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "type": "metered", "isSoftLimit": false, "issueAfterReset": 0, "issueAfterResetPriority": 1, "preserveOverageAtReset": false, "usagePeriod": "P3D" }, "taxConfig": { "behavior": "inclusive", "stripe": { "code": "txcd_10000000" }, "customInvoicing": { "code": "code" } }, "billingCadence": "P3D", "price": { "type": "flat", "amount": "100", "paymentTerm": "in_arrears" }, "discounts": { "percentage": { "percentage": 50 }, "usage": { "quantity": "quantity" } } } ] } ] }
json
Example Responses
{ "id": "01G65Z755AFWAKHE12NY0CQ9FH", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "createdAt": "2024-01-01T01:01:01.001Z", "updatedAt": "2024-01-01T01:01:01.001Z", "deletedAt": "2024-01-01T01:01:01.001Z", "key": "key", "alignment": { "billablesMustAlign": true }, "version": 1, "currency": "USD", "billingCadence": "P1M", "proRatingConfig": { "enabled": true, "mode": "max_consumption_based" }, "effectiveFrom": "2023-01-01T01:01:01.001Z", "effectiveTo": "2023-01-01T01:01:01.001Z", "status": "draft", "phases": [ { "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "duration": "P1Y", "rateCards": [ { "type": "flat_fee", "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "featureKey": "featureKey", "entitlementTemplate": { "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "type": "metered", "isSoftLimit": false, "issueAfterReset": 0, "issueAfterResetPriority": 1, "preserveOverageAtReset": false, "usagePeriod": "P3D" }, "taxConfig": { "behavior": "inclusive", "stripe": { "code": "txcd_10000000" }, "customInvoicing": { "code": "code" } }, "billingCadence": "P3D", "price": { "type": "flat", "amount": "100", "paymentTerm": "in_arrears" }, "discounts": { "percentage": { "percentage": 50 }, "usage": { "quantity": "quantity" } } } ] } ], "validationErrors": [ { "field": "addons/pro/ratecards/token/featureKey", "code": "invalid_feature_key", "message": "not found feature by key", "attributes": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" } } ], "paymentMethodRequired": true }
json
application/json

Get plan

GET
https://dev.zuplo.com
/v3/metering/{bucketId}/plans/{planId}

⚠️ Preview: The Metering APIs are in preview and subject to change.

Get a plan by id or key. The latest published version is returned if latter is used.

Get plan › path Parameters

bucketId
​string · required

The id of the bucket. Zuplo automatically creates buckets for your project. You can find it in your Zuplo Portal under the Settings tab for your project.

planId
​string · minLength: 1 · maxLength: 64 · pattern: ^[a-z0-9]+(?:_[a-z0-… · required

Get plan › query Parameters

includeLatest
​boolean · style: form

Include latest version of the Plan instead of the version in active state.

Usage: ?includeLatest=true

Default: false

Get plan › Responses

The request has succeeded.

Plans provide a template for subscriptions.
Plan
id
​string · readOnly · pattern: ^[0-7][0-9A-HJKMNP-T… · required

A unique identifier for the resource.

Example: 01G65Z755AFWAKHE12NY0CQ9FH
name
​string · minLength: 1 · maxLength: 256 · required

Human-readable name for the resource. Between 1 and 256 characters.

createdAt
​string · date-time · readOnly · required

Timestamp of when the resource was created.

Example: 2024-01-01T01:01:01.001Z
updatedAt
​string · date-time · readOnly · required

Timestamp of when the resource was last updated.

Example: 2024-01-01T01:01:01.001Z
key
​string · minLength: 1 · maxLength: 64 · pattern: ^[a-z0-9]+(?:_[a-z0-… · required

A semi-unique identifier for the resource.

version
​integer · min: 1 · readOnly · required

Version of the plan. Incremented when the plan is updated.

Default: 1
currency
​string · minLength: 3 · maxLength: 3 · pattern: ^[A-Z]{3}$ · required

The currency code of the plan.

Example: USD
Default: USD
billingCadence
​string · duration · required

The default billing cadence for subscriptions using this plan. Defines how often customers are billed using ISO8601 duration format. Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).

Example: P1M
status
​string · enum · readOnly · required

The status of the plan. Computed based on the effective start and end dates:

  • draft = no effectiveFrom
  • active = effectiveFrom <= now < effectiveTo
  • archived / inactive = effectiveTo <= now
  • scheduled = now < effectiveFrom < effectiveTo
Enum values:
draft
active
archived
scheduled
​PlanPhase[] · minItems: 1 · required

The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses. A phase switch occurs only at the end of a billing period, ensuring that a single subscription invoice will not include charges from different phase prices.

​array | null · readOnly · required

List of validation errors.

paymentMethodRequired
​boolean · readOnly · required

Indicates whether a payment method is required to create a subscription with this plan. Computed based on whether ANY phase has billable items (rate cards with prices). Aligns with the subscription validator's billing setup check which checks all phases.

description
​string · maxLength: 1024

Optional description of the resource. Maximum 1024 characters.

​object | null

Additional metadata for the resource.

Example: {"externalId":"019142cc-a016-796a-8113-1a942fecd26d"}
deletedAt
​string · date-time · readOnly

Timestamp of when the resource was permanently deleted.

Example: 2024-01-01T01:01:01.001Z
​object

Default pro-rating configuration for subscriptions using this plan.

Default: {"enabled":true,"mode":"max_consumption_based"}
effectiveFrom
​string · date-time · readOnly

The date and time when the plan becomes effective. When not specified, the plan is a draft.

Example: 2023-01-01T01:01:01.001Z
effectiveTo
​string · date-time · readOnly

The date and time when the plan is no longer effective. When not specified, the plan is effective indefinitely.

Example: 2023-01-01T01:01:01.001Z
​object · deprecated

Alignment configuration for the plan.

GET/v3/metering/{bucketId}/plans/{planId}
curl https://dev.zuplo.com/v3/metering/:bucketId/plans/:planId
Example Responses
{ "id": "01G65Z755AFWAKHE12NY0CQ9FH", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "createdAt": "2024-01-01T01:01:01.001Z", "updatedAt": "2024-01-01T01:01:01.001Z", "deletedAt": "2024-01-01T01:01:01.001Z", "key": "key", "alignment": { "billablesMustAlign": true }, "version": 1, "currency": "USD", "billingCadence": "P1M", "proRatingConfig": { "enabled": true, "mode": "max_consumption_based" }, "effectiveFrom": "2023-01-01T01:01:01.001Z", "effectiveTo": "2023-01-01T01:01:01.001Z", "status": "draft", "phases": [ { "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "duration": "P1Y", "rateCards": [ { "type": "flat_fee", "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "featureKey": "featureKey", "entitlementTemplate": { "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "type": "metered", "isSoftLimit": false, "issueAfterReset": 0, "issueAfterResetPriority": 1, "preserveOverageAtReset": false, "usagePeriod": "P3D" }, "taxConfig": { "behavior": "inclusive", "stripe": { "code": "txcd_10000000" }, "customInvoicing": { "code": "code" } }, "billingCadence": "P3D", "price": { "type": "flat", "amount": "100", "paymentTerm": "in_arrears" }, "discounts": { "percentage": { "percentage": 50 }, "usage": { "quantity": "quantity" } } } ] } ], "validationErrors": [ { "field": "addons/pro/ratecards/token/featureKey", "code": "invalid_feature_key", "message": "not found feature by key", "attributes": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" } } ], "paymentMethodRequired": true }
json
application/json

Update a plan

PUT
https://dev.zuplo.com
/v3/metering/{bucketId}/plans/{planId}

⚠️ Preview: The Metering APIs are in preview and subject to change.

Update plan by id.

Update a plan › path Parameters

bucketId
​string · required

The id of the bucket. Zuplo automatically creates buckets for your project. You can find it in your Zuplo Portal under the Settings tab for your project.

planId
​string · pattern: ^[0-7][0-9A-HJKMNP-T… · required

Update a plan › Request Body

Resource update operation model.
PlanReplaceUpdate
name
​string · minLength: 1 · maxLength: 256 · required

Human-readable name for the resource. Between 1 and 256 characters.

billingCadence
​string · duration · required

The default billing cadence for subscriptions using this plan. Defines how often customers are billed using ISO8601 duration format. Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).

Example: P1M
​PlanPhase[] · minItems: 1 · required

The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses. A phase switch occurs only at the end of a billing period, ensuring that a single subscription invoice will not include charges from different phase prices.

description
​string · maxLength: 1024

Optional description of the resource. Maximum 1024 characters.

​object | null

Additional metadata for the resource.

Example: {"externalId":"019142cc-a016-796a-8113-1a942fecd26d"}
​object

Default pro-rating configuration for subscriptions using this plan.

Default: {"enabled":true,"mode":"max_consumption_based"}
​object · deprecated

Alignment configuration for the plan.

Update a plan › Responses

The request has succeeded.

Plans provide a template for subscriptions.
Plan
id
​string · readOnly · pattern: ^[0-7][0-9A-HJKMNP-T… · required

A unique identifier for the resource.

Example: 01G65Z755AFWAKHE12NY0CQ9FH
name
​string · minLength: 1 · maxLength: 256 · required

Human-readable name for the resource. Between 1 and 256 characters.

createdAt
​string · date-time · readOnly · required

Timestamp of when the resource was created.

Example: 2024-01-01T01:01:01.001Z
updatedAt
​string · date-time · readOnly · required

Timestamp of when the resource was last updated.

Example: 2024-01-01T01:01:01.001Z
key
​string · minLength: 1 · maxLength: 64 · pattern: ^[a-z0-9]+(?:_[a-z0-… · required

A semi-unique identifier for the resource.

version
​integer · min: 1 · readOnly · required

Version of the plan. Incremented when the plan is updated.

Default: 1
currency
​string · minLength: 3 · maxLength: 3 · pattern: ^[A-Z]{3}$ · required

The currency code of the plan.

Example: USD
Default: USD
billingCadence
​string · duration · required

The default billing cadence for subscriptions using this plan. Defines how often customers are billed using ISO8601 duration format. Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).

Example: P1M
status
​string · enum · readOnly · required

The status of the plan. Computed based on the effective start and end dates:

  • draft = no effectiveFrom
  • active = effectiveFrom <= now < effectiveTo
  • archived / inactive = effectiveTo <= now
  • scheduled = now < effectiveFrom < effectiveTo
Enum values:
draft
active
archived
scheduled
​PlanPhase[] · minItems: 1 · required

The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses. A phase switch occurs only at the end of a billing period, ensuring that a single subscription invoice will not include charges from different phase prices.

​array | null · readOnly · required

List of validation errors.

paymentMethodRequired
​boolean · readOnly · required

Indicates whether a payment method is required to create a subscription with this plan. Computed based on whether ANY phase has billable items (rate cards with prices). Aligns with the subscription validator's billing setup check which checks all phases.

description
​string · maxLength: 1024

Optional description of the resource. Maximum 1024 characters.

​object | null

Additional metadata for the resource.

Example: {"externalId":"019142cc-a016-796a-8113-1a942fecd26d"}
deletedAt
​string · date-time · readOnly

Timestamp of when the resource was permanently deleted.

Example: 2024-01-01T01:01:01.001Z
​object

Default pro-rating configuration for subscriptions using this plan.

Default: {"enabled":true,"mode":"max_consumption_based"}
effectiveFrom
​string · date-time · readOnly

The date and time when the plan becomes effective. When not specified, the plan is a draft.

Example: 2023-01-01T01:01:01.001Z
effectiveTo
​string · date-time · readOnly

The date and time when the plan is no longer effective. When not specified, the plan is effective indefinitely.

Example: 2023-01-01T01:01:01.001Z
​object · deprecated

Alignment configuration for the plan.

PUT/v3/metering/{bucketId}/plans/{planId}
curl https://dev.zuplo.com/v3/metering/:bucketId/plans/:planId \ --request PUT \ --header 'Content-Type: application/json' \ --data '{ "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "alignment": { "billablesMustAlign": true }, "billingCadence": "P1M", "proRatingConfig": { "enabled": true, "mode": "max_consumption_based" }, "phases": [ { "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "duration": "P1Y", "rateCards": [ { "type": "flat_fee", "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "featureKey": "featureKey", "entitlementTemplate": { "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "type": "metered", "isSoftLimit": false, "issueAfterReset": 0, "issueAfterResetPriority": 1, "preserveOverageAtReset": false, "usagePeriod": "P3D" }, "taxConfig": { "behavior": "inclusive", "stripe": { "code": "txcd_10000000" }, "customInvoicing": { "code": "code" } }, "billingCadence": "P3D", "price": { "type": "flat", "amount": "100", "paymentTerm": "in_arrears" }, "discounts": { "percentage": { "percentage": 50 }, "usage": { "quantity": "quantity" } } } ] } ] }'
Example Request Body
{ "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "alignment": { "billablesMustAlign": true }, "billingCadence": "P1M", "proRatingConfig": { "enabled": true, "mode": "max_consumption_based" }, "phases": [ { "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "duration": "P1Y", "rateCards": [ { "type": "flat_fee", "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "featureKey": "featureKey", "entitlementTemplate": { "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "type": "metered", "isSoftLimit": false, "issueAfterReset": 0, "issueAfterResetPriority": 1, "preserveOverageAtReset": false, "usagePeriod": "P3D" }, "taxConfig": { "behavior": "inclusive", "stripe": { "code": "txcd_10000000" }, "customInvoicing": { "code": "code" } }, "billingCadence": "P3D", "price": { "type": "flat", "amount": "100", "paymentTerm": "in_arrears" }, "discounts": { "percentage": { "percentage": 50 }, "usage": { "quantity": "quantity" } } } ] } ] }
json
Example Responses
{ "id": "01G65Z755AFWAKHE12NY0CQ9FH", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "createdAt": "2024-01-01T01:01:01.001Z", "updatedAt": "2024-01-01T01:01:01.001Z", "deletedAt": "2024-01-01T01:01:01.001Z", "key": "key", "alignment": { "billablesMustAlign": true }, "version": 1, "currency": "USD", "billingCadence": "P1M", "proRatingConfig": { "enabled": true, "mode": "max_consumption_based" }, "effectiveFrom": "2023-01-01T01:01:01.001Z", "effectiveTo": "2023-01-01T01:01:01.001Z", "status": "draft", "phases": [ { "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "duration": "P1Y", "rateCards": [ { "type": "flat_fee", "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "featureKey": "featureKey", "entitlementTemplate": { "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "type": "metered", "isSoftLimit": false, "issueAfterReset": 0, "issueAfterResetPriority": 1, "preserveOverageAtReset": false, "usagePeriod": "P3D" }, "taxConfig": { "behavior": "inclusive", "stripe": { "code": "txcd_10000000" }, "customInvoicing": { "code": "code" } }, "billingCadence": "P3D", "price": { "type": "flat", "amount": "100", "paymentTerm": "in_arrears" }, "discounts": { "percentage": { "percentage": 50 }, "usage": { "quantity": "quantity" } } } ] } ], "validationErrors": [ { "field": "addons/pro/ratecards/token/featureKey", "code": "invalid_feature_key", "message": "not found feature by key", "attributes": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" } } ], "paymentMethodRequired": true }
json
application/json

Delete plan

DELETE
https://dev.zuplo.com
/v3/metering/{bucketId}/plans/{planId}

⚠️ Preview: The Metering APIs are in preview and subject to change.

Soft delete plan by plan.id.

Once a plan is deleted it cannot be undeleted.

Delete plan › path Parameters

bucketId
​string · required

The id of the bucket. Zuplo automatically creates buckets for your project. You can find it in your Zuplo Portal under the Settings tab for your project.

planId
​string · pattern: ^[0-7][0-9A-HJKMNP-T… · required

Delete plan › Responses

There is no content to send for this request, but the headers may be useful.

No data returned
DELETE/v3/metering/{bucketId}/plans/{planId}
curl https://dev.zuplo.com/v3/metering/:bucketId/plans/:planId \ --request DELETE
Example Responses
No example specified for this content type

Archive plan version

POST
https://dev.zuplo.com
/v3/metering/{bucketId}/plans/{planId}/archive

⚠️ Preview: The Metering APIs are in preview and subject to change.

Archive a plan version.

Archive plan version › path Parameters

bucketId
​string · required

The id of the bucket. Zuplo automatically creates buckets for your project. You can find it in your Zuplo Portal under the Settings tab for your project.

planId
​string · pattern: ^[0-7][0-9A-HJKMNP-T… · required

Archive plan version › Responses

The request has succeeded.

Plans provide a template for subscriptions.
Plan
id
​string · readOnly · pattern: ^[0-7][0-9A-HJKMNP-T… · required

A unique identifier for the resource.

Example: 01G65Z755AFWAKHE12NY0CQ9FH
name
​string · minLength: 1 · maxLength: 256 · required

Human-readable name for the resource. Between 1 and 256 characters.

createdAt
​string · date-time · readOnly · required

Timestamp of when the resource was created.

Example: 2024-01-01T01:01:01.001Z
updatedAt
​string · date-time · readOnly · required

Timestamp of when the resource was last updated.

Example: 2024-01-01T01:01:01.001Z
key
​string · minLength: 1 · maxLength: 64 · pattern: ^[a-z0-9]+(?:_[a-z0-… · required

A semi-unique identifier for the resource.

version
​integer · min: 1 · readOnly · required

Version of the plan. Incremented when the plan is updated.

Default: 1
currency
​string · minLength: 3 · maxLength: 3 · pattern: ^[A-Z]{3}$ · required

The currency code of the plan.

Example: USD
Default: USD
billingCadence
​string · duration · required

The default billing cadence for subscriptions using this plan. Defines how often customers are billed using ISO8601 duration format. Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).

Example: P1M
status
​string · enum · readOnly · required

The status of the plan. Computed based on the effective start and end dates:

  • draft = no effectiveFrom
  • active = effectiveFrom <= now < effectiveTo
  • archived / inactive = effectiveTo <= now
  • scheduled = now < effectiveFrom < effectiveTo
Enum values:
draft
active
archived
scheduled
​PlanPhase[] · minItems: 1 · required

The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses. A phase switch occurs only at the end of a billing period, ensuring that a single subscription invoice will not include charges from different phase prices.

​array | null · readOnly · required

List of validation errors.

paymentMethodRequired
​boolean · readOnly · required

Indicates whether a payment method is required to create a subscription with this plan. Computed based on whether ANY phase has billable items (rate cards with prices). Aligns with the subscription validator's billing setup check which checks all phases.

description
​string · maxLength: 1024

Optional description of the resource. Maximum 1024 characters.

​object | null

Additional metadata for the resource.

Example: {"externalId":"019142cc-a016-796a-8113-1a942fecd26d"}
deletedAt
​string · date-time · readOnly

Timestamp of when the resource was permanently deleted.

Example: 2024-01-01T01:01:01.001Z
​object

Default pro-rating configuration for subscriptions using this plan.

Default: {"enabled":true,"mode":"max_consumption_based"}
effectiveFrom
​string · date-time · readOnly

The date and time when the plan becomes effective. When not specified, the plan is a draft.

Example: 2023-01-01T01:01:01.001Z
effectiveTo
​string · date-time · readOnly

The date and time when the plan is no longer effective. When not specified, the plan is effective indefinitely.

Example: 2023-01-01T01:01:01.001Z
​object · deprecated

Alignment configuration for the plan.

POST/v3/metering/{bucketId}/plans/{planId}/archive
curl https://dev.zuplo.com/v3/metering/:bucketId/plans/:planId/archive \ --request POST
Example Responses
{ "id": "01G65Z755AFWAKHE12NY0CQ9FH", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "createdAt": "2024-01-01T01:01:01.001Z", "updatedAt": "2024-01-01T01:01:01.001Z", "deletedAt": "2024-01-01T01:01:01.001Z", "key": "key", "alignment": { "billablesMustAlign": true }, "version": 1, "currency": "USD", "billingCadence": "P1M", "proRatingConfig": { "enabled": true, "mode": "max_consumption_based" }, "effectiveFrom": "2023-01-01T01:01:01.001Z", "effectiveTo": "2023-01-01T01:01:01.001Z", "status": "draft", "phases": [ { "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "duration": "P1Y", "rateCards": [ { "type": "flat_fee", "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "featureKey": "featureKey", "entitlementTemplate": { "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "type": "metered", "isSoftLimit": false, "issueAfterReset": 0, "issueAfterResetPriority": 1, "preserveOverageAtReset": false, "usagePeriod": "P3D" }, "taxConfig": { "behavior": "inclusive", "stripe": { "code": "txcd_10000000" }, "customInvoicing": { "code": "code" } }, "billingCadence": "P3D", "price": { "type": "flat", "amount": "100", "paymentTerm": "in_arrears" }, "discounts": { "percentage": { "percentage": 50 }, "usage": { "quantity": "quantity" } } } ] } ], "validationErrors": [ { "field": "addons/pro/ratecards/token/featureKey", "code": "invalid_feature_key", "message": "not found feature by key", "attributes": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" } } ], "paymentMethodRequired": true }
json
application/json

Publish plan

POST
https://dev.zuplo.com
/v3/metering/{bucketId}/plans/{planId}/publish

⚠️ Preview: The Metering APIs are in preview and subject to change.

Publish a plan version.

Publish plan › path Parameters

bucketId
​string · required

The id of the bucket. Zuplo automatically creates buckets for your project. You can find it in your Zuplo Portal under the Settings tab for your project.

planId
​string · pattern: ^[0-7][0-9A-HJKMNP-T… · required

Publish plan › Responses

The request has succeeded.

Plans provide a template for subscriptions.
Plan
id
​string · readOnly · pattern: ^[0-7][0-9A-HJKMNP-T… · required

A unique identifier for the resource.

Example: 01G65Z755AFWAKHE12NY0CQ9FH
name
​string · minLength: 1 · maxLength: 256 · required

Human-readable name for the resource. Between 1 and 256 characters.

createdAt
​string · date-time · readOnly · required

Timestamp of when the resource was created.

Example: 2024-01-01T01:01:01.001Z
updatedAt
​string · date-time · readOnly · required

Timestamp of when the resource was last updated.

Example: 2024-01-01T01:01:01.001Z
key
​string · minLength: 1 · maxLength: 64 · pattern: ^[a-z0-9]+(?:_[a-z0-… · required

A semi-unique identifier for the resource.

version
​integer · min: 1 · readOnly · required

Version of the plan. Incremented when the plan is updated.

Default: 1
currency
​string · minLength: 3 · maxLength: 3 · pattern: ^[A-Z]{3}$ · required

The currency code of the plan.

Example: USD
Default: USD
billingCadence
​string · duration · required

The default billing cadence for subscriptions using this plan. Defines how often customers are billed using ISO8601 duration format. Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).

Example: P1M
status
​string · enum · readOnly · required

The status of the plan. Computed based on the effective start and end dates:

  • draft = no effectiveFrom
  • active = effectiveFrom <= now < effectiveTo
  • archived / inactive = effectiveTo <= now
  • scheduled = now < effectiveFrom < effectiveTo
Enum values:
draft
active
archived
scheduled
​PlanPhase[] · minItems: 1 · required

The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses. A phase switch occurs only at the end of a billing period, ensuring that a single subscription invoice will not include charges from different phase prices.

​array | null · readOnly · required

List of validation errors.

paymentMethodRequired
​boolean · readOnly · required

Indicates whether a payment method is required to create a subscription with this plan. Computed based on whether ANY phase has billable items (rate cards with prices). Aligns with the subscription validator's billing setup check which checks all phases.

description
​string · maxLength: 1024

Optional description of the resource. Maximum 1024 characters.

​object | null

Additional metadata for the resource.

Example: {"externalId":"019142cc-a016-796a-8113-1a942fecd26d"}
deletedAt
​string · date-time · readOnly

Timestamp of when the resource was permanently deleted.

Example: 2024-01-01T01:01:01.001Z
​object

Default pro-rating configuration for subscriptions using this plan.

Default: {"enabled":true,"mode":"max_consumption_based"}
effectiveFrom
​string · date-time · readOnly

The date and time when the plan becomes effective. When not specified, the plan is a draft.

Example: 2023-01-01T01:01:01.001Z
effectiveTo
​string · date-time · readOnly

The date and time when the plan is no longer effective. When not specified, the plan is effective indefinitely.

Example: 2023-01-01T01:01:01.001Z
​object · deprecated

Alignment configuration for the plan.

POST/v3/metering/{bucketId}/plans/{planId}/publish
curl https://dev.zuplo.com/v3/metering/:bucketId/plans/:planId/publish \ --request POST
Example Responses
{ "id": "01G65Z755AFWAKHE12NY0CQ9FH", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "createdAt": "2024-01-01T01:01:01.001Z", "updatedAt": "2024-01-01T01:01:01.001Z", "deletedAt": "2024-01-01T01:01:01.001Z", "key": "key", "alignment": { "billablesMustAlign": true }, "version": 1, "currency": "USD", "billingCadence": "P1M", "proRatingConfig": { "enabled": true, "mode": "max_consumption_based" }, "effectiveFrom": "2023-01-01T01:01:01.001Z", "effectiveTo": "2023-01-01T01:01:01.001Z", "status": "draft", "phases": [ { "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "duration": "P1Y", "rateCards": [ { "type": "flat_fee", "key": "key", "name": "name", "description": "description", "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "featureKey": "featureKey", "entitlementTemplate": { "metadata": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" }, "type": "metered", "isSoftLimit": false, "issueAfterReset": 0, "issueAfterResetPriority": 1, "preserveOverageAtReset": false, "usagePeriod": "P3D" }, "taxConfig": { "behavior": "inclusive", "stripe": { "code": "txcd_10000000" }, "customInvoicing": { "code": "code" } }, "billingCadence": "P3D", "price": { "type": "flat", "amount": "100", "paymentTerm": "in_arrears" }, "discounts": { "percentage": { "percentage": 50 }, "usage": { "quantity": "quantity" } } } ] } ], "validationErrors": [ { "field": "addons/pro/ratecards/token/featureKey", "code": "invalid_feature_key", "message": "not found feature by key", "attributes": { "externalId": "019142cc-a016-796a-8113-1a942fecd26d" } } ], "paymentMethodRequired": true }
json
application/json

Metering - MetersProjects