Overview
The Royalti.io API enables you to upload royalty statements from streaming platforms and distributors, automatically distribute earnings based on configured splits, and access comprehensive analytics. This guide covers the complete royalty workflow from file upload to payment distribution.Key Features
- Multi-format upload - Support for CSV, Excel (XLS/XLSX), and ZIP archives
- Automatic source detection - Recognizes major DSPs and distributors
- Split-based distribution - Earnings calculated per configured revenue shares
- Comprehensive analytics - Track performance by artist, territory, platform, and time
- Period management - Organize royalties by accounting and sales periods
Prerequisites
Required Data
Before uploading royalty files, ensure you have:- Configured splits - Revenue shares assigned to users for assets/products
- Catalog items - Assets and products created in the system
- User accounts - Collaborators who will receive earnings
Authentication
All royalty endpoints require authentication with a Bearer token.
Node.js
Python
Quick Start: Upload Your First Royalty File
1
Request Upload URL
Get a secure upload URL for your royalty file.
Node.js
Python
The
royaltySource helps identify the file format. Common sources include: spotify, apple, youtube, ditto, tunecore, distrokid, cdbaby, etc.2
Upload File to Cloud Storage
Upload your file to the provided secure URL.
Node.js
Python
3
Confirm Upload
Notify the API that the upload is complete.
Node.js
Python
4
Monitor Processing Status
Check the status of your file processing.
Node.js
File processing happens asynchronously. Large files may take several minutes to complete.
Real-time updates available! Instead of polling, connect via WebSocket to receive instant progress updates. See the Real-Time Events Guide for details.
Real-Time Progress Monitoring
For a better user experience, use WebSocket events instead of polling for file status:Node.js
Supported File Formats
CSV and TSV Files
Upload comma-separated or tab-separated value files directly. Supported:.csv- Comma-separated values.tsv- Tab-separated values.txt- Text files with delimiters
Node.js
Excel Files
Upload Excel workbooks in legacy or modern formats. Supported:.xls- Excel 97-2003.xlsx- Excel 2007+
Node.js
ZIP Archives
Upload multiple files in a single ZIP archive for batch processing. Supported:.zip- ZIP archive containing CSV/Excel files
Node.js
Royalty Source Detection
Automatic Recognition
The API can automatically detect file format based on headers and structure. You can provide theroyaltySource parameter to improve accuracy:
Common Sources
Manual Source Specification
If the source isn’t automatically detected, you can specify a custom source:Node.js
Managing Uploaded Files
List All Files
Retrieve paginated list of uploaded royalty files:Node.js
page- Page number (default: 1)size- Items per page (default: 20, max: 100)type- Filter by file type (royalty,invoice,receipt,report)status- Filter by status (uploaded,processing,completed,failed)source- Filter by royalty source
Get File Details
Retrieve detailed information about a specific file:Node.js
Download Processed File
Get a download URL for the original or processed file:Node.js
Download URLs are temporary and expire after 1 hour for security.
Delete File
Remove a royalty file and its associated data:Node.js
Royalty Analytics
Summary Analytics
Get overall royalty statistics:Node.js
By Platform (DSP)
Analyze royalties by streaming platform:Node.js
By Territory (Country)
Track royalties by geographic location:Node.js
limit- Number of top countries to return (default: 10)
By Month
View month-over-month trends:Node.js
By Artist
Analyze artist-specific performance:Node.js
By Product/Asset
Track individual release or track performance:Node.js
Split Distribution
After royalty data is uploaded and processed, earnings are automatically distributed based on configured splits.How Distribution Works
- Royalty file uploaded - Revenue data imported into the system
- Assets matched - Tracks/products identified by ISRC, UPC, or name
- Splits applied - Revenue shares calculated per split configuration
- User earnings updated - Individual user balances increased
Viewing User Earnings
Check how much each user has earned:Node.js
Recalculating After Changes
If you modify splits or need to refresh calculations:Node.js
Large recalculations are processed in the background. Check the Financial Data & Management Guide for details on monitoring progress.
Best Practices
File Organization
- Use consistent naming - Include source, period, and date in filenames
- One source per file - Don’t mix Spotify and Apple data in same file
- Specify periods accurately - Use the actual accounting period from the statement
Data Validation
Before uploading, verify:- ✅ File contains all required columns
- ✅ Dates are in correct format
- ✅ Currency values are numeric
- ✅ ISRCs/UPCs match your catalog
- ✅ File encoding is UTF-8 (for special characters)
Error Handling
Always check upload status and handle errors:Node.js
Processing Large Files
For files with 100,000+ rows:- Use ZIP compression - Reduces upload time
- Monitor status regularly - Check every 30-60 seconds
- Be patient - Large files may take 10-30 minutes
- Verify completion - Don’t assume success, check final status
Troubleshooting
File stuck in 'processing' status
File stuck in 'processing' status
Possible causes:
- File is very large (processing can take 10-30 minutes)
- Invalid data format (system attempting to parse)
- Network issues during upload
- Wait 30 minutes before taking action
- Check file status endpoint for error details
- If still stuck after 1 hour, contact support with
fileId
File status shows 'failed'
File status shows 'failed'
Common reasons:
- Unrecognized file format
- Missing required columns
- Invalid data types (e.g., text in numeric columns)
- File encoding issues
- Check file details for specific error message
- Verify file format matches royalty source
- Ensure file encoding is UTF-8
- Try re-uploading with
royaltySourcespecified
No earnings calculated after upload
No earnings calculated after upload
Checklist:
- File status is ‘completed’
- Assets/products exist in catalog with matching ISRCs/UPCs
- Splits are configured for the assets
- Accounting period matches file period
- Verify assets exist:
GET /asset?isrc={ISRC} - Check split configuration:
GET /split?asset={assetId} - Force accounting recalculation
- Review royalty data:
GET /royalty/by-asset/{assetId}
Upload URL expired
Upload URL expired
Cause: Upload URLs expire after 1 hour for security.Solution: Request a new upload URL and upload immediately.
Duplicate data detected
Duplicate data detected
Prevention:
- Track which files you’ve uploaded
- Use consistent naming conventions
- Check uploaded files list before uploading
- Delete the duplicate file
- Recalculate accounting for affected users
API Reference
For complete endpoint documentation, see: File Upload:- POST /file/upload-url - Request upload URL
- POST /file/confirm-upload-completion - Confirm upload
- GET /file - List files
- GET /file/ - Get file details
- DELETE /file/royalty/ - Delete file
- GET /royalty - Summary analytics
- GET /royalty/dsp - Platform breakdown
- GET /royalty/country - Territory breakdown
- GET /royalty/month - Monthly trends
- GET /royalty/artist - Artist performance
- Splits Management - Configure revenue distribution
- Financial Data & Management - View earnings
- User Management - Manage collaborators