Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -1012,3 +1012,18 @@ soroban contract deploy \
## Versioning

This API documentation corresponds to the current `main` branch. The Soroban contract does not use semantic versioning on-chain; breaking changes require redeployment to a new contract ID. Client-side services follow the app version in `package.json`.

---

## Merchant Analytics API

The `MerchantAnalyticsService` computes merchant dashboard metrics, subscriber retention, revenue growth, actionable merchant insights, and financial report exports.

### Methods

#### `computeAnalytics(merchantId, merchantName, subscriptions, filter)`
Computes metrics including MRR, ARR, ARPU, total lifetime revenue, subscriber churn rate, growth rate, plan performance, and actionable insights.

#### `generateMerchantReport(dashboardData, format)`
Generates exportable standardized merchant reports in `json` or `csv` format.

3 changes: 3 additions & 0 deletions docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -507,3 +507,6 @@ tags:
description: Charge subscriptions, request and manage refunds
- name: Queries
description: Read-only data retrieval
- name: Merchant Analytics
description: Merchant revenue, subscriber analytics, and reporting

Loading
Loading