Plan Pricing Base URL

http://localhost:8000/api/plan-pricing

Returns only active plans (isActive: true)

1️⃣ Get All Plans

GET /show

Description: Returns all active plans grouped by type.

cURL

curl http://localhost:8000/api/plan-pricing/show

Success Response

{ "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 } ] } }

Error

500 → Internal Server Error

Notes

2️⃣ Get Plan By ID

GET /:id

Description: Fetch a single plan using its MongoDB ID.

🧪 cURL

curl http://localhost:8000/api/plan-pricing/PLAN_ID

Params

id → MongoDB ObjectId

Success Response

{ "success": true, "data": { "_id": "65a...", "type": "SUBSCRIPTION", "amount": 99, "billingCycle": "MONTHLY", "employeeLimit": 10, "isActive": true, "createdAt": "...", "updatedAt": "..." } }

Errors

404 → Plan not found 500 → Internal Server Error

Plan Schema

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

Constraints