List all active entitlements
GET/v1/entitlements/active_entitlements
Retrieve a list of active entitlements for a customer
Query parameters
customerstringRequiredThe ID of the customer.
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of entitlements.active_entitlement objects.
curl -G https://api.knoxapi.com/v1/entitlements/active_entitlements \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode customer=cus_QXg1o8vcGmoR32const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/entitlements/active_entitlements', {
customer: 'cus_QXg1o8vcGmoR32',
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/entitlements/active_entitlements", customer="cus_QXg1o8vcGmoR32")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/entitlements/active_entitlements', {
customer: 'cus_QXg1o8vcGmoR32',
}){
"object": "list",
"url": "/v1/entitlements/active_entitlements",
"has_more": false,
"data": [
{
"feature": "feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu",
"id": "ent_test_61QG5x2cU1GluFTYs41JqiESbLiX8C8O",
"livemode": false,
"lookup_key": "something",
"object": "entitlements.active_entitlement"
}
]
}Create a feature
POST/v1/entitlements/features
Creates a feature
Body parameters
lookup_keystringRequiredA unique key you provide as your own system identifier. This may be up to 80 characters.
namestringRequiredThe feature's name, for your own purpose, not meant to be displayable to the customer.
expandarray of stringsSpecifies which fields in the response should be expanded.
metadataobjectSet 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
The entitlements.feature object.
curl https://api.knoxapi.com/v1/entitlements/features \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d lookup_key=something \
-d "name=My super awesome feature"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('POST', '/v1/entitlements/features', {
lookup_key: 'something',
name: 'My super awesome feature',
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("post", "/v1/entitlements/features", lookup_key="something", name="My super awesome feature")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:post, '/v1/entitlements/features', {
lookup_key: 'something',
name: 'My super awesome feature',
}){
"active": true,
"id": "feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu",
"livemode": false,
"lookup_key": "something",
"metadata": {},
"name": "My super awesome feature",
"object": "entitlements.feature"
}List all features
GET/v1/entitlements/features
Retrieve a list of features
Query parameters
archivedbooleanIf set, filter results to only include features with the given archive status.
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
lookup_keystringIf set, filter results to only include features with the given lookup_key.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of entitlements.feature objects.
curl -G https://api.knoxapi.com/v1/entitlements/features \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode limit=3const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/entitlements/features', {
limit: 3,
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/entitlements/features", limit=3)require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/entitlements/features', {
limit: 3,
}){
"object": "list",
"url": "/v1/entitlements/features",
"has_more": false,
"data": [
{
"active": true,
"id": "feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu",
"livemode": false,
"lookup_key": "something",
"metadata": {},
"name": "My super awesome feature",
"object": "entitlements.feature"
}
]
}Retrieve an active entitlement
GET/v1/entitlements/active_entitlements/{id}
Retrieve an active entitlement
Path parameters
idstringRequiredThe ID of the entitlement.
Query parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The entitlements.active_entitlement object.
curl https://api.knoxapi.com/v1/entitlements/active_entitlements/ent_test_61QG5x2cU1GluFTYs41JqiESbLiX8C8O \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/entitlements/active_entitlements/ent_test_61QG5x2cU1GluFTYs41JqiESbLiX8C8O');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/entitlements/active_entitlements/ent_test_61QG5x2cU1GluFTYs41JqiESbLiX8C8O")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/entitlements/active_entitlements/ent_test_61QG5x2cU1GluFTYs41JqiESbLiX8C8O'){
"feature": "feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu",
"id": "ent_test_61QG5x2cU1GluFTYs41JqiESbLiX8C8O",
"livemode": false,
"lookup_key": "something",
"object": "entitlements.active_entitlement"
}Updates a feature
POST/v1/entitlements/features/{id}
Update a feature’s metadata or permanently deactivate it.
Path parameters
idstringRequired
Body parameters
activebooleanInactive features cannot be attached to new products and will not be returned from the features list endpoint.
expandarray of stringsSpecifies which fields in the response should be expanded.
metadataobjectSet 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.
namestringThe feature's name, for your own purpose, not meant to be displayable to the customer.
Returns
The entitlements.feature object.
curl https://api.knoxapi.com/v1/entitlements/features/feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d "metadata[order_id]=6735"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('POST', '/v1/entitlements/features/feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu', {
metadata: {
order_id: '6735',
},
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("post", "/v1/entitlements/features/feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu", metadata={
"order_id": "6735",
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:post, '/v1/entitlements/features/feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu', {
metadata: {
order_id: '6735',
},
}){
"active": true,
"id": "feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu",
"livemode": false,
"lookup_key": "something",
"metadata": {},
"name": "My super awesome feature",
"object": "entitlements.feature"
}Retrieve a feature
GET/v1/entitlements/features/{id}
Retrieves a feature
Path parameters
idstringRequiredThe ID of the feature.
Query parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The entitlements.feature object.
curl https://api.knoxapi.com/v1/entitlements/features/feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/entitlements/features/feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/entitlements/features/feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/entitlements/features/feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu'){
"active": true,
"id": "feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu",
"livemode": false,
"lookup_key": "something",
"metadata": {},
"name": "My super awesome feature",
"object": "entitlements.feature"
}Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.