Billing & Subscriptions
Manage your subscription, invoices, and payment methods
Complete billing management system with subscription control, usage tracking, invoice management, and automated billing cycles.
Subscription Management
Plan upgrades, downgrades, and cancellationUsage Tracking
Real-time resource usage monitoringInvoice Management
Detailed invoices with PDF downloadsQuick Actions
Track resource usage, costs, and billing metrics in real-time.
GET /billing/usageAccess and download detailed invoices and billing history.
GET /billing/invoicesManage saved payment methods and update billing information.
POST /billing/payment-methodsAvailable Plans
Starter
Perfect for small teams and personal projects
Pro
Ideal for growing businesses and teams
Enterprise
Advanced features for large organizations
Usage Metrics
VPN Connections
12 / 50
24% used
Databases
3 / 10
30% used
Hosting Sites
5 / 25
20% used
API Calls
15.2k / 100k
15% used
API Endpoints
/billing/subscriptionResponse
{
"success": true,
"subscription": {
"id": "sub_123",
"plan": "pro",
"status": "active",
"current_period_start": "2024-12-01T00:00:00Z",
"current_period_end": "2025-01-01T00:00:00Z",
"cancel_at_period_end": false,
"trial_end": null
},
"usage": {
"vpn_connections": {
"current": 12,
"limit": 50,
"percentage": 24
},
"databases": {
"current": 3,
"limit": 10,
"percentage": 30
},
"hosting_sites": {
"current": 5,
"limit": 25,
"percentage": 20
},
"api_calls": {
"current": 15230,
"limit": 100000,
"percentage": 15.23
}
}
}/billing/subscriptionRequest Body
{
"plan": "enterprise",
"payment_method": "pm_456",
"proration_behavior": "always_invoice"
}/billing/invoicesResponse
{
"success": true,
"invoices": [
{
"id": "inv_123",
"number": "INV-2024-001",
"amount": 99.00,
"currency": "usd",
"status": "paid",
"created": "2024-11-01T00:00:00Z",
"due_date": "2024-11-15T00:00:00Z",
"paid_at": "2024-11-02T10:30:00Z",
"hosted_invoice_url": "https://invoice.vpnenterprise.com/inv_123",
"pdf_url": "https://files.vpnenterprise.com/inv_123.pdf"
}
],
"total": 12,
"has_more": false
}/billing/invoices/:idResponse
{
"success": true,
"invoice": {
"id": "inv_123",
"number": "INV-2024-001",
"amount": 99.00,
"currency": "usd",
"status": "paid",
"line_items": [
{
"description": "VPN Enterprise Pro Plan",
"amount": 79.00,
"quantity": 1
},
{
"description": "Additional Database (2x)",
"amount": 20.00,
"quantity": 2
}
],
"tax": {
"amount": 7.92,
"rate": 8.25,
"jurisdiction": "US-CA"
},
"total": 106.92,
"created": "2024-11-01T00:00:00Z",
"paid_at": "2024-11-02T10:30:00Z",
"payment_method": {
"type": "card",
"last4": "4242",
"brand": "visa"
}
}
}/billing/payment-methodsResponse
{
"success": true,
"payment_methods": [
{
"id": "pm_123",
"type": "card",
"card": {
"last4": "4242",
"brand": "visa",
"exp_month": 12,
"exp_year": 2026
},
"is_default": true,
"created": "2024-01-15T10:30:00Z"
}
],
"default_payment_method": "pm_123"
}/billing/payment-methodsRequest Body
{
"payment_method": "pm_new_456",
"set_as_default": true
}/billing/usageResponse
{
"success": true,
"current_period": {
"start": "2024-12-01T00:00:00Z",
"end": "2025-01-01T00:00:00Z"
},
"usage": {
"vpn": {
"connections": 12,
"data_transfer_gb": 245.6,
"server_hours": 8760
},
"database": {
"instances": 3,
"storage_gb": 15.2,
"compute_hours": 2190
},
"hosting": {
"sites": 5,
"bandwidth_gb": 89.3,
"build_minutes": 120
},
"api": {
"requests": 15230,
"rate_limit_hits": 12,
"webhook_deliveries": 456
}
},
"costs": {
"base_plan": 79.00,
"overages": 12.50,
"add_ons": 8.00,
"total": 99.50
}
}/billing/plansResponse
{
"success": true,
"plans": [
{
"id": "starter",
"name": "Starter",
"price": 29.00,
"currency": "usd",
"interval": "month",
"features": {
"vpn_connections": 10,
"databases": 2,
"hosting_sites": 5,
"api_calls": 10000,
"support": "community"
}
},
{
"id": "pro",
"name": "Pro",
"price": 79.00,
"currency": "usd",
"interval": "month",
"features": {
"vpn_connections": 50,
"databases": 10,
"hosting_sites": 25,
"api_calls": 100000,
"support": "priority"
},
"popular": true
},
{
"id": "enterprise",
"name": "Enterprise",
"price": 199.00,
"currency": "usd",
"interval": "month",
"features": {
"vpn_connections": "unlimited",
"databases": "unlimited",
"hosting_sites": "unlimited",
"api_calls": "unlimited",
"support": "dedicated",
"sso": true,
"advanced_security": true
}
}
]
}Billing Best Practices
Monitor Usage Regularly
Set up usage alerts and monitor your resource consumption to avoid unexpected charges and optimize costs.
Plan Changes & Prorations
Understand proration policies when upgrading or downgrading plans. Changes take effect immediately with appropriate billing adjustments.
Payment Method Backup
Keep multiple payment methods on file to prevent service interruptions due to payment failures or expired cards.