How it works
- Create features for your product, in the dashboard or through the API
- Link features to prices and add those prices to a plan
- Customers subscribe and entitlements are provisioned automatically
- 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.- Dashboard
- 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.
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.- Dashboard
- API
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. OmitentitlementTemplate.
Static features take the configuration values you want your application to read, as a flat object:
usagePeriod.interval is an ISO 8601 duration, for example P1D, P1W, or P1M. Omit usagePeriod for a one-time grant that doesn’t refill.
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 withPOST /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.
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
- You configure a feature with
type: meteredand link it to a price with a billable metric - The entitlement template sets the grant, for example
issueAfterReset: 1000000eachP1Musage period - As the customer sends meter events, their usage accumulates
- Your application reads the entitlement balance before each operation, from the list or from the single-entitlement endpoint
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.
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 aneventType 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
CheckhasAccess before enabling premium features in your application:
Enforcing static limits
Readconfig values for static features to enforce limits:
Enforcing metered quotas
Read the balance before allowing consumption. WithgetEntitlement 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
- Meter Events — Send usage data that powers metered entitlements
- Metered entitlements — Grant rules, rollover, and overage
- Billable Metrics — Configure how meter events are aggregated
- Customer Lifecycle — Creating subscriptions that provision entitlements
- Plans — Configure pricing plans
- Prices — Set up prices with features