Set Scx Item Attribute Values
curl --request PUT \
--url https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/items/{itemId}/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}/items/{itemId}/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}/items/{itemId}/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}/items/{itemId}/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}/items/{itemId}/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}/items/{itemId}/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}/items/{itemId}/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>",
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"fileId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"sellerAttributeId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"channelAttributeId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"channelCategoryAttributeId": "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>"
}
]
}SCX
Set Scx Item Attribute Values
Replaces the attribute values with an attribute code that are stored on an item for an SCX seller. The list describes the values the item has 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. Stored values whose attribute code has no definition any more are deleted as well, although the read operation never returns them; the call does not report them. Custom fields of the item 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 item has after the call, ordered like "QueryScxItemAttributeValues" 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 ("QueryScxItemAttributeValues") before it repeats the call. A change that reaches the offers of the item marks the item 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); an item that does not exist is rejected as not found (error code SCX_ITEM_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[<index>].<field>" 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: <id>, clientId: <clientId>] <error code>: <message>", 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.
PUT
/
v2
/
scx
/
sellers
/
{salesChannelId}
/
items
/
{itemId}
/
attribute-values
Set Scx Item Attribute Values
curl --request PUT \
--url https://api.jtl-cloud.com/erp/v2/scx/sellers/{salesChannelId}/items/{itemId}/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}/items/{itemId}/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}/items/{itemId}/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}/items/{itemId}/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}/items/{itemId}/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}/items/{itemId}/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}/items/{itemId}/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>",
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"fileId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"sellerAttributeId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"channelAttributeId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"channelCategoryAttributeId": "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
oauth2-authorization-codeoauth2-client-credentials
Scopes
Path Parameters
Body
application/json
Request model for SetScxItemAttributeValues 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 item; a value whose entry sent a client id carries it.
Was this page helpful?