Overview
PDF AI offers a Pro subscription tier powered by Stripe, providing users with enhanced capabilities and unlimited document processing. The subscription system is fully integrated with Clerk authentication and uses webhooks for automatic subscription management.Pricing Tiers
Free Tier
- Limited PDF uploads
- Basic chat functionality
- Standard support
- Community access
Pro Tier
- ₹1,600/month (INR)
- Unlimited PDF uploads
- Priority processing
- Advanced features
- Premium support
The Pro subscription is priced at ₹1,600 per month (approximately $19 USD) and provides countless hours of time saved through unlimited document processing.
Subscription Features
Free vs Pro
| Feature | Free | Pro |
|---|---|---|
| PDF Uploads | Limited | Unlimited |
| File Size Limit | 10MB | 10MB |
| Chat History | ✓ | ✓ |
| Vector Search | ✓ | ✓ |
| Processing Priority | Standard | High Priority |
| Support | Community | Premium |
Stripe Integration
The subscription system uses Stripe Checkout for new subscriptions and the Billing Portal for managing existing subscriptions:src/app/api/stripe/route.ts
The Stripe integration automatically detects whether a user is subscribing for the first time or managing an existing subscription, routing them to the appropriate Stripe interface.
Subscription Button
The subscription button dynamically changes based on the user’s subscription status:src/components/SubscriptionButton.tsx
Checking Subscription Status
The application checks subscription validity server-side:src/lib/subscription.ts
Subscription validity includes a 24-hour grace period after the billing period ends to account for webhook delays and payment processing time.
Database Schema
User subscriptions are stored with complete Stripe metadata:src/lib/db/schema.ts
Webhook Handling
Stripe webhooks automatically update subscription status in the database:Webhook Event
Stripe sends webhook events for subscription creation, updates, and cancellations to
/api/webhook.Signature Verification
The webhook handler verifies the Stripe signature to ensure the request is authentic.
Database Update
Subscription data is updated in the database including
stripeCustomerId, stripeSubscriptionId, stripePriceId, and stripeCurrentPeriodEnd.Managing Your Subscription
For New Users
- Click the “Get Pro” button in the application
- You’ll be redirected to Stripe Checkout
- Enter your payment details securely through Stripe
- Complete the checkout process
- You’ll be redirected back to the application with Pro access enabled
For Existing Subscribers
- Click the “Manage Subscriptions” button
- You’ll be redirected to the Stripe Billing Portal
- From there you can:
- Update payment methods
- View billing history
- Download invoices
- Cancel your subscription
Payment Methods
Stripe Checkout supports all major payment methods:- Credit cards (Visa, Mastercard, American Express)
- Debit cards
- Additional local payment methods based on region
Security
PCI Compliant
All payment processing is handled by Stripe, a PCI Level 1 certified payment processor.
Secure Webhooks
Webhook signature verification ensures only authentic Stripe events are processed.
No Stored Cards
Payment information is never stored in the application database.
Clerk Auth
Subscription access is tied to authenticated Clerk user IDs.
Troubleshooting
Payment failed during checkout
Payment failed during checkout
If your payment fails, check that:
- Your card has sufficient funds
- Your card supports international transactions (if outside India)
- Your billing address is entered correctly
Pro features not activating after payment
Pro features not activating after payment
Webhook processing typically takes 1-2 seconds. If Pro features don’t activate:
- Wait 30 seconds and refresh the page
- Log out and log back in
- Check your email for payment confirmation from Stripe
Can't access billing portal
Can't access billing portal
The billing portal is only available to users who have an active or past subscription. If you’re a new user, you’ll see the “Get Pro” button instead.
How to cancel my subscription
How to cancel my subscription
- Click “Manage Subscriptions” in the app
- Click “Cancel subscription” in the Stripe Billing Portal
- Confirm the cancellation
Environment Variables
.env.local
The
STRIPE_WEBHOOK_SECRET is required for webhook signature verification and can be found in your Stripe Dashboard under Developers → Webhooks.Billing Cycle
- Billing Period: Monthly (30 days)
- Renewal: Automatic on the same day each month
- Pro-rated Refunds: Not available
- Grace Period: 24 hours after period end
- Payment Retry: Stripe automatically retries failed payments
Support
For subscription and billing issues:- Check the Stripe Billing Portal for payment history
- Review your email for Stripe payment receipts
- Contact support with your Stripe customer ID for assistance