---
title: "Create billing plan"
method: POST
path: "/_api/plan"
tags: ["Administration"]
---

# Create billing plan

`POST /_api/plan`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_api/plan/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new billing plan.

**Note**: Requires *administrator* permissions.

## Request body

- PlanCreate
  - `name` string, required: Name and unique identifier of the of the billing plan.
  - `planId` string: ID of the billing plan.
  - `description` string: Description of the billing plan.
  - `featureGates` string[], required: List of the billing plan feature gates.
  - `attribution` string, required: Attribution of the billing plan. Combination of attribution and label must be unique for the plan.
  - `label` string, required: Display label of the billing plan. Combination of attribution and label must be unique for the plan.
  - `pricing` string: Pricing details of the billing plan.
  - `isBundle` boolean: Bundle.
  - `metadata` object: Metadata of the plan, having set of key-value pairs.
  - `metrics` PlanMetricsExample[]: List of metrics applicable for billing plan.
    - `name` string: Name of the metrics. e.g. reads, writes etc.
    - `value` string: Value of the metrics. e.g. c8db_service_read_requests_count, c8db_service_write_requests_count etc.
    - `metricType` string: Name of the metrics. e.g. counter, gauge, histogram.
  - `active` boolean, required: A mandatory flag that specifies whether the billing plan is active.
  - `demo` boolean: An flag that specifies whether the billing plan is demo or not.

## Response `201`

Successfully created billing plan.

- Plan201Billing
  - `active` boolean: Active status of the billing plan.
  - `attribution` string: Attribution name of the billing plan.
  - `demo` boolean: Flag about demo status of the billing plan.
  - `description` string: Information of the billing plan.
  - `featureGates` string[]: List of featureGates associated with billing plan.
  - `isBundle` boolean
  - `label` string: Label of the billing plan.
  - `metadata` object: Metadata about the billing plan.
  - `metrics` object[]: Metric values displayed along with name.
    - `name` string
    - `value` string
    - `metricType` string
  - `name` string: Name of the billing plan.
  - `planID` string: ID associated with the billing plan.
  - `pricing` string: Pricing details of the billing plan.

## Other responses

- `400`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `401`: Failed because you do not have administrator permissions.
- `403`: Failed to validate because you do not have access to the server.
- `404`: Failed to find specified billing plan.
- `409`: Failed becasue billing plan already exists.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
