Bulk Upsert Product Variants Public
curl --request POST \
--url https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variants": [
{}
],
"product": {},
"source_info": {},
"auto_evolve_schema": true
}
'import requests
url = "https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/bulk"
payload = {
"variants": [{}],
"product": {},
"source_info": {},
"auto_evolve_schema": True
}
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({variants: [{}], product: {}, source_info: {}, auto_evolve_schema: true})
};
fetch('https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/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://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/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([
'variants' => [
[
]
],
'product' => [
],
'source_info' => [
],
'auto_evolve_schema' => true
]),
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://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/bulk"
payload := strings.NewReader("{\n \"variants\": [\n {}\n ],\n \"product\": {},\n \"source_info\": {},\n \"auto_evolve_schema\": true\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://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variants\": [\n {}\n ],\n \"product\": {},\n \"source_info\": {},\n \"auto_evolve_schema\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/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 \"variants\": [\n {}\n ],\n \"product\": {},\n \"source_info\": {},\n \"auto_evolve_schema\": true\n}"
response = http.request(request)
puts response.read_body{
"product_id": "<string>",
"items_processed": 123,
"items_created": 123,
"items_updated": 123,
"items_failed": 123,
"schema_evolved": true,
"new_schema_version": "<string>",
"errors": [],
"duplicates_in_payload": 0,
"error_summary": {},
"warnings": [],
"warnings_summary": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Catalogs
Bulk Upsert Product Variants Public
Bulk upsert variants under a parent product item in a single call.
The product_id path parameter is the parent product catalog item database ID, not the business product_id field stored in row data. Merges provided product-level fields into each variant and upserts using the catalog’s configured unique id field (e.g., ‘sku’).
POST
/
public
/
catalogs
/
{catalog_id}
/
products
/
{product_id}
/
items
/
bulk
Bulk Upsert Product Variants Public
curl --request POST \
--url https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variants": [
{}
],
"product": {},
"source_info": {},
"auto_evolve_schema": true
}
'import requests
url = "https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/bulk"
payload = {
"variants": [{}],
"product": {},
"source_info": {},
"auto_evolve_schema": True
}
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({variants: [{}], product: {}, source_info: {}, auto_evolve_schema: true})
};
fetch('https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/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://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/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([
'variants' => [
[
]
],
'product' => [
],
'source_info' => [
],
'auto_evolve_schema' => true
]),
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://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/bulk"
payload := strings.NewReader("{\n \"variants\": [\n {}\n ],\n \"product\": {},\n \"source_info\": {},\n \"auto_evolve_schema\": true\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://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variants\": [\n {}\n ],\n \"product\": {},\n \"source_info\": {},\n \"auto_evolve_schema\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/products/{product_id}/items/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 \"variants\": [\n {}\n ],\n \"product\": {},\n \"source_info\": {},\n \"auto_evolve_schema\": true\n}"
response = http.request(request)
puts response.read_body{
"product_id": "<string>",
"items_processed": 123,
"items_created": 123,
"items_updated": 123,
"items_failed": 123,
"schema_evolved": true,
"new_schema_version": "<string>",
"errors": [],
"duplicates_in_payload": 0,
"error_summary": {},
"warnings": [],
"warnings_summary": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Path Parameters
Parent product catalog item database ID, not the business product_id field value.
Body
application/json
Bulk upsert variants for a product using variants payload.
- product: product-level fields (typically keys prefixed with 'product_')
- variants: list of variant objects
- source_info: optional metadata recorded on items
- auto_evolve_schema: accepted for compatibility; public bulk writes currently allow schema evolution from submitted item data
Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes