API reference

Entitlements

Knox answers these operations with the same requests and responses as Stripe's API. Authenticate with your secret key, Authorization: Bearer sk_test_..., from your server, and send form-encoded bodies. Test mode only: live processing is currently disabled.

List all active entitlements

GET/v1/entitlements/active_entitlements

Retrieve a list of active entitlements for a customer

Query parameters

  • customerstringRequired

    The ID of the customer.

  • ending_beforestring

    A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • limitinteger

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

  • starting_afterstring

    A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Returns

A list of entitlements.active_entitlement objects.

GET /v1/entitlements/active_entitlements
curl -G https://api.knoxapi.com/v1/entitlements/active_entitlements \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode customer=cus_QXg1o8vcGmoR32
Response
{
  "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_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.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • 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

The entitlements.feature object.

POST /v1/entitlements/features
curl https://api.knoxapi.com/v1/entitlements/features \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  -d lookup_key=something \
  -d "name=My super awesome feature"
Response
{
  "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

  • archivedboolean

    If set, filter results to only include features with the given archive status.

  • ending_beforestring

    A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • limitinteger

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

  • lookup_keystring

    If set, filter results to only include features with the given lookup_key.

  • starting_afterstring

    A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Returns

A list of entitlements.feature objects.

GET /v1/entitlements/features
curl -G https://api.knoxapi.com/v1/entitlements/features \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode limit=3
Response
{
  "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

  • idstringRequired

    The ID of the entitlement.

Query parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The entitlements.active_entitlement object.

GET /v1/entitlements/active_entitlements/{id}
curl https://api.knoxapi.com/v1/entitlements/active_entitlements/ent_test_61QG5x2cU1GluFTYs41JqiESbLiX8C8O \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "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

  • activeboolean

    Inactive features cannot be attached to new products and will not be returned from the features list endpoint.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • 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.

Returns

The entitlements.feature object.

POST /v1/entitlements/features/{id}
curl https://api.knoxapi.com/v1/entitlements/features/feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  -d "metadata[order_id]=6735"
Response
{
  "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

  • idstringRequired

    The ID of the feature.

Query parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The entitlements.feature object.

GET /v1/entitlements/features/{id}
curl https://api.knoxapi.com/v1/entitlements/features/feat_test_61QGU1MWyFMSP9YBZ41ClCIKljWvsTgu \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "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.