curl --request PUT \
--url https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"attributeValues": [
{
"id": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"clientId": "<string>",
"attributeCode": "<string>",
"referenceGroup": 123,
"value": "<string>",
"isTemplate": true,
"fileId": "b45f6432-2462-4c6f-b00f-1d9d01000000"
}
]
}
'import requests
url = "https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values"
payload = { "attributeValues": [
{
"id": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"clientId": "<string>",
"attributeCode": "<string>",
"referenceGroup": 123,
"value": "<string>",
"isTemplate": True,
"fileId": "b45f6432-2462-4c6f-b00f-1d9d01000000"
}
] }
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
attributeValues: [
{
id: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
clientId: '<string>',
attributeCode: '<string>',
referenceGroup: 123,
value: '<string>',
isTemplate: true,
fileId: 'b45f6432-2462-4c6f-b00f-1d9d01000000'
}
]
})
};
fetch('https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values', 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.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values",
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([
'attributeValues' => [
[
'id' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'clientId' => '<string>',
'attributeCode' => '<string>',
'referenceGroup' => 123,
'value' => '<string>',
'isTemplate' => true,
'fileId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$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.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values"
payload := strings.NewReader("{\n \"attributeValues\": [\n {\n \"id\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"clientId\": \"<string>\",\n \"attributeCode\": \"<string>\",\n \"referenceGroup\": 123,\n \"value\": \"<string>\",\n \"isTemplate\": true,\n \"fileId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
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.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attributeValues\": [\n {\n \"id\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"clientId\": \"<string>\",\n \"attributeCode\": \"<string>\",\n \"referenceGroup\": 123,\n \"value\": \"<string>\",\n \"isTemplate\": true,\n \"fileId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"attributeValues\": [\n {\n \"id\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"clientId\": \"<string>\",\n \"attributeCode\": \"<string>\",\n \"referenceGroup\": 123,\n \"value\": \"<string>\",\n \"isTemplate\": true,\n \"fileId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"attributeValues": [
{
"attributeCode": "<string>",
"definitionScope": 0,
"value": "<string>",
"isTemplate": true,
"referenceGroup": 123,
"id": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesChannelId": "<string>",
"channelCategoryId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"channelCategoryAttributeId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"fileId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"clientId": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}Set Scx Category Attribute Seller Values
curl --request PUT \
--url https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"attributeValues": [
{
"id": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"clientId": "<string>",
"attributeCode": "<string>",
"referenceGroup": 123,
"value": "<string>",
"isTemplate": true,
"fileId": "b45f6432-2462-4c6f-b00f-1d9d01000000"
}
]
}
'import requests
url = "https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values"
payload = { "attributeValues": [
{
"id": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"clientId": "<string>",
"attributeCode": "<string>",
"referenceGroup": 123,
"value": "<string>",
"isTemplate": True,
"fileId": "b45f6432-2462-4c6f-b00f-1d9d01000000"
}
] }
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
attributeValues: [
{
id: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
clientId: '<string>',
attributeCode: '<string>',
referenceGroup: 123,
value: '<string>',
isTemplate: true,
fileId: 'b45f6432-2462-4c6f-b00f-1d9d01000000'
}
]
})
};
fetch('https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values', 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.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values",
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([
'attributeValues' => [
[
'id' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'clientId' => '<string>',
'attributeCode' => '<string>',
'referenceGroup' => 123,
'value' => '<string>',
'isTemplate' => true,
'fileId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$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.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values"
payload := strings.NewReader("{\n \"attributeValues\": [\n {\n \"id\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"clientId\": \"<string>\",\n \"attributeCode\": \"<string>\",\n \"referenceGroup\": 123,\n \"value\": \"<string>\",\n \"isTemplate\": true,\n \"fileId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
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.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attributeValues\": [\n {\n \"id\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"clientId\": \"<string>\",\n \"attributeCode\": \"<string>\",\n \"referenceGroup\": 123,\n \"value\": \"<string>\",\n \"isTemplate\": true,\n \"fileId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/attribute-values")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"attributeValues\": [\n {\n \"id\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"clientId\": \"<string>\",\n \"attributeCode\": \"<string>\",\n \"referenceGroup\": 123,\n \"value\": \"<string>\",\n \"isTemplate\": true,\n \"fileId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"attributeValues": [
{
"attributeCode": "<string>",
"definitionScope": 0,
"value": "<string>",
"isTemplate": true,
"referenceGroup": 123,
"id": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesChannelId": "<string>",
"channelCategoryId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"channelCategoryAttributeId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"fileId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"clientId": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}Authorizations
Scopes
Path Parameters
Body
Request model for SetScxCategoryAttributeSellerValues command endpoint. Route parameters bind from the route, query parameters from the query string, everything else from the body.
Response
The attribute values were replaced. Returns the stored values with an attribute code of the seller for the category; a value whose entry sent a client id carries it.
Replaces the attribute values with an attribute code that an SCX seller has stored for a channel category. The list describes the values the seller has for the category afterwards: an entry with an "Id" updates that value (a property that is not sent keeps its stored value), an entry without an "Id" creates a new value and needs a "ClientId", and a stored value that no entry names is deleted, so an empty list deletes all of them. Values are resolved against the attribute definitions of the category only; stored values whose attribute code the category does not define, including codes that only the seller or the channel define, are deleted as well, although the read operation never returns them, and the call does not report them. This includes stored values whose attribute code the category defines with a field type that the read operation does not support: they are treated like undefined codes, so they are deleted when no entry names them, and an entry that names such a code is rejected with SCX_ATTRIBUTE_CODE_UNKNOWN. Custom fields of the category are not touched. The whole call is one unit: if any rule is violated nothing is written. The result lists all values with an attribute code that the seller has for the category after the call, ordered like "QueryScxCategoryAttributeSellerValues" without a requested sort order, read after the change was saved; a value whose entry sent a "ClientId" carries it, a created value together with its new "Id". The call has no concurrency protection: it writes the list as given, so a value that another client created in the meantime is deleted as well. A repeated call is not idempotent for created values: a retry sends no "Id" for a value that the lost first call created, so it deletes that value and creates a new one with a new "Id". A client that did not receive the result therefore reads the stored values ("QueryScxCategoryAttributeSellerValues") before it repeats the call. A change that reaches the offers marks the items whose base data for this seller has this category for upload. An invalid sales channel id is rejected as invalid (error code SALES_CHANNEL_ID_INVALID). A sales channel that does not exist, is deleted, is deactivated or is not an SCX seller, or an id whose channel part does not match the seller, is rejected as not found (error code SCX_SALES_CHANNEL_NOT_FOUND); a category that does not exist or belongs to another channel is rejected as not found (error code SCX_CHANNEL_CATEGORY_NOT_FOUND). A category whose attribute definitions have never been synchronized is rejected as invalid (error code SCX_CHANNEL_CATEGORY_DEFINITIONS_MISSING) as the only error, after the check that the list is present and contains no null entry and before the entries are validated; it also applies to an empty list. Its violation is keyed by "channelCategoryId" instead of "entries[].". The client first runs the refresh operation of the attribute definitions of the category and then repeats the call. Violated rules of the entries are all reported at once. The error carries the error code that all violations share, or SCX_VALIDATION_FAILED if they differ, and the violations grouped by field: the key is "entries[]." with the zero-based position of the entry in the list and the field in camelCase (for example "entries[2].value"), the value is a list of texts of the form "[id: , clientId: ] : ", where the bracket part appears only if the entry carries an id or a client id and is not a machine-readable contract. The grouping is delivered in the same form on every API surface. - Response
Was this page helpful?