Contents

Chapter 1

Features

This chapter covers the core features and capabilities of Payment Analytics.

Features

  • Monthly Recurring Revenue (MRR) with breakdown: new, expansion, contraction
  • Annual Recurring Revenue (ARR) and average revenue per customer (ARPC)
  • Customer churn rate and revenue churn rate
  • Customer Lifetime Value (LTV): average, median, and P90
  • Failed payment analysis with error code ranking and revenue at risk
  • Revenue forecasting with month-over-month growth projection
  • Full dashboard combining all metrics in one report
  • Built-in demo with 12 months of realistic simulated data
  • Python stdlib only — zero dependencies

Quick Start

bash
# Run the full demo (generates sample data automatically)
python src/payment_analytics.py --action demo

# Full dashboard from your data
python src/payment_analytics.py --action dashboard --input examples/payments.json

# MRR breakdown
python src/payment_analytics.py --action mrr --input examples/payments.json

# Churn analysis
python src/payment_analytics.py --action churn --input examples/payments.json

# Customer lifetime value
python src/payment_analytics.py --action ltv --input examples/payments.json

# Failed payment analysis
python src/payment_analytics.py --action failures --input examples/payments.json

# Revenue forecast (next 12 months)
python src/payment_analytics.py --action forecast --input examples/payments.json --months 12
Chapter 2

CLI Reference

Follow this guide to get Payment Analytics up and running in your environment.

CLI Reference

FlagDescription
--action, -aAction to perform (required)
--inputJSON file with payment records
--monthsMonths to forecast (default: 6)
--verbose, -vEnable debug logging

Input Format

Payment records should be a JSON array (or {"payments": [...]}) where each record has:

FieldTypeRequiredDescription
idstringYesUnique payment ID
customer_idstringYesCustomer identifier
amountintYesAmount in cents
currencystringNoCurrency code (default: "usd")
statusstringYes"succeeded", "failed", or "refunded"
planstringNoPlan/tier name
intervalstringYes"month", "year", "quarter", "week", "one_time"
created_atstringYesISO 8601 timestamp
failure_codestringNoError code (for failed payments)
Chapter 3
🔒 Available in full product

Metrics Explained

You’ve reached the end of the free preview

Get the full Payment Analytics and unlock everything.

All Chapters

Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.

Full Tool Suite

Access all interactive tools with complete data, all workload profiles, and the full scenario library.

Source Files

Downloadable source code, configuration files, and working examples from every chapter.

Lifetime Updates

Free updates for life. Every new chapter, tool, and improvement included.

Buy Now — $19 →
📦 Free sample included — download another copy for the full product.
Payment Analytics v1.0.0 — Free Preview