Skip to main content
POST
/
v1
/
entitlements
curl --request POST \
  --url https://api.paygentic.io/v1/entitlements \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customerId": "cus_q3r4s5t6u7v8w9x0",
  "featureId": "feat_a1b2c3d4e5f6g7h8",
  "template": {
    "type": "boolean"
  }
}
'
{
  "object": "entitlement",
  "id": "<string>",
  "customerId": "<string>",
  "featureId": "<string>",
  "featureKey": "<string>",
  "featureType": "boolean",
  "productId": "<string>",
  "subscriptionId": "<string>",
  "activeFrom": "2023-11-07T05:31:56Z",
  "activeTo": "2023-11-07T05:31:56Z",
  "hasAccess": true,
  "metadata": {},
  "config": {}
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json
customerId
string
required

The customer to issue the entitlement to.

Pattern: ^cus_[a-zA-Z0-9]+$
featureId
string
required

The feature to grant access to.

Pattern: ^feat_[a-zA-Z0-9]+$
template
object
required

The template defining the entitlement type and configuration.

activeFrom
string<date-time>

When the entitlement becomes active. Defaults to now.

activeTo
string<date-time> | null

When the entitlement expires. Null means no expiration.

subscriptionId
string | null

Optional subscription ID to associate with this entitlement.

metadata
object

Additional metadata for the entitlement.

Response

Entitlement successfully issued. Returns the same shape as GET /v1/entitlements/{entitlementId} (a discriminated EntitlementDetail), so callers can read featureType, hasAccess, and metered balance/usage fields directly from the create response.

A specific entitlement. The response shape varies by featureType.

object
enum<string>
default:entitlement
required
Available options:
entitlement
id
string
required

Unique identifier for the entitlement.

Pattern: ^ent_[a-zA-Z0-9]+$
customerId
string
required

Unique identifier for a customer

Pattern: ^cus_[a-zA-Z0-9]+$
featureId
string
required

The feature this entitlement grants access to.

Pattern: ^feat_[a-zA-Z0-9]+$
featureKey
string
required

The unique key identifying the feature.

featureType
enum<string>
required

The type of feature.

Available options:
boolean
productId
string
required

Unique identifier for a product

Pattern: ^prod_[a-zA-Z0-9]+$
subscriptionId
string | null
required

The subscription this entitlement is associated with, if any.

status
enum<string>
required

Current status of the entitlement.

Available options:
active,
canceled,
expired
activeFrom
string<date-time>
required

When the entitlement becomes active.

activeTo
string<date-time> | null
required

When the entitlement expires. Null means no expiration.

hasAccess
boolean
required

Whether the customer currently has active access to this entitlement.

metadata
object
required

Additional metadata for the entitlement.

config
object | null
required

Always null for boolean entitlements. Surfaced on every entitlement so clients can read config without first switching on featureType.