Packages API ​
Endpoints for managing subscription packages (pricing tiers).
Public Endpoints ​
List Active Packages ​
GET /api/public/packages
Returns active packages for pricing page. No authentication required.
Response ​
json
[
{
"id": "pkg_starter",
"name": "Starter",
"description": "Perfect for individuals",
"price": 19.00,
"interval": "month",
"currency": "USD",
"maxUsers": 1,
"maxAiPosts": 50,
"displayFeatures": [
"50 AI posts/month",
"3 social accounts",
"Basic analytics"
],
"salePrice": null,
"isActive": true,
"isPopular": false
}
]Admin Endpoints ​
Require JWT authentication and admin or owner role.
List All Packages ​
GET /api/admin/packages
Returns all packages including inactive.
Create/Update Package ​
POST /api/admin/packages
Upsert a package configuration.
Request Body ​
json
{
"id": "pkg_123", // Provide to update, omit to create
"name": "Professional",
"description": "For growing teams",
"price": 49.00,
"interval": "month",
"currency": "USD",
"maxUsers": 5,
"maxAiPosts": 200,
"displayFeatures": [
"200 AI posts/month",
"10 social accounts",
"Advanced analytics",
"Priority support"
],
"salePrice": 39.00,
"saleStartsAt": "2025-01-01",
"saleEndsAt": "2025-01-31",
"variantId": "ls_variant_123",
"isActive": true,
"isPopular": true
}Delete Package ​
DELETE /api/admin/packages/:id
Permanently delete a package.
Response ​
json
{
"success": true
}Package Fields ​
| Field | Type | Description |
|---|---|---|
name | string | Display name |
price | number | Monthly price |
interval | string | month or year |
maxUsers | number | Team member limit |
maxAiPosts | number | AI generations/month |
displayFeatures | string[] | Feature list for UI |
salePrice | number? | Discounted price |
variantId | string? | Lemon Squeezy variant |
isPopular | boolean | Highlight in UI |