curl --request PUT \
--url https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/custom-attribute-values \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"customAttributeValues": [
{
"id": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"clientId": "<string>",
"name": "<string>",
"value": "<string>",
"isTemplate": true
}
]
}
'import requests
url = "https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/custom-attribute-values"
payload = { "customAttributeValues": [
{
"id": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"clientId": "<string>",
"name": "<string>",
"value": "<string>",
"isTemplate": True
}
] }
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({
customAttributeValues: [
{
id: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
clientId: '<string>',
name: '<string>',
value: '<string>',
isTemplate: true
}
]
})
};
fetch('https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/custom-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}/custom-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([
'customAttributeValues' => [
[
'id' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'clientId' => '<string>',
'name' => '<string>',
'value' => '<string>',
'isTemplate' => true
]
]
]),
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}/custom-attribute-values"
payload := strings.NewReader("{\n \"customAttributeValues\": [\n {\n \"id\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"clientId\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"isTemplate\": true\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}/custom-attribute-values")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customAttributeValues\": [\n {\n \"id\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"clientId\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"isTemplate\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/custom-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 \"customAttributeValues\": [\n {\n \"id\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"clientId\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"isTemplate\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"customAttributeValues": [
{
"name": "<string>",
"value": "<string>",
"isTemplate": true,
"id": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesChannelId": "<string>",
"channelCategoryId": "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>"
}
]
}{
"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 Custom Attribute Values
curl --request PUT \
--url https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/custom-attribute-values \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"customAttributeValues": [
{
"id": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"clientId": "<string>",
"name": "<string>",
"value": "<string>",
"isTemplate": true
}
]
}
'import requests
url = "https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/custom-attribute-values"
payload = { "customAttributeValues": [
{
"id": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"clientId": "<string>",
"name": "<string>",
"value": "<string>",
"isTemplate": True
}
] }
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({
customAttributeValues: [
{
id: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
clientId: '<string>',
name: '<string>',
value: '<string>',
isTemplate: true
}
]
})
};
fetch('https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/custom-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}/custom-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([
'customAttributeValues' => [
[
'id' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'clientId' => '<string>',
'name' => '<string>',
'value' => '<string>',
'isTemplate' => true
]
]
]),
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}/custom-attribute-values"
payload := strings.NewReader("{\n \"customAttributeValues\": [\n {\n \"id\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"clientId\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"isTemplate\": true\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}/custom-attribute-values")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customAttributeValues\": [\n {\n \"id\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"clientId\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"isTemplate\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/custom-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 \"customAttributeValues\": [\n {\n \"id\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"clientId\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"isTemplate\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"customAttributeValues": [
{
"name": "<string>",
"value": "<string>",
"isTemplate": true,
"id": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesChannelId": "<string>",
"channelCategoryId": "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>"
}
]
}{
"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
Query Parameters
Whether a rename of a custom field also renames the custom fields of the items whose base data for this seller has this category. Optional, default false; has no effect without a rename. The REST schema lists this parameter as required, because the schema generator does not keep the optionality of the parameter; the API accepts a request without it, and a client generated from the REST schema may not be able to omit it. GraphQL treats it as optional.
Body
Request model for SetScxCategoryCustomAttributeValues command endpoint. Route parameters bind from the route, query parameters from the query string, everything else from the body.
Response
The custom fields were replaced. Returns the stored custom field entries of the seller for the category; an entry whose list entry sent a client id carries it.
Replaces the custom fields that an SCX seller has stored for a channel category. The list describes the custom field entries the seller has for the category afterwards: an entry with an "Id" updates that entry (a property that is not sent keeps its stored value), an entry without an "Id" creates a new entry and needs a "ClientId", and a stored custom field entry that no list entry names is deleted, so an empty list deletes all of them. A new entry with the name of an existing field adds a value to that field; a changed name on an existing entry renames the field. Stored entries without a name are deleted as well, although the read operation never returns them; the call does not report them. Values with an attribute code are not touched. A custom field cannot hold a file, so the input has no file property. The whole call is one unit: if any rule is violated nothing is written. The result lists all custom field entries that the seller has for the category after the call, ordered like "QueryScxCategoryCustomAttributeValues" (REST: GET /v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/custom-attribute-values) without a requested sort order, read after the change was saved; an entry whose list entry sent a "ClientId" carries it, a created entry together with its new "Id". The call has no concurrency protection: it writes the list as given, so an entry that another client created in the meantime is deleted as well. A repeated call is not idempotent for created entries: a retry sends no "Id" for an entry that the lost first call created, so it deletes that entry and creates a new one with a new "Id". A client that did not receive the result therefore reads the stored custom fields ("QueryScxCategoryCustomAttributeValues", REST: GET /v2/scx/sellers/{salesChannelId}/categories/{channelCategoryId}/custom-attribute-values) before it repeats the call. The parameter "cascadeRename" (default false) only has an effect when the call renames a custom field: if it is true, the custom fields with the old name of the items whose base data for this seller has this category are renamed as well; they are never merged into another field. Without it, the items keep their custom fields and only the category entries change. With "cascadeRename" the call is a heavy operation: it changes one custom field entry for each affected item and marks the same items for upload, all in one transaction that holds locks on these rows until it ends, so it should run outside peak hours. 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). 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].name"), 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. If a rename with "cascadeRename" would give an item two custom fields of the same name, or the stored items cannot tell the old names of renames apart or would rename a field that the call does not mean, the call is rejected as a conflict (error code SCX_CUSTOM_FIELD_CASCADE_CONFLICT) and nothing is written; the violations of the entries take precedence over a conflict. The conflict lists at most 100 items, ordered by item id, under "entries[].name" with the index of the renamed entry; each text names the conflicting item by its public item id as "[…, item: ]", and the message names the total number of conflicting items. The grouping is delivered in the same form on every API surface. - Response
Was this page helpful?