A RESTful API for managing user subscriptions, plans, and billing. This project provides endpoints to create, update, and manage subscriptions for digital products or services.
- User registration and authentication
- Subscription plan management (create, update, delete plans)
- Subscribe/unsubscribe users to plans
- Billing and payment integration (future)
- Webhook support for subscription events (future)
- Node.js / Express
- MongoDB or PostgreSQL (configurable)
- JWT for authentication
- Node.js (v20+)
- npm
- MongoDB or PostgreSQL instance
git clone https://github.com/miketorreno/subapi.git
cd subapi
npm installCopy .env.example to .env and update environment variables as needed.
npm run devThe API will be available at http://localhost:3000.
POST /api/v1/auth/register– Register a new userPOST /api/v1/auth/login– Authenticate userGET /api/v1/plans– List available subscription plansPOST /api/v1/subscribe– Subscribe to a planPOST /api/v1/unsubscribe– Cancel a subscription
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.