Create Custom Attribute (Admin)
curl --request POST \
--url https://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-attributes \
--header 'Content-Type: application/json' \
--data '
{
"label": "Size",
"type": "select",
"options": [
"Small",
"Medium",
"Large",
"XL"
],
"required": false,
"enabled": true,
"displayOrder": 0
}
'import requests
url = "https://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-attributes"
payload = {
"label": "Size",
"type": "select",
"options": ["Small", "Medium", "Large", "XL"],
"required": False,
"enabled": True,
"displayOrder": 0
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
label: 'Size',
type: 'select',
options: ['Small', 'Medium', 'Large', 'XL'],
required: false,
enabled: true,
displayOrder: 0
})
};
fetch('https://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-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://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-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([
'label' => 'Size',
'type' => 'select',
'options' => [
'Small',
'Medium',
'Large',
'XL'
],
'required' => false,
'enabled' => true,
'displayOrder' => 0
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-attributes"
payload := strings.NewReader("{\n \"label\": \"Size\",\n \"type\": \"select\",\n \"options\": [\n \"Small\",\n \"Medium\",\n \"Large\",\n \"XL\"\n ],\n \"required\": false,\n \"enabled\": true,\n \"displayOrder\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
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://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-attributes")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Size\",\n \"type\": \"select\",\n \"options\": [\n \"Small\",\n \"Medium\",\n \"Large\",\n \"XL\"\n ],\n \"required\": false,\n \"enabled\": true,\n \"displayOrder\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-attributes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Size\",\n \"type\": \"select\",\n \"options\": [\n \"Small\",\n \"Medium\",\n \"Large\",\n \"XL\"\n ],\n \"required\": false,\n \"enabled\": true,\n \"displayOrder\": 0\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Rating must be between 1 and 5"
}
}Merchant Config
Create custom attribute
Create a custom review attribute for a merchant such as fit, comfort, or sizing for collection on review forms.
POST
/
admin
/
merchants
/
{merchantId}
/
custom-attributes
Create Custom Attribute (Admin)
curl --request POST \
--url https://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-attributes \
--header 'Content-Type: application/json' \
--data '
{
"label": "Size",
"type": "select",
"options": [
"Small",
"Medium",
"Large",
"XL"
],
"required": false,
"enabled": true,
"displayOrder": 0
}
'import requests
url = "https://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-attributes"
payload = {
"label": "Size",
"type": "select",
"options": ["Small", "Medium", "Large", "XL"],
"required": False,
"enabled": True,
"displayOrder": 0
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
label: 'Size',
type: 'select',
options: ['Small', 'Medium', 'Large', 'XL'],
required: false,
enabled: true,
displayOrder: 0
})
};
fetch('https://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-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://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-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([
'label' => 'Size',
'type' => 'select',
'options' => [
'Small',
'Medium',
'Large',
'XL'
],
'required' => false,
'enabled' => true,
'displayOrder' => 0
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-attributes"
payload := strings.NewReader("{\n \"label\": \"Size\",\n \"type\": \"select\",\n \"options\": [\n \"Small\",\n \"Medium\",\n \"Large\",\n \"XL\"\n ],\n \"required\": false,\n \"enabled\": true,\n \"displayOrder\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
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://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-attributes")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Size\",\n \"type\": \"select\",\n \"options\": [\n \"Small\",\n \"Medium\",\n \"Large\",\n \"XL\"\n ],\n \"required\": false,\n \"enabled\": true,\n \"displayOrder\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cdn.tailoredd.com/apiV2/admin/merchants/{merchantId}/custom-attributes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Size\",\n \"type\": \"select\",\n \"options\": [\n \"Small\",\n \"Medium\",\n \"Large\",\n \"XL\"\n ],\n \"required\": false,\n \"enabled\": true,\n \"displayOrder\": 0\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Rating must be between 1 and 5"
}
}POST {BASE_URL}/admin/merchants/{merchantId}/custom-attributes
Body parameters
string
required
Display label shown to customers.
string
required
select or rating (text/number types are disabled).array
Required for
select type — array of option strings.integer
For
rating type: 3, 5, or 7.boolean
Make field mandatory in the review form.
integer
Position in widget form.
Was this page helpful?
⌘I