Upsert Products
curl --request PUT \
--url https://api.vizochok.com/api/v1/catalog/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"products": [
{
"brand": "Lactel",
"category_path": "Молочні продукти > Молоко",
"image_url": "https://cdn.example.com/milk-001.jpg",
"name": "Молоко Lactel 2.5% 900мл",
"sku": "milk-001",
"unit": "pcs",
"volume": 900
}
]
}
'import requests
url = "https://api.vizochok.com/api/v1/catalog/products"
payload = { "products": [
{
"brand": "Lactel",
"category_path": "Молочні продукти > Молоко",
"image_url": "https://cdn.example.com/milk-001.jpg",
"name": "Молоко Lactel 2.5% 900мл",
"sku": "milk-001",
"unit": "pcs",
"volume": 900
}
] }
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({
products: [
{
brand: 'Lactel',
category_path: 'Молочні продукти > Молоко',
image_url: 'https://cdn.example.com/milk-001.jpg',
name: 'Молоко Lactel 2.5% 900мл',
sku: 'milk-001',
unit: 'pcs',
volume: 900
}
]
})
};
fetch('https://api.vizochok.com/api/v1/catalog/products', 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.vizochok.com/api/v1/catalog/products",
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([
'products' => [
[
'brand' => 'Lactel',
'category_path' => 'Молочні продукти > Молоко',
'image_url' => 'https://cdn.example.com/milk-001.jpg',
'name' => 'Молоко Lactel 2.5% 900мл',
'sku' => 'milk-001',
'unit' => 'pcs',
'volume' => 900
]
]
]),
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.vizochok.com/api/v1/catalog/products"
payload := strings.NewReader("{\n \"products\": [\n {\n \"brand\": \"Lactel\",\n \"category_path\": \"Молочні продукти > Молоко\",\n \"image_url\": \"https://cdn.example.com/milk-001.jpg\",\n \"name\": \"Молоко Lactel 2.5% 900мл\",\n \"sku\": \"milk-001\",\n \"unit\": \"pcs\",\n \"volume\": 900\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.vizochok.com/api/v1/catalog/products")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"products\": [\n {\n \"brand\": \"Lactel\",\n \"category_path\": \"Молочні продукти > Молоко\",\n \"image_url\": \"https://cdn.example.com/milk-001.jpg\",\n \"name\": \"Молоко Lactel 2.5% 900мл\",\n \"sku\": \"milk-001\",\n \"unit\": \"pcs\",\n \"volume\": 900\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vizochok.com/api/v1/catalog/products")
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 \"products\": [\n {\n \"brand\": \"Lactel\",\n \"category_path\": \"Молочні продукти > Молоко\",\n \"image_url\": \"https://cdn.example.com/milk-001.jpg\",\n \"name\": \"Молоко Lactel 2.5% 900мл\",\n \"sku\": \"milk-001\",\n \"unit\": \"pcs\",\n \"volume\": 900\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"total": 123,
"to_embed": 123,
"unchanged": 123,
"status": "accepted"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Catalog
Upsert Products
Bulk upsert products. Saves metadata immediately, embeds in background.
PUT
/
api
/
v1
/
catalog
/
products
Upsert Products
curl --request PUT \
--url https://api.vizochok.com/api/v1/catalog/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"products": [
{
"brand": "Lactel",
"category_path": "Молочні продукти > Молоко",
"image_url": "https://cdn.example.com/milk-001.jpg",
"name": "Молоко Lactel 2.5% 900мл",
"sku": "milk-001",
"unit": "pcs",
"volume": 900
}
]
}
'import requests
url = "https://api.vizochok.com/api/v1/catalog/products"
payload = { "products": [
{
"brand": "Lactel",
"category_path": "Молочні продукти > Молоко",
"image_url": "https://cdn.example.com/milk-001.jpg",
"name": "Молоко Lactel 2.5% 900мл",
"sku": "milk-001",
"unit": "pcs",
"volume": 900
}
] }
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({
products: [
{
brand: 'Lactel',
category_path: 'Молочні продукти > Молоко',
image_url: 'https://cdn.example.com/milk-001.jpg',
name: 'Молоко Lactel 2.5% 900мл',
sku: 'milk-001',
unit: 'pcs',
volume: 900
}
]
})
};
fetch('https://api.vizochok.com/api/v1/catalog/products', 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.vizochok.com/api/v1/catalog/products",
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([
'products' => [
[
'brand' => 'Lactel',
'category_path' => 'Молочні продукти > Молоко',
'image_url' => 'https://cdn.example.com/milk-001.jpg',
'name' => 'Молоко Lactel 2.5% 900мл',
'sku' => 'milk-001',
'unit' => 'pcs',
'volume' => 900
]
]
]),
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.vizochok.com/api/v1/catalog/products"
payload := strings.NewReader("{\n \"products\": [\n {\n \"brand\": \"Lactel\",\n \"category_path\": \"Молочні продукти > Молоко\",\n \"image_url\": \"https://cdn.example.com/milk-001.jpg\",\n \"name\": \"Молоко Lactel 2.5% 900мл\",\n \"sku\": \"milk-001\",\n \"unit\": \"pcs\",\n \"volume\": 900\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.vizochok.com/api/v1/catalog/products")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"products\": [\n {\n \"brand\": \"Lactel\",\n \"category_path\": \"Молочні продукти > Молоко\",\n \"image_url\": \"https://cdn.example.com/milk-001.jpg\",\n \"name\": \"Молоко Lactel 2.5% 900мл\",\n \"sku\": \"milk-001\",\n \"unit\": \"pcs\",\n \"volume\": 900\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vizochok.com/api/v1/catalog/products")
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 \"products\": [\n {\n \"brand\": \"Lactel\",\n \"category_path\": \"Молочні продукти > Молоко\",\n \"image_url\": \"https://cdn.example.com/milk-001.jpg\",\n \"name\": \"Молоко Lactel 2.5% 900мл\",\n \"sku\": \"milk-001\",\n \"unit\": \"pcs\",\n \"volume\": 900\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"total": 123,
"to_embed": 123,
"unchanged": 123,
"status": "accepted"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Array of products to create or update
Show child attributes
Show child attributes
Response
Successful Response
Unique job identifier for tracking progress via GET /catalog/jobs/{job_id}
Total number of products in this upload
Number of products queued for embedding (new or changed content)
Number of products skipped (content unchanged, no re-embedding needed)
Initial job status (always 'accepted')
⌘I