---
title: "Create a feature"
method: POST
path: "/features"
tags: ["Features"]
---

# Create a feature

`POST /features`

## Request

- Base URL: `https://api-m.sandbox.paypal.com`
- URL: `https://api-m.sandbox.paypal.com/features`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `/api/oauth-proxy` scopes: `read`, `write`
- TypeScript: <https://skmtc.dev/paypal/apis/usage-based-billing-api/docs/features/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new feature that represents a capability or functionality that can be entitled to customers. Features are the building blocks of your entitlement system - they define what can be granted to customers and what aspects can be configured. Each feature can have multiple privileges that allow fine-grained control over its behavior (e.g., a 'seats' feature might have 'max' and 'max_admins' privileges). Once created, features can be assigned to plans with specific privilege values.

## Request body

- FeatureRequest: Core properties that define a feature - a capability or functionality that can be entitled to customers through plans or subscriptions
  - `code` string, required: Unique identifier for the feature across your entire system. This code is used when creating entitlements and should represent the feature's function (e.g., 'seats', 'api-access', 'API_STORAGE'). Allows alphanumeric characters, underscores, and hyphens.
  - `name` string: Customer-facing name of the feature that clearly describes what functionality or capability it provides. This name appears in billing interfaces and customer portals.
  - `description` string: Detailed explanation of what this feature provides, its limitations, and how it affects the customer's experience.
  - `privileges` FeaturePrivilegeBase[]: List of configurable privileges that define what aspects of this feature can be customized when creating entitlements. Each privilege can have different values assigned in different plans or subscriptions. Can be empty if the feature is simply on/off.
    - `code` string, required: Unique identifier for the privilege within its parent feature. Used as a key when assigning values to this privilege in entitlements. Allows alphanumeric characters, underscores, and hyphens.
    - `name` string: Human-friendly display name for the privilege shown in user interfaces. This helps users understand what aspect of the feature is being configured.
    - `value_type` 'STRING' | 'BOOLEAN' | 'INTEGER' | 'SELECT': Defines the data type that this privilege accepts when being assigned values in entitlements. 'INTEGER' for numeric limits, 'BOOLEAN' for on/off toggles, 'STRING' for text values, 'SELECT' for predefined options.
    - `config` PrivilegeConfig: Additional configuration for privileges that require constraints or options. Currently used for 'select' type privileges to define allowed values.
      - `select_options` string[]: Defines the allowed values when value_type is 'select'. When creating entitlements, only these predefined options can be assigned. Useful for features like SSO providers, regions, or service tiers.

## Response `201`

Feature was successfully created and is now available for use in plan entitlements

- FeatureResponse: Core properties that define a feature - a capability or functionality that can be entitled to customers through plans or subscriptions
  - `code` string, required: Unique identifier for the feature across your entire system. This code is used when creating entitlements and should represent the feature's function (e.g., 'seats', 'api-access', 'API_STORAGE'). Allows alphanumeric characters, underscores, and hyphens.
  - `name` string: Customer-facing name of the feature that clearly describes what functionality or capability it provides. This name appears in billing interfaces and customer portals.
  - `description` string: Detailed explanation of what this feature provides, its limitations, and how it affects the customer's experience.
  - `privileges` FeaturePrivilegeBase[]: Privileges associated with this feature. Can be empty
    - `code` string, required: Unique identifier for the privilege within its parent feature. Used as a key when assigning values to this privilege in entitlements. Allows alphanumeric characters, underscores, and hyphens.
    - `name` string: Human-friendly display name for the privilege shown in user interfaces. This helps users understand what aspect of the feature is being configured.
    - `value_type` 'STRING' | 'BOOLEAN' | 'INTEGER' | 'SELECT': Defines the data type that this privilege accepts when being assigned values in entitlements. 'INTEGER' for numeric limits, 'BOOLEAN' for on/off toggles, 'STRING' for text values, 'SELECT' for predefined options.
    - `config` PrivilegeConfig: Additional configuration for privileges that require constraints or options. Currently used for 'select' type privileges to define allowed values.
      - `select_options` string[]: Defines the allowed values when value_type is 'select'. When creating entitlements, only these predefined options can be assigned. Useful for features like SSO providers, regions, or service tiers.
  - `created_at` string, date-time, required: Date and time in ISO 8601 format.

## Other responses

- `400`: Bad Request - Invalid input data
- `403`: Authorization failed due to insufficient permissions.
- `409`: Conflict - The request could not be completed due to a conflict with the current state of the resource.
- `422`: Bad Request - Invalid input data
- `500`: Internal Server Error - An unexpected error occurred

---

[API](https://skmtc.dev/paypal/apis/usage-based-billing-api.md) - [All operations](https://skmtc.dev/paypal/apis/usage-based-billing-api/llms.txt) - [OpenAPI document](https://skmtc.dev/paypal/apis/usage-based-billing-api/revisions/22fb46514ac4?raw)
