Create Attributes
curl --request POST \
--url https://api.wizcommerce.com/v1/attributes \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Customer Type",
"data_type": "text",
"configuration": {
"default_value": "<unknown>",
"options": [
{
"label": "Cotton",
"value": "cotton"
}
],
"show_label": true
},
"priority": 1,
"is_mandatory": true
}
'import requests
url = "https://api.wizcommerce.com/v1/attributes"
payload = {
"name": "Customer Type",
"data_type": "text",
"configuration": {
"default_value": "<unknown>",
"options": [
{
"label": "Cotton",
"value": "cotton"
}
],
"show_label": True
},
"priority": 1,
"is_mandatory": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Customer Type',
data_type: 'text',
configuration: {
default_value: '<unknown>',
options: [{label: 'Cotton', value: 'cotton'}],
show_label: true
},
priority: 1,
is_mandatory: true
})
};
fetch('https://api.wizcommerce.com/v1/attributes', 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/v1/attributes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Customer Type',
'data_type' => 'text',
'configuration' => [
'default_value' => '<unknown>',
'options' => [
[
'label' => 'Cotton',
'value' => 'cotton'
]
],
'show_label' => true
],
'priority' => 1,
'is_mandatory' => true
]),
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/v1/attributes"
payload := strings.NewReader("{\n \"name\": \"Customer Type\",\n \"data_type\": \"text\",\n \"configuration\": {\n \"default_value\": \"<unknown>\",\n \"options\": [\n {\n \"label\": \"Cotton\",\n \"value\": \"cotton\"\n }\n ],\n \"show_label\": true\n },\n \"priority\": 1,\n \"is_mandatory\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.wizcommerce.com/v1/attributes")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Customer Type\",\n \"data_type\": \"text\",\n \"configuration\": {\n \"default_value\": \"<unknown>\",\n \"options\": [\n {\n \"label\": \"Cotton\",\n \"value\": \"cotton\"\n }\n ],\n \"show_label\": true\n },\n \"priority\": 1,\n \"is_mandatory\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v1/attributes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Customer Type\",\n \"data_type\": \"text\",\n \"configuration\": {\n \"default_value\": \"<unknown>\",\n \"options\": [\n {\n \"label\": \"Cotton\",\n \"value\": \"cotton\"\n }\n ],\n \"show_label\": true\n },\n \"priority\": 1,\n \"is_mandatory\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"name": "Color",
"entity": "customer",
"data_type": "select",
"options": [
"Red",
"Blue",
"Green"
],
"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
Create Attributes
Create Attributes
POST
/
v1
/
attributes
Create Attributes
curl --request POST \
--url https://api.wizcommerce.com/v1/attributes \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Customer Type",
"data_type": "text",
"configuration": {
"default_value": "<unknown>",
"options": [
{
"label": "Cotton",
"value": "cotton"
}
],
"show_label": true
},
"priority": 1,
"is_mandatory": true
}
'import requests
url = "https://api.wizcommerce.com/v1/attributes"
payload = {
"name": "Customer Type",
"data_type": "text",
"configuration": {
"default_value": "<unknown>",
"options": [
{
"label": "Cotton",
"value": "cotton"
}
],
"show_label": True
},
"priority": 1,
"is_mandatory": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Customer Type',
data_type: 'text',
configuration: {
default_value: '<unknown>',
options: [{label: 'Cotton', value: 'cotton'}],
show_label: true
},
priority: 1,
is_mandatory: true
})
};
fetch('https://api.wizcommerce.com/v1/attributes', 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/v1/attributes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Customer Type',
'data_type' => 'text',
'configuration' => [
'default_value' => '<unknown>',
'options' => [
[
'label' => 'Cotton',
'value' => 'cotton'
]
],
'show_label' => true
],
'priority' => 1,
'is_mandatory' => true
]),
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/v1/attributes"
payload := strings.NewReader("{\n \"name\": \"Customer Type\",\n \"data_type\": \"text\",\n \"configuration\": {\n \"default_value\": \"<unknown>\",\n \"options\": [\n {\n \"label\": \"Cotton\",\n \"value\": \"cotton\"\n }\n ],\n \"show_label\": true\n },\n \"priority\": 1,\n \"is_mandatory\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.wizcommerce.com/v1/attributes")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Customer Type\",\n \"data_type\": \"text\",\n \"configuration\": {\n \"default_value\": \"<unknown>\",\n \"options\": [\n {\n \"label\": \"Cotton\",\n \"value\": \"cotton\"\n }\n ],\n \"show_label\": true\n },\n \"priority\": 1,\n \"is_mandatory\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v1/attributes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Customer Type\",\n \"data_type\": \"text\",\n \"configuration\": {\n \"default_value\": \"<unknown>\",\n \"options\": [\n {\n \"label\": \"Cotton\",\n \"value\": \"cotton\"\n }\n ],\n \"show_label\": true\n },\n \"priority\": 1,\n \"is_mandatory\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"name": "Color",
"entity": "customer",
"data_type": "select",
"options": [
"Red",
"Blue",
"Green"
],
"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
Body
application/json
request
Available options:
customer, product, address, contact, order Example:
"Customer Type"
Available options:
text, number, percentage, long_text, date_only, email, checkbox, file, phone_e164, select, multi_select, url, html Example:
"text"
Show child attributes
Show child attributes
Example:
1
Example:
true
Response
Created
Show child attributes
Show child attributes
Was this page helpful?
⌘I
