Update Product Group Products
curl --request PUT \
--url https://api.example.com/product-groups/{product_group_id}/products \
--header 'Content-Type: application/json' \
--data '
{
"add": [
"<string>"
],
"remove": [
"<string>"
]
}
'import requests
url = "https://api.example.com/product-groups/{product_group_id}/products"
payload = {
"add": ["<string>"],
"remove": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({add: ['<string>'], remove: ['<string>']})
};
fetch('https://api.example.com/product-groups/{product_group_id}/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.example.com/product-groups/{product_group_id}/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([
'add' => [
'<string>'
],
'remove' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/product-groups/{product_group_id}/products"
payload := strings.NewReader("{\n \"add\": [\n \"<string>\"\n ],\n \"remove\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.example.com/product-groups/{product_group_id}/products")
.header("Content-Type", "application/json")
.body("{\n \"add\": [\n \"<string>\"\n ],\n \"remove\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/product-groups/{product_group_id}/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"add\": [\n \"<string>\"\n ],\n \"remove\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"product_group_id": "<string>",
"name": "<string>",
"product_count": 123,
"creation_date": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Product groups
Update Product Group Products
Add and/or remove products in one call, up to 500 ids each. Adding a product already in the group and removing one that isn’t are no-ops. Only products in your catalog can be added: if any isn’t, nothing changes and the call 404s without naming it.
PUT
/
product-groups
/
{product_group_id}
/
products
Update Product Group Products
curl --request PUT \
--url https://api.example.com/product-groups/{product_group_id}/products \
--header 'Content-Type: application/json' \
--data '
{
"add": [
"<string>"
],
"remove": [
"<string>"
]
}
'import requests
url = "https://api.example.com/product-groups/{product_group_id}/products"
payload = {
"add": ["<string>"],
"remove": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({add: ['<string>'], remove: ['<string>']})
};
fetch('https://api.example.com/product-groups/{product_group_id}/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.example.com/product-groups/{product_group_id}/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([
'add' => [
'<string>'
],
'remove' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/product-groups/{product_group_id}/products"
payload := strings.NewReader("{\n \"add\": [\n \"<string>\"\n ],\n \"remove\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.example.com/product-groups/{product_group_id}/products")
.header("Content-Type", "application/json")
.body("{\n \"add\": [\n \"<string>\"\n ],\n \"remove\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/product-groups/{product_group_id}/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"add\": [\n \"<string>\"\n ],\n \"remove\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"product_group_id": "<string>",
"name": "<string>",
"product_count": 123,
"creation_date": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Subtotal Connector tool: update_product_group_products
Adds and removes products in one call, up to 500 product ids each. Adding a product already in the group, or removing one that isn’t, changes nothing.
Only products from your brand catalog can be added. If any product to add isn’t in it, the call returns
404 and nothing changes.
Call it with your API key, or with a Subtotal Connector OAuth token that includes product_groups:write. A token without it receives 403 insufficient_scope. Partner app tokens don’t include it.Path Parameters
The group's product_group_id
Body
application/json