Skip to main content

Pricing API

The Pricing API provides access to plan details, subscription status, feature availability checks, and usage tracking. All endpoints require JWT authentication.

List Plans

GET /api/pricing/plans

Returns all available plans.

Response

{
"data": [
{
"id": "plan_free",
"name": "Free",
"priceMonthly": 0,
"priceYearly": 0,
"features": {
"flows": true,
"surveys": true,
"experiments": false,
"ai": false
},
"limits": {
"flows": 5,
"activeUsers": 1000,
"apiKeys": 1
},
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
},
{
"id": "plan_pro",
"name": "Pro",
"priceMonthly": 99,
"priceYearly": 990,
"features": {
"flows": true,
"surveys": true,
"experiments": true,
"ai": true
},
"limits": {
"flows": 50,
"activeUsers": 10000,
"apiKeys": 5
},
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]
}

Current Subscription

GET /api/pricing/current

Returns the tenant's current subscription details.

Response

{
"data": {
"plan": "Pro",
"status": "active",
"currentPeriodStart": "2025-01-01T00:00:00Z",
"currentPeriodEnd": "2025-02-01T00:00:00Z",
"isFreePlan": false
}
}

Check Feature Availability

POST /api/pricing/check-feature

Checks whether a specific feature is available on the tenant's current plan.

Request Body

{
"feature": "experiments"
}

Response

{
"data": {
"allowed": true,
"feature": "experiments",
"plan": "Pro",
"reason": null,
"usage": {
"used": 2,
"limit": 10
}
}
}

When the feature is not available:

{
"data": {
"allowed": false,
"feature": "experiments",
"plan": "Free",
"reason": "Feature not available on current plan",
"usage": null
}
}

Usage

GET /api/pricing/usage

Returns current usage against plan limits for all tracked features.

Response

{
"data": {
"plan": "Pro",
"usage": [
{
"feature": "flows",
"used": 12,
"limit": 50,
"unlimited": false,
"enabled": true,
"percentage": 24
},
{
"feature": "activeUsers",
"used": 3500,
"limit": 10000,
"unlimited": false,
"enabled": true,
"percentage": 35
},
{
"feature": "apiKeys",
"used": 2,
"limit": 5,
"unlimited": false,
"enabled": true,
"percentage": 40
}
]
}
}