Learn how billing works in the NextCoder platform
NextCoder uses Stripe for subscription billing, providing flexible pricing plans with support for trials, upgrades, downgrades, and proration.
NextCoder offers three pricing plans:
All billing operations are handled through the dashboard UI. Users can:
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/payments/checkout | Create checkout session |
| POST | /api/payments/webhook | Handle webhook events |
Stripe webhooks are used to handle subscription events such as:
// Example webhook handler
switch (event.type) {
case 'checkout.session.completed':
const session = event.data.object;
// Fulfill the purchase (e.g., update user's subscription status)
break;
case 'invoice.payment_succeeded':
const invoice = event.data.object;
// Update the user's billing information
break;
// ... handle other event types
}