Product Feature

A product_feature represents an attachment between a feature and a product. When a product is purchased that has a feature attached, Stripe will create an entitlement to the feature for the purchasing customer.

The ProductFeature object

Attributes

  • idstring

    Unique identifier for the object.

  • entitlement_featureobject

    The Feature object attached to this product.

More attributes

  • objectstring

  • livemodeboolean

The ProductFeature object
{
"id": "prodft_BcMBZUWCIOEgEc",
"object": "product_feature",
"livemode": false,
"entitlement_feature": {
"id": "feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu",
"object": "entitlements.feature",
"livemode": false,
"name": "My super awesome feature",
"lookup_key": "my-super-awesome-feature",
"metadata": {}
}
}

List all features attached to a product

Retrieve a list of features for a product

Parameters

No parameters.

More parameters

  • ending_beforestring

  • limitinteger

  • starting_afterstring

Returns

Returns a list of features for a product

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

Attach a feature to a product

Creates a product_feature, which represents a feature attachment to a product

Parameters

  • entitlement_featurestringRequired

    The ID of the Feature object attached to this product.

Returns

Returns a product_feature

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

Remove a feature from a product

Deletes the feature attachment to a product

Parameters

No parameters.

Returns

Returns an object with a deleted parameter on success. If the product feature ID does not exist, this call raises an error.

DELETE /v1/products/:id/features/:id
curl -X DELETE https://api.stripe.com/v1/products/prod_NWjs8kKbJWmuuc/features/prodft_BcMBZUWCIOEgEc \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:"
Response
{
"id": "prodft_BcMBZUWCIOEgEc",
"object": "product_feature",
"deleted": true
}
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.
$