Documentation Index Fetch the complete documentation index at: https://mintlify.com/dishant0406/quickleap/llms.txt
Use this file to discover all available pages before exploring further.
Subscription management
Manage user subscriptions including viewing current subscription details, canceling, and reactivating subscriptions.
Get current subscription
Retrieve the authenticated user’s current subscription details.
getCurrentSubscription (): Promise < GetSubscriptionResponse >
Route: GET /payment/subscription
Response
Whether the request was successful
The subscription object, or null if no active subscription Show subscription properties
Unique subscription identifier
Subscription status: active, trialing, canceled, revoked, past_due, incomplete, incomplete_expired
The subscribed plan details including name, pricing, limits, and features
ISO 8601 timestamp when current billing period started
ISO 8601 timestamp when current billing period ends
Whether subscription will cancel at the end of current period
ISO 8601 timestamp when subscription was canceled
ISO 8601 timestamp when trial period started
ISO 8601 timestamp when trial period ends
Whether the subscription is currently active
Whether the subscription is in trial period
Number of days until next renewal
Human-readable status message
Example
TypeScript
JavaScript
Python
import { getCurrentSubscription } from '@/lib/api/payment' ;
const response = await getCurrentSubscription ();
if ( response . success && response . data . subscription ) {
const sub = response . data . subscription ;
console . log ( `Plan: ${ sub . plan . name } ` );
console . log ( `Status: ${ sub . status } ` );
console . log ( `Renewal: ${ sub . daysUntilRenewal } days` );
}
Cancel subscription
Cancel an active subscription. You can choose to cancel immediately or at the end of the billing period.
cancelSubscription ( params ?: CancelSubscriptionParams ): Promise < CancelSubscriptionResponse >
Route: POST /payment/subscription/cancel
Parameters
If true, cancel and revoke access immediately. If false or omitted, cancel at period end.
Optional reason for cancellation (for feedback)
Request body
interface CancelSubscriptionParams {
immediately ?: boolean ;
reason ?: string ;
}
Example
Cancel at period end
Cancel immediately
Python
import { cancelSubscription } from '@/lib/api/payment' ;
const response = await cancelSubscription ({
immediately: false ,
reason: 'Switching to different service'
});
if ( response . success ) {
console . log ( 'Subscription will cancel at period end' );
}
Immediate cancellation revokes access immediately and cannot be undone. Use “cancel at period end” to maintain access until the paid period expires.
Reactivate subscription
Reactivate a subscription that was set to cancel at period end.
reactivateSubscription (): Promise < ReactivateSubscriptionResponse >
Route: POST /payment/subscription/reactivate
Example
TypeScript
JavaScript
Python
import { reactivateSubscription } from '@/lib/api/payment' ;
const response = await reactivateSubscription ();
if ( response . success ) {
console . log ( 'Subscription reactivated successfully' );
}
Reactivation only works for subscriptions set to cancel at period end. Immediately canceled subscriptions cannot be reactivated.
Create customer portal session
Generate a secure link to the Stripe Customer Portal where users can manage their billing information, payment methods, and invoices.
createPortalSession ( params ?: CreatePortalParams ): Promise < PortalResponse >
Route: POST /payment/portal
Parameters
Optional URL to redirect user after they’re done in the portal. Defaults to your dashboard.
Example
TypeScript
JavaScript
Python
import { createPortalSession } from '@/lib/api/payment' ;
const response = await createPortalSession ({
returnUrl: 'https://yourapp.com/billing'
});
if ( response . success ) {
// Redirect to customer portal
window . location . href = response . data . portalUrl ;
}
Response
{
"success" : true ,
"data" : {
"portalUrl" : "https://billing.stripe.com/p/session/..." ,
"expiresAt" : "2024-12-31T23:59:59Z"
},
"message" : "Portal session created successfully"
}
Customer portal sessions are time-limited and expire after the user completes their session or after the expiration time.
Subscription statuses
active - Subscription is active and in good standing
trialing - In trial period, not yet charged
canceled - Canceled but still active until period end
revoked - Immediately canceled, access revoked
past_due - Payment failed, in grace period
incomplete - Initial payment incomplete
incomplete_expired - Initial payment expired without completion
Next steps
Create checkout Start a new subscription
Payment history View transaction history