Skip to content

Stripe.Entitlements reference

Source: src/Stripe/EntitlementsFeature.ts

A Stripe Entitlements Feature — a monetizable ability you attach to Products. When a customer purchases a product with this feature, Stripe creates an entitlement for them. lookup_key is unique among active features and immutable (changing it replaces the feature). Name and metadata update in place.

Stripe does not hard-delete features; destroying this resource deactivates it (active: false). Archived features cannot be edited or unarchived. An archived lookup key can be reused — a later create with the same key provisions a new feature.

Generated lookup key

const seats = yield* Stripe.EntitlementsFeature("seats");

Named feature with lookup key

const seats = yield* Stripe.EntitlementsFeature("seats", {
lookupKey: "seats",
name: "Seat licenses",
});
const seats = yield* Stripe.EntitlementsFeature("seats", {
lookupKey: "seats",
name: "Seat licenses (updated)",
metadata: { plan: "pro" },
});

EntitlementsFeature: Deactivating a Feature

Section titled “EntitlementsFeature: Deactivating a Feature”
// stack.destroy() / resource removal sets active: false
const seats = yield* Stripe.EntitlementsFeature("seats", {
lookupKey: "seats",
name: "Seat licenses",
});

Source: src/Stripe/RetrieveEntitlementsFeature.ts

Retrieve a bound Stripe Entitlements Feature over HTTP.

RetrieveEntitlementsFeature: Reading a Feature

Section titled “RetrieveEntitlementsFeature: Reading a Feature”
const retrieve = yield* Stripe.RetrieveEntitlementsFeature(seats);
const live = yield* retrieve();

Source: src/Stripe/RetrieveEntitlementsFeatureHttp.ts Kind: Layer · Provides: Stripe.RetrieveEntitlementsFeature

HTTP implementation of RetrieveEntitlementsFeature.