Foundry Subscription Bot API v1.0.0

Interactive API playground and live explorer

Raw /health ↗
GET /health
Liveness & health check (no auth required)

        
GET /api/users
List users with active subscription, active addons & group status

        
GET /api/user
Comprehensive user profile, subscription history, addons & payments

        
GET /api/stats
Live business metrics, monthly revenue, net profit after expenses & addon analytics

        
GET /api/events
Catch-up & audit log of outgoing events for Service Bot

        
POST /api/events/retry
Trigger immediate retry for all failed or pending webhook events

        
POST /webhook/razorpay
Automated webhook handler called by Razorpay

Invoked automatically by Razorpay when a payment completes. Requires an HMAC-SHA256 signature in the X-Razorpay-Signature header verified against RAZORPAY_WEBHOOK_SECRET.

{
  "event": "payment_link.paid",
  "payload": {
    "payment_link": {
      "entity": {
        "id": "plink_...",
        "notes": { "telegram_id": "5139580571", "plan_id": "plan_30" }
      }
    }
  }
}
POST /webhook/paypal
Automated webhook handler called by PayPal

Invoked automatically by PayPal when an order is approved or payment capture completes. Verifies signature using PAYPAL_WEBHOOK_ID via PayPal's verification API.

{
  "event_type": "CHECKOUT.ORDER.APPROVED",
  "resource": {
    "id": "5O190127TN364715T",
    "status": "APPROVED"
  }
}