Skip to main content
POST
/
subscriptions
/
entitlements
Create an entitlement
curl --request POST \
  --url https://api.billing.io/v1/subscriptions/entitlements \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "plan_id": "<string>",
  "feature_key": "api_requests",
  "value_boolean": true,
  "value_numeric": 10000,
  "value_string": "<string>"
}
'
{
  "id": "ent_1a2b3c4d5e",
  "org_id": "<string>",
  "plan_id": "<string>",
  "feature_key": "<string>",
  "value_boolean": true,
  "value_numeric": 123,
  "value_string": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}
Attach a feature entitlement to a subscription plan.
curl -X POST https://api.billing.io/v1/subscriptions/entitlements \
  -H "Authorization: Bearer $BILLING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "plan_id": "plan_a1b2c3d4e5f6",
    "feature_key": "api_requests",
    "value_type": "numeric",
    "value_numeric": 10000
  }'
Response
{
  "id": "ent_a1b2c3d4e5f6a7b8c9d0e1f2",
  "plan_id": "plan_a1b2c3d4e5f6",
  "feature_key": "api_requests",
  "value_type": "numeric",
  "value_numeric": 10000,
  "created_at": "2025-01-15T12:00:00Z"
}

Authorizations

Authorization
string
header
required

Use your secret API key as a Bearer token. Keys are prefixed: sk_live_ (production) or sk_test_ (sandbox).

Body

application/json
plan_id
string
required

The subscription plan identifier

feature_key
string
required

Unique key identifying the feature

Maximum string length: 256
Example:

"api_requests"

value_type
enum<string>
required

The data type of the entitlement value

Available options:
boolean,
numeric,
string
value_boolean
boolean | null

Boolean value (when value_type is boolean)

value_numeric
number | null

Numeric value (when value_type is numeric)

Example:

10000

value_string
string | null

String value (when value_type is string)

Response

Entitlement created

id
string

Unique identifier (prefixed ent_)

Example:

"ent_1a2b3c4d5e"

org_id
string

Organization identifier

plan_id
string

Subscription plan identifier

feature_key
string

Unique key identifying the feature

value_type
enum<string>

The data type of the entitlement value

Available options:
boolean,
numeric,
string
value_boolean
boolean | null

Boolean value (when value_type is boolean)

value_numeric
number | null

Numeric value (when value_type is numeric)

value_string
string | null

String value (when value_type is string)

environment
enum<string>
Available options:
live,
sandbox
created_at
string<date-time>
updated_at
string<date-time>