Overview
Access real-time earnings data, payment tracking, and comprehensive financial reporting through the Royalti.io API. The accounting system provides detailed breakdowns of user earnings, transaction history, and outstanding balances with automatic calculations based on royalty data and configured splits.Key Features
- Real-time earnings - View current earnings and payment status for all users
- Automatic calculations - Earnings updated automatically when royalties are uploaded or splits change
- Transaction tracking - Complete history of payments, revenues, and expenses
- Flexible reporting - Monthly breakdowns, summaries, and custom date ranges
- Balance management - Track paid amounts, outstanding balances, and gross earnings
Prerequisites
Required Data
Before accessing accounting data, ensure you have:- Configured splits - Users assigned to splits with percentages
- Royalty data uploaded - Revenue data processed from DSPs/distributors
- Payment records - Payment transactions tracked in the system
Authentication
All accounting endpoints require authentication with a Bearer token.
Node.js
Python
Quick Start: Getting User Earnings
1
Get User Earnings Statistics
Retrieve earnings breakdown for a specific user.
Node.js
Python
2
Get Latest Data with Refresh
Request fresh calculations to ensure latest data.
Node.js
Use
forceRefresh=true after making split changes or when you need guaranteed up-to-date calculations.3
Get Detailed Breakdown
Include royalty summary for complete earnings breakdown.
Node.js
User Earnings & Statistics
Get User Accounting Statistics
Retrieve comprehensive earnings data for a specific user:Node.js
Royalty_Share- Gross earnings from all splitspaid- Total amount paid to userdue- Outstanding balance (Royalty_Share - paid)
include=royalty- Include detailed royalty breakdownforceRefresh=true- Recalculate from source data
Get Detailed Royalty Breakdown
Include royalty summary for streams, downloads, and rates:Node.js
All Users Summary
Current Balances for All Users
Get list of all users with their outstanding balances:Node.js
Python
q- Search by user namepage- Page number (default: 1)size- Page size (default: 10, max: 100)sort- Sort field:gross,net,paid,due(default:due)order- Sort order:ASCorDESC(default:DESC)
Total Outstanding for Workspace
Get aggregate due amount across all users:Node.js
Transaction History
List All Transactions
Get paginated list of all financial transactions:Node.js
page- Page number (default: 1)size- Items per page (default: 10, max: 100)start- Start date filter (ISO format: YYYY-MM-DD)end- End date filter (ISO format: YYYY-MM-DD)
payment- Payment made to userrevenue- Revenue receivedexpense- Expense recordedpaymentRequest- Payment request created
Node.js
Transaction Summary
Get aggregated totals across all transaction types:Node.js
The summary provides all-time totals for the workspace. Use the monthly breakdown endpoint for time-series analysis.
Monthly Transaction Breakdown
Analyze transactions by month with type breakdown:Node.js
start- Start date (ISO format: YYYY-MM-DD)stop- End date (ISO format: YYYY-MM-DD)
Refreshing Accounting Data
When to Refresh
Accounting data is automatically calculated when:- Royalty files are uploaded and processed
- Splits are created or modified
- Payments are recorded
- You’ve made multiple split changes
- You need guaranteed latest data
- You suspect calculations are out of sync
Refresh for Specific User
Request updated calculations for a single user:Node.js
Python
forceRefresh=true- Force recalculation even if data is recent
Refresh All Users in Workspace
Request recalculation for all users:Node.js
batchSize- Users per batch (default: 100, min: 1, max: 500)
For workspaces with many users (100+), recalculation is processed in batches to ensure reliability. Check the status endpoint to monitor progress.
Immediate Refresh (Small Workspaces)
For small workspaces with fewer than 100 users, you can use the immediate refresh:Node.js
This endpoint processes all users immediately. For workspaces with 100+ users, use the batched recalculate endpoint instead to avoid timeouts.
Check Recalculation Status
Monitor the progress of recalculation operations:Node.js
waiting- Job queued, not yet startedactive- Currently processingcompleted- Successfully finishedfailed- Encountered an errordelayed- Temporarily delayed, will retry
Queue Overview
View overall queue status without specifying a job ID:Node.js
Statistics Pipeline
Refresh all statistics and accounting data in the correct order:Node.js
This endpoint ensures all statistics are recalculated in the correct dependency order. Use this after bulk data uploads or major catalog changes.
Best Practices
Data Accuracy
- Trust automatic calculations - The system updates accounting when royalties upload or splits change
- Use forceRefresh sparingly - Only when you need guaranteed fresh data
- Validate splits first - Ensure splits total 100% before expecting accurate earnings
- Regular reconciliation - Compare accounting data with actual payments monthly
Performance Optimization
- Use default cached data - Faster response times for most queries
- Batch recalculations - For large workspaces, use batched refresh endpoints
- Monitor queue status - Track long-running operations
- Paginate results - Use reasonable page sizes (10-50 items)
Reporting Workflows
- Use date filters - Filter transactions by specific periods for reports
- Export for analysis - Use transaction endpoints for external reporting tools
- Monitor monthly trends - Track revenue and payment patterns over time
- Check user balances - Regularly review who is owed payment
Error Handling
Always handle refresh operations properly:Node.js
Troubleshooting
Earnings don't match expected amount
Earnings don't match expected amount
Checklist:
- Verify split configurations are active
- Check split date ranges include relevant periods
- Review conditional split logic (territory, DSP-specific splits)
- Ensure royalty data uploaded successfully
- Check user stats:
GET /accounting/{userId}/stats - Force refresh:
GET /accounting/{userId}/stats?forceRefresh=true - Verify splits:
GET /split?userId={userId} - Check royalty data:
GET /royalty?userId={userId}
Data seems outdated
Data seems outdated
Possible causes:
- Recent split changes not yet reflected
- Royalty file just uploaded
- Manual refresh needed
- Use
forceRefresh=trueparameter - Check recent uploads:
GET /file?status=completed - Verify split changes saved:
GET /split/{splitId} - Request recalculation:
POST /accounting/users/{userId}/recalculate
Refresh job stuck or failed
Refresh job stuck or failed
Check job status:Common causes:
- Invalid split data (doesn’t total 100%)
- Missing royalty data
- Database connection issues
- Check error details in job status
- Verify split configurations
- Retry with smaller batch size
- Contact support if error persists
User missing from current due list
User missing from current due list
Checklist:
- User has at least one active split
- Split date ranges include current period
- Asset/Product has royalty data uploaded
- Split percentages are valid (0-100)
- Check user splits:
GET /split?userId={userId} - Check user stats:
GET /accounting/{userId}/stats - Verify user exists:
GET /user/{userId} - Force recalculation if needed
Transaction totals don't match
Transaction totals don't match
Reconciliation steps:If mismatched:
- Check for deleted payments
- Verify all payments recorded correctly
- Force full workspace refresh
API Reference
For complete endpoint documentation, see: User Earnings:- GET /accounting//stats - User earnings statistics
- GET /accounting/getcurrentdue - Users with balances
- GET /accounting/gettotaldue - Workspace total due
- GET /accounting/transactions - List transactions
- GET /accounting/transactions/summary - Aggregate summary
- GET /accounting/transactions/monthly - Monthly breakdown
- GET /accounting/refresh - Immediate refresh (small workspaces)
- GET /accounting/refreshstats - Statistics pipeline
- POST /accounting/users//recalculate - Single user refresh
- POST /accounting/tenant/recalculate - Workspace refresh
- GET /accounting/queue/status - Monitor progress
- Splits Management - Configure revenue distribution
- User Management - Manage collaborators
- Payment Processing - Payment workflows
- Integrated Workflows - End-to-end examples