http://localhost:8000/api/plan-pricing
Returns only active plans (isActive: true)
Description: Returns all active plans grouped by type.
curl http://localhost:8000/api/plan-pricing/show
{
"success": true,
"data": {
"payg": {
"_id": "64f...",
"type": "PAYG",
"amount": 10,
"billingCycle": "NONE",
"employeeLimit": null,
"createdAt": "...",
"updatedAt": "..."
},
"subscriptions": [
{
"_id": "65a...",
"type": "SUBSCRIPTION",
"amount": 99,
"billingCycle": "MONTHLY",
"employeeLimit": 10
},
{
"_id": "65b...",
"type": "SUBSCRIPTION",
"amount": 999,
"billingCycle": "YEARLY",
"employeeLimit": null
}
]
}
}
500 → Internal Server Error
createdAt (ascending)Description: Fetch a single plan using its MongoDB ID.
curl http://localhost:8000/api/plan-pricing/PLAN_ID
id → MongoDB ObjectId
{
"success": true,
"data": {
"_id": "65a...",
"type": "SUBSCRIPTION",
"amount": 99,
"billingCycle": "MONTHLY",
"employeeLimit": 10,
"isActive": true,
"createdAt": "...",
"updatedAt": "..."
}
}
404 → Plan not found
500 → Internal Server Error
| Field | Type | Description |
|---|---|---|
| type | String | PAYG or SUBSCRIPTION |
| amount | Number | Plan price |
| billingCycle | String | NONE, MONTHLY, QUARTERLY, YEARLY |
| employeeLimit | Number / null | null = unlimited employees |
| isActive | Boolean | Only active plans are returned |
| createdAt | Date | Auto-generated |
| updatedAt | Date | Auto-generated |
type + billingCycle