Feature

A feature represents a monetizable ability or functionality in your system. Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer.

The Feature object

Attributes

  • idstring

    Unique identifier for the object.

  • lookup_keystring

    A unique key you provide as your own system identifier. This may be up to 80 characters.

  • metadataobject

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

  • namestring

    The feature’s name, for your own purpose, not meant to be displayable to the customer.

More attributes

  • objectstring

  • activeboolean

  • livemodeboolean

The Feature object
{
"id": "feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu",
"object": "entitlements.feature",
"livemode": false,
"name": "My super awesome feature",
"lookup_key": "my-super-awesome-feature",
"active": true,
"metadata": {}
}

Create a feature

Creates a feature

Parameters

  • lookup_keystringRequired

    A unique key you provide as your own system identifier. This may be up to 80 characters.

  • namestringRequired

    The feature’s name, for your own purpose, not meant to be displayable to the customer.

  • metadataobject

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

Returns

Returns a feature

POST /v1/entitlements/features
curl https://api.stripe.com/v1/entitlements/features \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:" \
-d name="My super awesome feature" \
-d lookup_key=my-super-awesome-feature
Response
{
"id": "feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu",
"object": "entitlements.feature",
"livemode": false,
"name": "My super awesome feature",
"lookup_key": "my-super-awesome-feature",
"active": true,
"metadata": {}
}

List all features

Retrieve a list of features

Parameters

No parameters.

More parameters

  • ending_beforestring

  • limitinteger

  • starting_afterstring

Returns

Returns a list of your features

GET /v1/entitlements/features
curl -G https://api.stripe.com/v1/entitlements/features \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:" \
-d limit=3
Response
{
"object": "list",
"url": "/v1/entitlements/features",
"has_more": false,
"data": [
{
"id": "feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu",
"object": "entitlements.feature",
"livemode": false,
"name": "My super awesome feature",
"lookup_key": "my-super-awesome-feature",
"active": true,
"metadata": {}
}
{...}
{...}
],
}

Updates a feature

Update a feature’s metadata or permanently deactivate it.

Parameters

  • metadataobject

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

  • namestring

    The feature’s name, for your own purpose, not meant to be displayable to the customer.

More parameters

  • activeboolean

Returns

The updated feature.

POST /v1/entitlements/features/:id
curl https://api.stripe.com/v1/entitlements/features/feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:" \
-d "metadata[order_id]"=6735
Response
{
"id": "feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu",
"object": "entitlements.feature",
"livemode": false,
"name": "My super awesome feature",
"lookup_key": "my-super-awesome-feature",
"active": true,
"metadata": {
"order_id": "6735"
}
}
Stripe Shell
Test mode
Welcome to the Stripe Shell! Stripe Shell is a browser-based shell with the Stripe CLI pre-installed. Log in to your Stripe account and press Control + Backtick (`) on your keyboard to start managing your Stripe resources in test mode. - View supported Stripe commands: - Find webhook events: - Listen for webhook events: - Call Stripe APIs: stripe [api resource] [operation] (e.g., )
The Stripe Shell is best experienced on desktop.
$