Billing & Plans

View available plans, check current usage, upgrade via ZPay payment gateway, and access transaction history. Region-aware pricing with automatic currency detection.

Available Plans

GET /billing/plans
// Returns plans with region-specific pricing
{
  "plans": [
    {
      "name": "Free",
      "price": { "INR": 0, "USD": 0 },
      "limits": {
        "projects": 2,
        "database_size_mb": 500,
        "storage_mb": 1000,
        "bandwidth_mb": 5000,
        "functions": 5,
        "function_invocations": 10000,
        "ai_tokens": 100000
      }
    },
    {
      "name": "Pro",
      "price": { "INR": 999, "USD": 15 },
      "limits": {
        "projects": 10,
        "database_size_mb": 5000,
        "storage_mb": 50000,
        "bandwidth_mb": 100000,
        "functions": 50,
        "function_invocations": 500000,
        "ai_tokens": 5000000
      }
    }
  ]
}

Current Plan & Usage

GET /billing/my-planUsage
{
  "plan": "Free",
  "usage": {
    "projects": 1,
    "database_size_mb": 120,
    "storage_mb": 340,
    "bandwidth_mb": 1200,
    "functions": 3,
    "function_invocations": 4500,
    "ai_tokens": 25000
  },
  "limits": {
    "projects": 2,
    "database_size_mb": 500,
    "storage_mb": 1000,
    "bandwidth_mb": 5000,
    "functions": 5,
    "function_invocations": 10000,
    "ai_tokens": 100000
  }
}

Geo Pricing

GET /billing/geo-pricing
// Auto-detects country from IP
{
  "country": "IN",
  "currency": "INR",
  "plans": [
    { "name": "Free", "price": 0 },
    { "name": "Pro", "price": 999 },
    { "name": "Business", "price": 4999 }
  ]
}

Upgrade (ZPay Checkout)

POST /payments/checkoutZPay
{
  "plan": "pro"
}

// Response — redirect user to ZPay
{
  "checkout_url": "https://pay.zyora.cloud/checkout/...",
  "session_id": "sess_abc123"
}

Payment History

GET /payments/history
{
  "transactions": [
    {
      "id": "txn_abc",
      "plan": "Pro",
      "amount": 999,
      "currency": "INR",
      "status": "completed",
      "paid_at": "2026-03-20T14:30:00Z"
    }
  ]
}

API Reference

MethodPathDescription
GET/billing/plansList plans with pricing
GET/billing/my-planCurrent plan & usage
GET/billing/geo-pricingRegion-aware pricing
POST/payments/checkoutInitiate ZPay checkout
POST/payments/zpay-callbackZPay webhook callback
GET/payments/historyTransaction history