Create Bulk Products
curl --request POST \
--url https://api.royalti.io/product/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"products": [
{
"upc": "<string>",
"title": "<string>",
"displayArtist": "<string>",
"mainArtist": [
"<string>"
],
"type": "<string>",
"format": "<string>",
"releaseDate": "2023-12-25",
"mainGenre": [
"<string>"
],
"artists": [
"<string>"
],
"split": [
{
"user": "<string>",
"share": 123
}
]
}
]
}
'import requests
url = "https://api.royalti.io/product/bulk"
payload = { "products": [
{
"upc": "<string>",
"title": "<string>",
"displayArtist": "<string>",
"mainArtist": ["<string>"],
"type": "<string>",
"format": "<string>",
"releaseDate": "2023-12-25",
"mainGenre": ["<string>"],
"artists": ["<string>"],
"split": [
{
"user": "<string>",
"share": 123
}
]
}
] }
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({
products: [
{
upc: '<string>',
title: '<string>',
displayArtist: '<string>',
mainArtist: ['<string>'],
type: '<string>',
format: '<string>',
releaseDate: '2023-12-25',
mainGenre: ['<string>'],
artists: ['<string>'],
split: [{user: '<string>', share: 123}]
}
]
})
};
fetch('https://api.royalti.io/product/bulk', 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/product/bulk",
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([
'products' => [
[
'upc' => '<string>',
'title' => '<string>',
'displayArtist' => '<string>',
'mainArtist' => [
'<string>'
],
'type' => '<string>',
'format' => '<string>',
'releaseDate' => '2023-12-25',
'mainGenre' => [
'<string>'
],
'artists' => [
'<string>'
],
'split' => [
[
'user' => '<string>',
'share' => 123
]
]
]
]
]),
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/product/bulk"
payload := strings.NewReader("{\n \"products\": [\n {\n \"upc\": \"<string>\",\n \"title\": \"<string>\",\n \"displayArtist\": \"<string>\",\n \"mainArtist\": [\n \"<string>\"\n ],\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"releaseDate\": \"2023-12-25\",\n \"mainGenre\": [\n \"<string>\"\n ],\n \"artists\": [\n \"<string>\"\n ],\n \"split\": [\n {\n \"user\": \"<string>\",\n \"share\": 123\n }\n ]\n }\n ]\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/product/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"products\": [\n {\n \"upc\": \"<string>\",\n \"title\": \"<string>\",\n \"displayArtist\": \"<string>\",\n \"mainArtist\": [\n \"<string>\"\n ],\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"releaseDate\": \"2023-12-25\",\n \"mainGenre\": [\n \"<string>\"\n ],\n \"artists\": [\n \"<string>\"\n ],\n \"split\": [\n {\n \"user\": \"<string>\",\n \"share\": 123\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/product/bulk")
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 \"products\": [\n {\n \"upc\": \"<string>\",\n \"title\": \"<string>\",\n \"displayArtist\": \"<string>\",\n \"mainArtist\": [\n \"<string>\"\n ],\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"releaseDate\": \"2023-12-25\",\n \"mainGenre\": [\n \"<string>\"\n ],\n \"artists\": [\n \"<string>\"\n ],\n \"split\": [\n {\n \"user\": \"<string>\",\n \"share\": 123\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Bulk product creation completed",
"createdProducts": [
"Product One",
"Product Two"
],
"processedCount": 3,
"errors": [
"Product Three UPC already exists"
]
}{
"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>"
]
}
}Product
Create Bulk Products
/product/bulk
POST
/
product
/
bulk
Create Bulk Products
curl --request POST \
--url https://api.royalti.io/product/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"products": [
{
"upc": "<string>",
"title": "<string>",
"displayArtist": "<string>",
"mainArtist": [
"<string>"
],
"type": "<string>",
"format": "<string>",
"releaseDate": "2023-12-25",
"mainGenre": [
"<string>"
],
"artists": [
"<string>"
],
"split": [
{
"user": "<string>",
"share": 123
}
]
}
]
}
'import requests
url = "https://api.royalti.io/product/bulk"
payload = { "products": [
{
"upc": "<string>",
"title": "<string>",
"displayArtist": "<string>",
"mainArtist": ["<string>"],
"type": "<string>",
"format": "<string>",
"releaseDate": "2023-12-25",
"mainGenre": ["<string>"],
"artists": ["<string>"],
"split": [
{
"user": "<string>",
"share": 123
}
]
}
] }
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({
products: [
{
upc: '<string>',
title: '<string>',
displayArtist: '<string>',
mainArtist: ['<string>'],
type: '<string>',
format: '<string>',
releaseDate: '2023-12-25',
mainGenre: ['<string>'],
artists: ['<string>'],
split: [{user: '<string>', share: 123}]
}
]
})
};
fetch('https://api.royalti.io/product/bulk', 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/product/bulk",
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([
'products' => [
[
'upc' => '<string>',
'title' => '<string>',
'displayArtist' => '<string>',
'mainArtist' => [
'<string>'
],
'type' => '<string>',
'format' => '<string>',
'releaseDate' => '2023-12-25',
'mainGenre' => [
'<string>'
],
'artists' => [
'<string>'
],
'split' => [
[
'user' => '<string>',
'share' => 123
]
]
]
]
]),
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/product/bulk"
payload := strings.NewReader("{\n \"products\": [\n {\n \"upc\": \"<string>\",\n \"title\": \"<string>\",\n \"displayArtist\": \"<string>\",\n \"mainArtist\": [\n \"<string>\"\n ],\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"releaseDate\": \"2023-12-25\",\n \"mainGenre\": [\n \"<string>\"\n ],\n \"artists\": [\n \"<string>\"\n ],\n \"split\": [\n {\n \"user\": \"<string>\",\n \"share\": 123\n }\n ]\n }\n ]\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/product/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"products\": [\n {\n \"upc\": \"<string>\",\n \"title\": \"<string>\",\n \"displayArtist\": \"<string>\",\n \"mainArtist\": [\n \"<string>\"\n ],\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"releaseDate\": \"2023-12-25\",\n \"mainGenre\": [\n \"<string>\"\n ],\n \"artists\": [\n \"<string>\"\n ],\n \"split\": [\n {\n \"user\": \"<string>\",\n \"share\": 123\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/product/bulk")
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 \"products\": [\n {\n \"upc\": \"<string>\",\n \"title\": \"<string>\",\n \"displayArtist\": \"<string>\",\n \"mainArtist\": [\n \"<string>\"\n ],\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"releaseDate\": \"2023-12-25\",\n \"mainGenre\": [\n \"<string>\"\n ],\n \"artists\": [\n \"<string>\"\n ],\n \"split\": [\n {\n \"user\": \"<string>\",\n \"share\": 123\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Bulk product creation completed",
"createdProducts": [
"Product One",
"Product Two"
],
"processedCount": 3,
"errors": [
"Product Three UPC already exists"
]
}{
"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
/product/bulk Description: The/product/bulk endpoint allows the creation of multiple products simultaneously by providing an array of product objects.
Authorization:
- Required role:
adminor higher
POST
Request Payload:
| Parameter | Type | Description |
|---|---|---|
| products | array | An array of product objects with their details. |
Code Examples
const response = await fetch('https://api.royalti.io/product/bulk', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"products": [
{
"upc": "sample-upc",
"title": "sample-title",
"displayArtist": "sample-displayArtist",
"mainArtist": [
{}
],
"type": "sample-type",
"format": "sample-format",
"releaseDate": "2024-01-21",
"mainGenre": [
{}
],
"artists": [
{}
],
"split": [
{
"user": "sample-user",
"share": 1
}
]
}
]
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://api.royalti.io/product/bulk',
headers={
'Authorization': f'Bearer {token}'
},
json={"products":[{"upc":"sample-upc","title":"sample-title","displayArtist":"sample-displayArtist","mainArtist":[{}],"type":"sample-type","format":"sample-format","releaseDate":"2024-01-21","mainGenre":[{}],"artists":[{}],"split":[{"user":"sample-user","share":1}]}]}
)
data = response.json()
print(data)
curl -X POST https://api.royalti.io/product/bulk \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"products":[{"upc":"sample-upc","title":"sample-title","displayArtist":"sample-displayArtist","mainArtist":[{}],"type":"sample-type","format":"sample-format","releaseDate":"2024-01-21","mainGenre":[{}],"artists":[{}],"split":[{"user":"sample-user","share":1}]}]}'
⌘I