Skip to main content
Features represent the capabilities you bundle with your products — things like “SSO enabled”, “Premium support”, or “100GB storage”. When customers subscribe to a plan, they automatically receive entitlements that grant access to these features.

How it works

  1. Create features for your product, in the dashboard or through the API
  2. Link features to prices and add those prices to a plan
  3. Customers subscribe and entitlements are provisioned automatically
  4. Check entitlements through the API to gate access in your application

Feature types

Boolean

Simple on/off access. Either the customer has it or they don’t.Examples: SSO enabled, Premium support, API access

Static

Fixed capability with configuration values that define limits or quotas.Examples: 25 team seats, 100GB storage, 1000 API calls/month

Metered

Usage-based access enforced against real consumption data. The customer’s balance decreases as they use your product.Examples: 1M tokens/month, 100 API calls/day, 50GB storage

Creating features

You can create features in the dashboard or through the API.
1

Navigate to your product

Go to Products and select the product you want to add features to.
2

Open the Features tab

Select the Features tab to view and manage features for this product.
3

Create a new feature

Select New Feature and fill in the details:
  • Name: Display name shown in the UI (e.g., “AI Tokens”)
  • Key: Identifier used in API calls, unique within the product (e.g., ai-tokens)
  • Type: Boolean, Static, or Metered
4

Save the feature

Select Save to create the feature. It’s now available to link to prices.
Use descriptive, consistent keys for your features. They’ll appear in API responses and your application code.

Linking features to prices

Each price can carry one feature, with an entitlement template that sets what a subscriber receives. When the price is part of a plan, every subscription to that plan gets an entitlement built from the template.
1

Navigate to a plan

Go to Products, select the product, open the Plans tab, and select the plan you want to configure.
2

Edit a price

Select a price within the plan to edit its configuration.
3

Select a feature

Select a feature from the dropdown to associate with this price.
4

Configure the entitlement template

Enter the values that the subscriber receives. The template depends on the feature type, as described below.

Entitlement templates

Boolean features need no values. Omit entitlementTemplate. Static features take the configuration values you want your application to read, as a flat object:
Metered features take the grant rules:
This grants 1,000,000 units at the start of each monthly usage period, measured by the billable metric of the price. usagePeriod.interval is an ISO 8601 duration, for example P1D, P1W, or P1M. Omit usagePeriod for a one-time grant that doesn’t refill.
issueAfterReset is the amount the customer receives. A metered feature with no template, or with a template that omits issueAfterReset, gets no grant: the balance stays at 0 and a hard limit denies access. A field the template does not support, such as limit, is ignored.
See Metered entitlements for rollover, overage, and the other template fields. To give a boolean or static feature without charging for it, link it to a fee with a unit price of 0. A metered feature needs a price that has a billable metric, because the metric measures the usage — use a unit price of 0 on that price when you don’t want to charge per unit.

Automatic entitlement provisioning

When a customer subscribes to a plan, entitlements are automatically provisioned based on the features linked to that plan’s prices. When the subscription is terminated, they are canceled. No manual intervention required. You can also issue an entitlement to a customer directly with POST /v1/entitlements.
Existing active subscriptions do not automatically pick up features you add to (or remove from) a plan after the fact. To converge them to the plan’s current shape, use Reconciling subscription features.

Checking entitlements via API

Use the API to check if a customer has access to specific features. This is how you gate functionality in your application.
API Reference: See the List Entitlements API endpoint for complete request and response schemas.

List customer entitlements

GET /v1/entitlements returns a customer’s entitlements, newest first. Identify the customer with customerId, or with externalCustomerId. Also send merchantId when your API key has access to more than one merchant. To check one feature, send productId and featureKey together. Feature keys are unique only within a product, so featureKey without productId returns 400 Bad Request.
The list also returns expired and canceled entitlements, for example from an earlier subscription. Check hasAccess on the items rather than taking the first one. A page holds up to limit entitlements (default 10, maximum 100). Use offset to read the next page. An unknown customer returns 403 Forbidden, not 404, so the API doesn’t reveal which IDs exist. Response (without the productId and featureKey filters):

Key response fields

When pricingUnitId is set, balance, usageInPeriod, and overage are in that pricing unit’s credits, and they describe the pool that every feature on the same unit shares — not the usage of this one feature. When pricingUnitId is null, they’re in the feature’s metered units. The list returns the balance fields on each metered entitlement, so one request gives you access and balance for every feature on the page. Use GET /v1/entitlements/{entitlementId} when you hold an entitlement ID and want one entitlement.

Metered features

Metered features enforce usage-based quotas against real consumption data. Instead of a static config value, the system tracks how much the customer has actually used and compares it against their granted balance.

How metered entitlements work

  1. You configure a feature with type: metered and link it to a price with a billable metric
  2. The entitlement template sets the grant, for example issueAfterReset: 1000000 each P1M usage period
  3. As the customer sends meter events, their usage accumulates
  4. Your application reads the entitlement balance before each operation, from the list or from the single-entitlement endpoint
The balance is calculated from aggregated meter data when you request it. Paygentic processes meter events asynchronously after it accepts them, so an event you just sent can take a short time to count.

Checking a metered entitlement balance

Both entitlement endpoints return the balance of a metered entitlement. GET /v1/entitlements?customerId=...&productId=...&featureKey=... returns it without an entitlement ID. GET /v1/entitlements/{entitlementId} returns one entitlement when you hold its ID. The examples below use the single-entitlement endpoint.
An unknown entitlement ID returns 403 Forbidden, not 404. Response:

Hard limits vs soft limits

By default, an entitlement is a hard limit: hasAccess becomes false once balance reaches 0. Set isSoftLimit: true in the entitlement template to make it a soft limit. A soft limit keeps hasAccess: true after the balance reaches 0, and the usage beyond the balance is charged as overage at the price’s per-unit rate. Paygentic doesn’t block meter events in either case. Your application enforces a hard limit by checking hasAccess before it serves the request. Use soft limits when you want to bill overage instead of blocking the customer at the quota boundary.

Required setup

For a metered feature to work, your price must be linked to a billable metric with an eventType and an aggregation. Value aggregations (SUM, AVG, MIN, MAX, LATEST) also need a valueProperty. The grant engine uses these fields to query the meter data and calculate current usage. See Meter Events for how to instrument your application to send usage data.

Use cases

Feature gating

Check hasAccess before enabling premium features in your application:

Enforcing static limits

Read config values for static features to enforce limits:

Enforcing metered quotas

Read the balance before allowing consumption. With getEntitlement from the previous example, one request returns the entitlement you need, with its balance:
type must match the eventType of the billable metric. See Meter Events for the full event format.

Next steps