Get one attribute definition
curl --request GET \
--url https://www.merchkit.com/api/v1/attributes/{key} \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.merchkit.com/api/v1/attributes/{key}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.merchkit.com/api/v1/attributes/{key}', 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://www.merchkit.com/api/v1/attributes/{key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.merchkit.com/api/v1/attributes/{key}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.merchkit.com/api/v1/attributes/{key}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.merchkit.com/api/v1/attributes/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "a3d81c22-5f6e-4b09-8d17-c40a92e5b613",
"key": "material",
"name": "Material",
"entity_type": "product",
"data_type": "single_select_list",
"channel": null,
"is_primary": false,
"writable": true,
"acceptable_values": [
"White Oak",
"Smoked Oak",
"Walnut"
],
"default_value": null
}
}{
"error": {
"code": "validation_failed",
"message": "Unknown attribute key(s): colour.",
"documentation_url": "https://docs.merchkit.com/developers/errors#validation_failed",
"is_retriable": false,
"retry_after_seconds": null,
"alternative_action": "List valid attribute keys via GET /v1/attributes?type=product.",
"request_id": "req_01j9x2k8",
"field_errors": [
{
"field": "colour",
"issue": "not_a_defined_attribute"
}
]
}
}Schema & configuration
Get one attribute definition
GET
/
attributes
/
{key}
Get one attribute definition
curl --request GET \
--url https://www.merchkit.com/api/v1/attributes/{key} \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.merchkit.com/api/v1/attributes/{key}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.merchkit.com/api/v1/attributes/{key}', 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://www.merchkit.com/api/v1/attributes/{key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.merchkit.com/api/v1/attributes/{key}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.merchkit.com/api/v1/attributes/{key}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.merchkit.com/api/v1/attributes/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "a3d81c22-5f6e-4b09-8d17-c40a92e5b613",
"key": "material",
"name": "Material",
"entity_type": "product",
"data_type": "single_select_list",
"channel": null,
"is_primary": false,
"writable": true,
"acceptable_values": [
"White Oak",
"Smoked Oak",
"Walnut"
],
"default_value": null
}
}{
"error": {
"code": "validation_failed",
"message": "Unknown attribute key(s): colour.",
"documentation_url": "https://docs.merchkit.com/developers/errors#validation_failed",
"is_retriable": false,
"retry_after_seconds": null,
"alternative_action": "List valid attribute keys via GET /v1/attributes?type=product.",
"request_id": "req_01j9x2k8",
"field_errors": [
{
"field": "colour",
"issue": "not_a_defined_attribute"
}
]
}
}Authorizations
Workspace-scoped API key (mk_live_...). Each operation lists the scope it requires in x-required-scopes. See the Authentication guide for the full scope table and key management.
Path Parameters
The attribute key.
Query Parameters
The entity type the key belongs to.
Available options:
product, image, vendor, category, source Response
The attribute definition.
The discovery projection of an attribute definition (GET /attributes): what the key is, whether you may write it, and what values it accepts.
Show child attributes
Show child attributes
Example:
{
"id": "a3d81c22-5f6e-4b09-8d17-c40a92e5b613",
"key": "material",
"name": "Material",
"entity_type": "product",
"data_type": "single_select_list",
"channel": null,
"is_primary": false,
"writable": true,
"acceptable_values": ["White Oak", "Smoked Oak", "Walnut"],
"default_value": null
}
Was this page helpful?