Quick Start Guide

Get up and running with SubLoop's payment analytics API in 5 minutes.

1. Get Your API Key

First, you'll need to get your API key from your SubLoop dashboard:

  1. Log in to your SubLoop dashboard
  2. Navigate to API Clients
  3. Create a new API client or copy an existing API key

2. Choose Your SDK

SubLoop provides SDKs for multiple programming languages:

3. Install the SDK

Install the SDK for your chosen platform:

composer require subloop/php-sdk

4. Track Your First Payment

Here's how to track a successful payment:

<?php
use SubLoop\SubLoop;

$subloop = new SubLoop('sk_your_api_key_here');

$payment = $subloop->payments->createSuccessful(
    customerId: 'cust_001',
    amount: 29.99,
    currency: 'USD',
    subscriptionId: 'sub_001'
);

echo "Payment tracked: " . $payment['id'];

5. View Analytics

Get insights from your payment data:

// Get dashboard overview
$overview = $subloop->analytics->getOverview();
echo "MRR: $" . $overview['mrr'];

// Get MRR growth
$mrr = $subloop->analytics->getMRR();
echo "Growth: " . $mrr['growth_percentage'] . "%";

Next Steps

🎉 You're all set!

You've successfully integrated SubLoop's payment analytics. Here's what to explore next:

Need Help?

If you run into any issues: