curl --request PUT \
--url https://api.royalti.io/product/{id}/setdefaultsplit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"defaultSplit": [
{
"user": "<string>",
"share": 123
}
]
}
'{
"message": "Default split set successfully"
}/product//setdefaultsplit
curl --request PUT \
--url https://api.royalti.io/product/{id}/setdefaultsplit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"defaultSplit": [
{
"user": "<string>",
"share": 123
}
]
}
'{
"message": "Default split set successfully"
}/product/{id}/setdefaultsplit endpoint sets the default split configuration for a product based on the first associated artist’s default splits. If no artist is associated with the product, it will return an error.
Method:PUT
Path Parameter:
| Parameter | Type | Description |
|---|---|---|
| id | string | The unique identifier of the product. |
const response = await fetch('https://api.royalti.io/product/example-id/setdefaultsplit', {
method: 'PUT',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"defaultSplit": [
{
"user": "sample-user",
"share": 1
}
]
})
});
const data = await response.json();
console.log(data);