Update Attribute
curl --request PATCH \
--url https://api.wizcommerce.com/v2/attributes/{attribute_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"configuration": {
"default_value": "<unknown>",
"options": [
{
"label": "Cotton",
"value": "cotton",
"color_code": "#FF0000",
"image_url": "https://example.com/image.png"
}
],
"show_label": true
},
"is_mandatory": true,
"name": "Customer Type",
"priority": 1
}
'import requests
url = "https://api.wizcommerce.com/v2/attributes/{attribute_id}"
payload = {
"configuration": {
"default_value": "<unknown>",
"options": [
{
"label": "Cotton",
"value": "cotton",
"color_code": "#FF0000",
"image_url": "https://example.com/image.png"
}
],
"show_label": True
},
"is_mandatory": True,
"name": "Customer Type",
"priority": 1
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
configuration: {
default_value: '<unknown>',
options: [
{
label: 'Cotton',
value: 'cotton',
color_code: '#FF0000',
image_url: 'https://example.com/image.png'
}
],
show_label: true
},
is_mandatory: true,
name: 'Customer Type',
priority: 1
})
};
fetch('https://api.wizcommerce.com/v2/attributes/{attribute_id}', 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.wizcommerce.com/v2/attributes/{attribute_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'configuration' => [
'default_value' => '<unknown>',
'options' => [
[
'label' => 'Cotton',
'value' => 'cotton',
'color_code' => '#FF0000',
'image_url' => 'https://example.com/image.png'
]
],
'show_label' => true
],
'is_mandatory' => true,
'name' => 'Customer Type',
'priority' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.wizcommerce.com/v2/attributes/{attribute_id}"
payload := strings.NewReader("{\n \"configuration\": {\n \"default_value\": \"<unknown>\",\n \"options\": [\n {\n \"label\": \"Cotton\",\n \"value\": \"cotton\",\n \"color_code\": \"#FF0000\",\n \"image_url\": \"https://example.com/image.png\"\n }\n ],\n \"show_label\": true\n },\n \"is_mandatory\": true,\n \"name\": \"Customer Type\",\n \"priority\": 1\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.patch("https://api.wizcommerce.com/v2/attributes/{attribute_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"configuration\": {\n \"default_value\": \"<unknown>\",\n \"options\": [\n {\n \"label\": \"Cotton\",\n \"value\": \"cotton\",\n \"color_code\": \"#FF0000\",\n \"image_url\": \"https://example.com/image.png\"\n }\n ],\n \"show_label\": true\n },\n \"is_mandatory\": true,\n \"name\": \"Customer Type\",\n \"priority\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v2/attributes/{attribute_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"configuration\": {\n \"default_value\": \"<unknown>\",\n \"options\": [\n {\n \"label\": \"Cotton\",\n \"value\": \"cotton\",\n \"color_code\": \"#FF0000\",\n \"image_url\": \"https://example.com/image.png\"\n }\n ],\n \"show_label\": true\n },\n \"is_mandatory\": true,\n \"name\": \"Customer Type\",\n \"priority\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"name": "Color",
"entity": "customer",
"data_type": "select",
"options": [
{
"color_code": "#FF0000",
"image_url": "https://example.com/image.png",
"label": "Cotton",
"value": "cotton"
}
],
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Attributes
Update Attribute
Update Attribute
PATCH
/
v2
/
attributes
/
{attribute_id}
Update Attribute
curl --request PATCH \
--url https://api.wizcommerce.com/v2/attributes/{attribute_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"configuration": {
"default_value": "<unknown>",
"options": [
{
"label": "Cotton",
"value": "cotton",
"color_code": "#FF0000",
"image_url": "https://example.com/image.png"
}
],
"show_label": true
},
"is_mandatory": true,
"name": "Customer Type",
"priority": 1
}
'import requests
url = "https://api.wizcommerce.com/v2/attributes/{attribute_id}"
payload = {
"configuration": {
"default_value": "<unknown>",
"options": [
{
"label": "Cotton",
"value": "cotton",
"color_code": "#FF0000",
"image_url": "https://example.com/image.png"
}
],
"show_label": True
},
"is_mandatory": True,
"name": "Customer Type",
"priority": 1
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
configuration: {
default_value: '<unknown>',
options: [
{
label: 'Cotton',
value: 'cotton',
color_code: '#FF0000',
image_url: 'https://example.com/image.png'
}
],
show_label: true
},
is_mandatory: true,
name: 'Customer Type',
priority: 1
})
};
fetch('https://api.wizcommerce.com/v2/attributes/{attribute_id}', 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.wizcommerce.com/v2/attributes/{attribute_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'configuration' => [
'default_value' => '<unknown>',
'options' => [
[
'label' => 'Cotton',
'value' => 'cotton',
'color_code' => '#FF0000',
'image_url' => 'https://example.com/image.png'
]
],
'show_label' => true
],
'is_mandatory' => true,
'name' => 'Customer Type',
'priority' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.wizcommerce.com/v2/attributes/{attribute_id}"
payload := strings.NewReader("{\n \"configuration\": {\n \"default_value\": \"<unknown>\",\n \"options\": [\n {\n \"label\": \"Cotton\",\n \"value\": \"cotton\",\n \"color_code\": \"#FF0000\",\n \"image_url\": \"https://example.com/image.png\"\n }\n ],\n \"show_label\": true\n },\n \"is_mandatory\": true,\n \"name\": \"Customer Type\",\n \"priority\": 1\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.patch("https://api.wizcommerce.com/v2/attributes/{attribute_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"configuration\": {\n \"default_value\": \"<unknown>\",\n \"options\": [\n {\n \"label\": \"Cotton\",\n \"value\": \"cotton\",\n \"color_code\": \"#FF0000\",\n \"image_url\": \"https://example.com/image.png\"\n }\n ],\n \"show_label\": true\n },\n \"is_mandatory\": true,\n \"name\": \"Customer Type\",\n \"priority\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v2/attributes/{attribute_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"configuration\": {\n \"default_value\": \"<unknown>\",\n \"options\": [\n {\n \"label\": \"Cotton\",\n \"value\": \"cotton\",\n \"color_code\": \"#FF0000\",\n \"image_url\": \"https://example.com/image.png\"\n }\n ],\n \"show_label\": true\n },\n \"is_mandatory\": true,\n \"name\": \"Customer Type\",\n \"priority\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"name": "Color",
"entity": "customer",
"data_type": "select",
"options": [
{
"color_code": "#FF0000",
"image_url": "https://example.com/image.png",
"label": "Cotton",
"value": "cotton"
}
],
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Authorizations
API Key for authentication
Path Parameters
Attribute ID
Body
application/json
request
Response
OK
Show child attributes
Show child attributes
Was this page helpful?
⌘I
