Update Split
curl --request PUT \
--url https://api.royalti.io/split/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"asset": "d1c5b49e-95fa-4aed-930e-cf314c16a53d",
"product": null,
"type": "Publishing",
"startDate": "2022-01-01",
"endDate": "2022-01-31",
"name": "Updated Nigerian split train",
"split": [
{
"user": "cf960b5a-37cd-484a-b461-0b191b09bed1",
"share": 70
},
{
"user": "4e39b347-7db0-417d-a5bc-3d8493c9ce19",
"share": 30
}
]
}
'import requests
url = "https://api.royalti.io/split/{id}"
payload = {
"asset": "d1c5b49e-95fa-4aed-930e-cf314c16a53d",
"product": None,
"type": "Publishing",
"startDate": "2022-01-01",
"endDate": "2022-01-31",
"name": "Updated Nigerian split train",
"split": [
{
"user": "cf960b5a-37cd-484a-b461-0b191b09bed1",
"share": 70
},
{
"user": "4e39b347-7db0-417d-a5bc-3d8493c9ce19",
"share": 30
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
asset: 'd1c5b49e-95fa-4aed-930e-cf314c16a53d',
product: null,
type: 'Publishing',
startDate: '2022-01-01',
endDate: '2022-01-31',
name: 'Updated Nigerian split train',
split: [
{user: 'cf960b5a-37cd-484a-b461-0b191b09bed1', share: 70},
{user: '4e39b347-7db0-417d-a5bc-3d8493c9ce19', share: 30}
]
})
};
fetch('https://api.royalti.io/split/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'asset' => 'd1c5b49e-95fa-4aed-930e-cf314c16a53d',
'product' => null,
'type' => 'Publishing',
'startDate' => '2022-01-01',
'endDate' => '2022-01-31',
'name' => 'Updated Nigerian split train',
'split' => [
[
'user' => 'cf960b5a-37cd-484a-b461-0b191b09bed1',
'share' => 70
],
[
'user' => '4e39b347-7db0-417d-a5bc-3d8493c9ce19',
'share' => 30
]
]
]),
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/{id}"
payload := strings.NewReader("{\n \"asset\": \"d1c5b49e-95fa-4aed-930e-cf314c16a53d\",\n \"product\": null,\n \"type\": \"Publishing\",\n \"startDate\": \"2022-01-01\",\n \"endDate\": \"2022-01-31\",\n \"name\": \"Updated Nigerian split train\",\n \"split\": [\n {\n \"user\": \"cf960b5a-37cd-484a-b461-0b191b09bed1\",\n \"share\": 70\n },\n {\n \"user\": \"4e39b347-7db0-417d-a5bc-3d8493c9ce19\",\n \"share\": 30\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.royalti.io/split/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset\": \"d1c5b49e-95fa-4aed-930e-cf314c16a53d\",\n \"product\": null,\n \"type\": \"Publishing\",\n \"startDate\": \"2022-01-01\",\n \"endDate\": \"2022-01-31\",\n \"name\": \"Updated Nigerian split train\",\n \"split\": [\n {\n \"user\": \"cf960b5a-37cd-484a-b461-0b191b09bed1\",\n \"share\": 70\n },\n {\n \"user\": \"4e39b347-7db0-417d-a5bc-3d8493c9ce19\",\n \"share\": 30\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/split/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset\": \"d1c5b49e-95fa-4aed-930e-cf314c16a53d\",\n \"product\": null,\n \"type\": \"Publishing\",\n \"startDate\": \"2022-01-01\",\n \"endDate\": \"2022-01-31\",\n \"name\": \"Updated Nigerian split train\",\n \"split\": [\n {\n \"user\": \"cf960b5a-37cd-484a-b461-0b191b09bed1\",\n \"share\": 70\n },\n {\n \"user\": \"4e39b347-7db0-417d-a5bc-3d8493c9ce19\",\n \"share\": 30\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Split was updated successfully."
}{
"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>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}Splits
Update Split
/split/
PUT
/
split
/
{id}
Update Split
curl --request PUT \
--url https://api.royalti.io/split/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"asset": "d1c5b49e-95fa-4aed-930e-cf314c16a53d",
"product": null,
"type": "Publishing",
"startDate": "2022-01-01",
"endDate": "2022-01-31",
"name": "Updated Nigerian split train",
"split": [
{
"user": "cf960b5a-37cd-484a-b461-0b191b09bed1",
"share": 70
},
{
"user": "4e39b347-7db0-417d-a5bc-3d8493c9ce19",
"share": 30
}
]
}
'import requests
url = "https://api.royalti.io/split/{id}"
payload = {
"asset": "d1c5b49e-95fa-4aed-930e-cf314c16a53d",
"product": None,
"type": "Publishing",
"startDate": "2022-01-01",
"endDate": "2022-01-31",
"name": "Updated Nigerian split train",
"split": [
{
"user": "cf960b5a-37cd-484a-b461-0b191b09bed1",
"share": 70
},
{
"user": "4e39b347-7db0-417d-a5bc-3d8493c9ce19",
"share": 30
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
asset: 'd1c5b49e-95fa-4aed-930e-cf314c16a53d',
product: null,
type: 'Publishing',
startDate: '2022-01-01',
endDate: '2022-01-31',
name: 'Updated Nigerian split train',
split: [
{user: 'cf960b5a-37cd-484a-b461-0b191b09bed1', share: 70},
{user: '4e39b347-7db0-417d-a5bc-3d8493c9ce19', share: 30}
]
})
};
fetch('https://api.royalti.io/split/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'asset' => 'd1c5b49e-95fa-4aed-930e-cf314c16a53d',
'product' => null,
'type' => 'Publishing',
'startDate' => '2022-01-01',
'endDate' => '2022-01-31',
'name' => 'Updated Nigerian split train',
'split' => [
[
'user' => 'cf960b5a-37cd-484a-b461-0b191b09bed1',
'share' => 70
],
[
'user' => '4e39b347-7db0-417d-a5bc-3d8493c9ce19',
'share' => 30
]
]
]),
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/{id}"
payload := strings.NewReader("{\n \"asset\": \"d1c5b49e-95fa-4aed-930e-cf314c16a53d\",\n \"product\": null,\n \"type\": \"Publishing\",\n \"startDate\": \"2022-01-01\",\n \"endDate\": \"2022-01-31\",\n \"name\": \"Updated Nigerian split train\",\n \"split\": [\n {\n \"user\": \"cf960b5a-37cd-484a-b461-0b191b09bed1\",\n \"share\": 70\n },\n {\n \"user\": \"4e39b347-7db0-417d-a5bc-3d8493c9ce19\",\n \"share\": 30\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.royalti.io/split/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset\": \"d1c5b49e-95fa-4aed-930e-cf314c16a53d\",\n \"product\": null,\n \"type\": \"Publishing\",\n \"startDate\": \"2022-01-01\",\n \"endDate\": \"2022-01-31\",\n \"name\": \"Updated Nigerian split train\",\n \"split\": [\n {\n \"user\": \"cf960b5a-37cd-484a-b461-0b191b09bed1\",\n \"share\": 70\n },\n {\n \"user\": \"4e39b347-7db0-417d-a5bc-3d8493c9ce19\",\n \"share\": 30\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/split/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset\": \"d1c5b49e-95fa-4aed-930e-cf314c16a53d\",\n \"product\": null,\n \"type\": \"Publishing\",\n \"startDate\": \"2022-01-01\",\n \"endDate\": \"2022-01-31\",\n \"name\": \"Updated Nigerian split train\",\n \"split\": [\n {\n \"user\": \"cf960b5a-37cd-484a-b461-0b191b09bed1\",\n \"share\": 70\n },\n {\n \"user\": \"4e39b347-7db0-417d-a5bc-3d8493c9ce19\",\n \"share\": 30\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Split was updated successfully."
}{
"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>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}This endpoint requires authentication. Include your Bearer token in the Authorization header.
Description
/split/ Description: The/split/{splitId} endpoint allows updating the details of a specific split identified by their unique splitId.
Authorization:
- Required role:
adminor higher
PUT
Code Examples
const response = await fetch('https://api.royalti.io/split/example-id', {
method: 'PUT',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"asset": "sample-asset",
"product": "sample-product",
"type": "sample-type",
"startDate": "2024-01-21",
"endDate": "2024-01-21",
"name": "sample-name",
"contract": "sample-contract",
"ContractId": "sample-ContractId",
"memo": "sample-memo",
"split": [
{
"ref": "#/components/schemas/SplitShare"
}
],
"conditions": [
{
"mode": "sample-mode",
"memo": "sample-memo",
"territories": [
{}
],
"dsps": [
{}
],
"usageTypes": [
{}
],
"customDimension": "sample-customDimension",
"customValues": [
{}
]
}
]
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.put(
'https://api.royalti.io/split/example-id',
headers={
'Authorization': f'Bearer {token}'
},
json={"asset":"sample-asset","product":"sample-product","type":"sample-type","startDate":"2024-01-21","endDate":"2024-01-21","name":"sample-name","contract":"sample-contract","ContractId":"sample-ContractId","memo":"sample-memo","split":[{"ref":"#/components/schemas/SplitShare"}],"conditions":[{"mode":"sample-mode","memo":"sample-memo","territories":[{}],"dsps":[{}],"usageTypes":[{}],"customDimension":"sample-customDimension","customValues":[{}]}]}
)
data = response.json()
print(data)
curl -X PUT https://api.royalti.io/split/example-id \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"asset":"sample-asset","product":"sample-product","type":"sample-type","startDate":"2024-01-21","endDate":"2024-01-21","name":"sample-name","contract":"sample-contract","ContractId":"sample-ContractId","memo":"sample-memo","split":[{"ref":"#/components/schemas/SplitShare"}],"conditions":[{"mode":"sample-mode","memo":"sample-memo","territories":[{}],"dsps":[{}],"usageTypes":[{}],"customDimension":"sample-customDimension","customValues":[{}]}]}'
Authorizations
Body
application/json