Skip to main content

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.

Payment history and billing

Retrieve payment transaction history and billing summaries for the authenticated user.

Get payment history

Retrieve a paginated list of payment transactions.
getPaymentHistory(params?: PaymentHistoryParams): Promise<PaymentHistoryResponse>
Route: GET /payment/history

Parameters

page
number
default:"1"
Page number for pagination
limit
number
default:"10"
Number of transactions per page (max 100)

Response

success
boolean
Whether the request was successful
data
object

Example

import { getPaymentHistory } from '@/lib/api/payment';

const response = await getPaymentHistory({
  page: 1,
  limit: 20
});

if (response.success) {
  response.data.transactions.forEach(txn => {
    console.log(`${txn.type}: $${txn.amount / 100} - ${txn.status}`);
  });
  
  console.log(`Page ${response.data.pagination.page} of ${response.data.pagination.totalPages}`);
}

Response example

{
  "success": true,
  "data": {
    "transactions": [
      {
        "id": "txn_abc123",
        "userId": "user_123",
        "subscriptionId": "sub_456",
        "planId": "plan_pro",
        "provider": "stripe",
        "providerTransactionId": "pi_xyz789",
        "type": "payment",
        "status": "succeeded",
        "amount": 2900,
        "currency": "usd",
        "taxAmount": 290,
        "paidAt": "2024-01-15T10:30:00Z",
        "receiptUrl": "https://pay.stripe.com/receipts/...",
        "invoiceUrl": "https://invoice.stripe.com/i/...",
        "plan": {
          "id": "plan_pro",
          "name": "Professional",
          "pricing": {
            "amount": 2900,
            "currency": "usd",
            "interval": "month"
          }
        },
        "createdAt": "2024-01-15T10:25:00Z"
      }
    ],
    "pagination": {
      "total": 45,
      "page": 1,
      "limit": 10,
      "totalPages": 5
    }
  },
  "message": "Payment history retrieved successfully"
}

Get billing summary

Retrieve a comprehensive billing summary including current plan, subscription status, recent transactions, and usage statistics.
getBillingSummary(): Promise<BillingSummaryResponse>
Route: GET /payment/billing

Response

success
boolean
Whether the request was successful
data
object

Example

import { getBillingSummary } from '@/lib/api/payment';

const response = await getBillingSummary();

if (response.success) {
  const { currentPlan, subscription, usageStats } = response.data;
  
  console.log(`Plan: ${currentPlan.name}`);
  console.log(`Redirects: ${usageStats.redirectsUsed}/${currentPlan.limits.maxRedirects}`);
  console.log(`Analytics: ${usageStats.totalAnalyticsEvents}`);
  
  if (subscription) {
    console.log(`Status: ${subscription.status}`);
    console.log(`Renewal: ${subscription.currentPeriodEnd}`);
  }
}

Transaction types

  • payment - Regular subscription charges
  • refund - Refunded amounts
  • subscription_cycle - Recurring billing cycle charges
  • setup_fee - One-time setup charges

Transaction statuses

  • succeeded - Payment processed successfully
  • failed - Payment failed (card declined, insufficient funds, etc.)
  • pending - Payment is being processed
  • refunded - Payment was fully refunded
  • partially_refunded - Part of the payment was refunded
All monetary amounts are returned in the smallest currency unit (e.g., cents for USD). Divide by 100 to get the dollar amount.

Next steps

Manage subscription

View and manage subscriptions

Create checkout

Subscribe to a plan

Build docs developers (and LLMs) love