Skip to main content

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
WebSocket events are user-scoped - you only receive events for files you uploaded. See the Real-Time Events Guide for complete setup and examples.

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
Example:
Node.js

Excel Files

Upload Excel workbooks in legacy or modern formats. Supported:
  • .xls - Excel 97-2003
  • .xlsx - Excel 2007+
Example:
Node.js

ZIP Archives

Upload multiple files in a single ZIP archive for batch processing. Supported:
  • .zip - ZIP archive containing CSV/Excel files
Example:
Node.js
ZIP files are extracted and each file is processed individually. Ensure all files in the archive are for the same royalty source and period.

Royalty Source Detection

Automatic Recognition

The API can automatically detect file format based on headers and structure. You can provide the royaltySource 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
Query Parameters:
  • 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
Deleting a file does not automatically recalculate accounting. If you’ve already processed earnings from this file, you’ll need to manually adjust user balances.

Royalty Analytics

Summary Analytics

Get overall royalty statistics:
Node.js
Response Example:

By Platform (DSP)

Analyze royalties by streaming platform:
Node.js
Response Example:

By Territory (Country)

Track royalties by geographic location:
Node.js
Query Parameters:
  • 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

  1. Royalty file uploaded - Revenue data imported into the system
  2. Assets matched - Tracks/products identified by ISRC, UPC, or name
  3. Splits applied - Revenue shares calculated per split configuration
  4. 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

  1. Use consistent naming - Include source, period, and date in filenames
  2. One source per file - Don’t mix Spotify and Apple data in same file
  3. Specify periods accurately - Use the actual accounting period from the statement
Good naming examples:

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:
  1. Use ZIP compression - Reduces upload time
  2. Monitor status regularly - Check every 30-60 seconds
  3. Be patient - Large files may take 10-30 minutes
  4. Verify completion - Don’t assume success, check final status

Troubleshooting

Possible causes:
  • File is very large (processing can take 10-30 minutes)
  • Invalid data format (system attempting to parse)
  • Network issues during upload
Solutions:
  1. Wait 30 minutes before taking action
  2. Check file status endpoint for error details
  3. If still stuck after 1 hour, contact support with fileId
Common reasons:
  • Unrecognized file format
  • Missing required columns
  • Invalid data types (e.g., text in numeric columns)
  • File encoding issues
Solutions:
  1. Check file details for specific error message
  2. Verify file format matches royalty source
  3. Ensure file encoding is UTF-8
  4. Try re-uploading with royaltySource specified
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
Solutions:
  1. Verify assets exist: GET /asset?isrc={ISRC}
  2. Check split configuration: GET /split?asset={assetId}
  3. Force accounting recalculation
  4. Review royalty data: GET /royalty/by-asset/{assetId}
Cause: Upload URLs expire after 1 hour for security.Solution: Request a new upload URL and upload immediately.
Prevention:
  • Track which files you’ve uploaded
  • Use consistent naming conventions
  • Check uploaded files list before uploading
If duplicates exist:
  1. Delete the duplicate file
  2. Recalculate accounting for affected users

API Reference

For complete endpoint documentation, see: File Upload: Analytics: Related Guides: