Match Splits
curl --request POST \
--url https://api.royalti.io/split/match \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"territory": "NG",
"dsp": "spotify",
"date": "2023-06-01"
}
'import requests
url = "https://api.royalti.io/split/match"
payload = {
"territory": "NG",
"dsp": "spotify",
"date": "2023-06-01"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({territory: 'NG', dsp: 'spotify', date: '2023-06-01'})
};
fetch('https://api.royalti.io/split/match', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.royalti.io/split/match",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'territory' => 'NG',
'dsp' => 'spotify',
'date' => '2023-06-01'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.royalti.io/split/match"
payload := strings.NewReader("{\n \"territory\": \"NG\",\n \"dsp\": \"spotify\",\n \"date\": \"2023-06-01\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.royalti.io/split/match")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"territory\": \"NG\",\n \"dsp\": \"spotify\",\n \"date\": \"2023-06-01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/split/match")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"territory\": \"NG\",\n \"dsp\": \"spotify\",\n \"date\": \"2023-06-01\"\n}"
response = http.request(request)
puts response.read_body{
"count": 1,
"splits": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Nigerian Split",
"type": "Publishing",
"startDate": "2023-01-01T00:00:00.000Z",
"endDate": "2023-12-31T23:59:59.999Z",
"conditions": [
{
"mode": "include",
"territories": [
"NG",
"GH",
"KE"
],
"dsps": [
"spotify",
"apple"
]
}
],
"SplitShares": [
{
"TenantUserId": "550e8400-e29b-41d4-a716-446655440001",
"Share": 60,
"TenantUser": {
"firstName": "John",
"lastName": "Doe",
"ipi": null
}
}
]
}
]
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}Splits
Match Splits
/split/match
POST
/
split
/
match
Match Splits
curl --request POST \
--url https://api.royalti.io/split/match \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"territory": "NG",
"dsp": "spotify",
"date": "2023-06-01"
}
'import requests
url = "https://api.royalti.io/split/match"
payload = {
"territory": "NG",
"dsp": "spotify",
"date": "2023-06-01"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({territory: 'NG', dsp: 'spotify', date: '2023-06-01'})
};
fetch('https://api.royalti.io/split/match', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.royalti.io/split/match",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'territory' => 'NG',
'dsp' => 'spotify',
'date' => '2023-06-01'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.royalti.io/split/match"
payload := strings.NewReader("{\n \"territory\": \"NG\",\n \"dsp\": \"spotify\",\n \"date\": \"2023-06-01\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.royalti.io/split/match")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"territory\": \"NG\",\n \"dsp\": \"spotify\",\n \"date\": \"2023-06-01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/split/match")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"territory\": \"NG\",\n \"dsp\": \"spotify\",\n \"date\": \"2023-06-01\"\n}"
response = http.request(request)
puts response.read_body{
"count": 1,
"splits": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Nigerian Split",
"type": "Publishing",
"startDate": "2023-01-01T00:00:00.000Z",
"endDate": "2023-12-31T23:59:59.999Z",
"conditions": [
{
"mode": "include",
"territories": [
"NG",
"GH",
"KE"
],
"dsps": [
"spotify",
"apple"
]
}
],
"SplitShares": [
{
"TenantUserId": "550e8400-e29b-41d4-a716-446655440001",
"Share": 60,
"TenantUser": {
"firstName": "John",
"lastName": "Doe",
"ipi": null
}
}
]
}
]
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}This endpoint requires authentication. Include your Bearer token in the Authorization header.
Description
/split/match Description:The
/split/match endpoint finds splits that match the specified criteria. It allows filtering splits by territory, DSP, usage type, and date.
Authorization:
- Required role:
useror higher
POST
Request Body:
The request body should be a JSON object with any of the following properties. At least one property must be provided.
| Parameter | Type | Required | Description |
|---|---|---|---|
| territory | string | No | ISO 3166-1 alpha-2 country code (e.g., ‘US’, ‘NG’) |
| dsp | string | No | Digital Service Provider identifier |
| usageType | string | No | Type of usage |
| date | string | No | Date in ISO 8601 format (e.g., ‘2023-01-15’) |
| [customDimension] | string | No | Any custom dimension key-value pair |
Code Examples
const response = await fetch('https://api.royalti.io/split/match', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"territory": "NG",
"dsp": "spotify",
"usageType": "stream",
"date": "2023-06-01"
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://api.royalti.io/split/match',
headers={
'Authorization': f'Bearer {token}'
},
json={"territory":"NG","dsp":"spotify","usageType":"stream","date":"2023-06-01"}
)
data = response.json()
print(data)
curl -X POST https://api.royalti.io/split/match \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"territory":"NG","dsp":"spotify","usageType":"stream","date":"2023-06-01"}'
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Body
application/json
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
⌘I