Analytics & Reporting
Data providers need visibility into their invoices, payments, and earnings. This guide covers the APIs for listing invoices, generating analytics summaries, and viewing revenue trends.
What You'll Learn
- List and filter invoices by status, customer, and date
- Get aggregate analytics with KPIs
- Generate revenue timeseries reports
- View profile usage
List Invoices with Filters
/api/v1/invoicesFilter by Status
import requestsurl = "https://api.orvion.com/api/v1/invoices"headers = {"Authorization": "Bearer your-api-key"}params = {"status": "paid"}response = requests.get(url, headers=headers, params=params)invoices = response.json()print(f"Found {len(invoices)} paid invoices")
Search by Customer
curl -X GET "https://api.orvion.com/api/v1/invoices?search=Enterprise" \-H "Authorization: Bearer your-api-key"
Paginate Results
curl -X GET "https://api.orvion.com/api/v1/invoices?limit=50&offset=100" \-H "Authorization: Bearer your-api-key"
Query Parameters
| Parameter | Type | Description |
|-----------|------|-------------|
| status | string | Filter by status: draft, sent, paid, overdue, canceled |
| search | string | Search by customer name or invoice number |
| limit | integer | Number of results (default: 100, max: 1000) |
| offset | integer | Pagination offset |
Response
[
{
"id": "inv_01HXYZ789DEF",
"number": "INV-2025-0001",
"customer_name": "Customer Company",
"customer_email": "[email protected]",
"amount": "5000.00",
"currency": "EUR",
"status": "paid",
"issued_at": "2025-01-15T10:00:00Z",
"due_at": "2025-02-01T10:00:00Z",
"paid_at": "2025-01-20T14:30:00Z",
...
}
]
Get Analytics Summary
/api/v1/invoices/analytics/summaryGet aggregate KPIs, aging buckets, and top customers for a date range:
import requestsurl = "https://api.orvion.com/api/v1/invoices/analytics/summary"headers = {"Authorization": "Bearer your-api-key"}params = {"from": "2025-01-01","to": "2025-01-31"}response = requests.get(url, headers=headers, params=params)analytics = response.json()# Print KPIssummary = analytics["summary"]print(f"Total invoiced: {summary['total_invoiced']}")print(f"Total paid: {summary['total_paid']}")print(f"Collection rate: {summary['collection_rate'] * 100:.1f}%")print(f"Avg days to pay: {summary['avg_time_to_pay_days']}")
Query Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| from | date | Yes | Start date (YYYY-MM-DD) |
| to | date | Yes | End date (YYYY-MM-DD) |
Response
{
"summary": {
"status_counts": {
"draft": 2,
"sent": 5,
"paid": 12,
"overdue": 1,
"canceled": 0
},
"total_invoiced": "125000.00",
"total_paid": "98000.00",
"total_outstanding": "27000.00",
"total_overdue": "5000.00",
"collection_rate": 0.784,
"avg_time_to_pay_days": 5.2
},
"aging": {
"days_0_30": "15000.00",
"days_31_60": "8000.00",
"days_61_90": "3000.00",
"days_90_plus": "1000.00"
},
"top_customers": [
{
"customer_name": "Enterprise Corp",
"customer_email": "[email protected]",
"invoice_count": 5,
"total_invoiced": "50000.00",
"total_paid": "50000.00"
},
{
"customer_name": "Startup Inc",
"customer_email": "[email protected]",
"invoice_count": 3,
"total_invoiced": "25000.00",
"total_paid": "20000.00"
}
]
}
Summary Fields
| Field | Description |
|-------|-------------|
| status_counts | Count of invoices by status |
| total_invoiced | Sum of all invoice amounts |
| total_paid | Sum of paid invoice amounts |
| total_outstanding | Amount still owed (sent + partially_paid) |
| total_overdue | Amount past due date |
| collection_rate | Paid / Invoiced ratio (0-1) |
| avg_time_to_pay_days | Average days from issue to payment |
Aging Buckets
| Field | Description |
|-------|-------------|
| days_0_30 | Outstanding amount 0-30 days old |
| days_31_60 | Outstanding amount 31-60 days old |
| days_61_90 | Outstanding amount 61-90 days old |
| days_90_plus | Outstanding amount 90+ days old |
Get Revenue Timeseries
/api/v1/invoices/analytics/revenue-timeseriesGet revenue over time, grouped by day, week, or month:
import requestsurl = "https://api.orvion.com/api/v1/invoices/analytics/revenue-timeseries"headers = {"Authorization": "Bearer your-api-key"}params = {"from": "2025-01-01","to": "2025-01-31","granularity": "day"}response = requests.get(url, headers=headers, params=params)data = response.json()# Print timeseriesfor point in data["timeseries"]:print(f"{point['bucket']}: {point['paid_amount']} ({point['paid_count']} payments)")
Query Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| from | date | Yes | Start date (YYYY-MM-DD) |
| to | date | Yes | End date (YYYY-MM-DD) |
| granularity | string | No | day, week, or month (default: day) |
Response
{
"timeseries": [
{
"bucket": "2025-01-01",
"paid_amount": "5000.00",
"paid_count": 2
},
{
"bucket": "2025-01-02",
"paid_amount": "12000.00",
"paid_count": 3
},
{
"bucket": "2025-01-03",
"paid_amount": "0.00",
"paid_count": 0
}
]
}
List Invoicing Profiles
/api/v1/invoicing-profilesView all your invoicing profiles:
import requestsurl = "https://api.orvion.com/api/v1/invoicing-profiles"headers = {"Authorization": "Bearer your-api-key"}params = {"is_active": "true"}response = requests.get(url, headers=headers, params=params)profiles = response.json()for profile in profiles:print(f"{profile['name']} ({profile['network']}/{profile['asset']})")
Query Parameters
| Parameter | Type | Description |
|-----------|------|-------------|
| is_active | boolean | Filter by active status |
Response
[
{
"id": "profile_01HXYZ123ABC",
"name": "Data Sales – Base USDC",
"network": "base-mainnet",
"asset": "USDC",
"collection_mode": "direct",
"is_default": true,
"is_active": true,
...
},
{
"id": "profile_01HABC456DEF",
"name": "Data Marketplace – Base USDC – 10% fee",
"network": "base-mainnet",
"asset": "USDC",
"collection_mode": "escrow",
"is_default": false,
"is_active": true,
...
}
]
Coming Soon: Payment & Payout Tracking
Invoice Payment History
GET /api/v1/invoices/{invoice_id}/payments
View individual payments toward an invoice.
Payout Ledger
GET /api/v1/payment-payouts
Track how payments were distributed to beneficiaries.
Current Workflow:
- Money → Collections → Payments — View incoming payments
- Money → Payouts → Payouts — View outgoing payouts
- Filter by organization, wallet, or time range in the dashboard
Dashboard Views
The dashboard provides visual analytics at:
| Location | What You'll See | |----------|-----------------| | Money → Invoices → All Invoices | Invoice list with status, amounts, customers | | Money → Invoices → Invoice Analytics | KPI cards, charts, top customers | | Money → Collections → Payments | Individual payment records with tx hashes | | Money → Payouts → Payouts | Payout distribution records |
Next Steps
- Direct Payout Setup - Create your first invoice
- Escrow with Revenue Splits - Add platform fees
- Invoice Analytics Documentation - Detailed analytics reference