Rename or reactivate a product attribute
curl --request PATCH \
--url https://api.vori.com/v1/product-attributes/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deactivated_at": "2023-11-07T05:31:56Z",
"name": "<string>"
}
'import requests
url = "https://api.vori.com/v1/product-attributes/{id}"
payload = {
"deactivated_at": "2023-11-07T05:31:56Z",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({deactivated_at: '2023-11-07T05:31:56Z', name: '<string>'})
};
fetch('https://api.vori.com/v1/product-attributes/{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.vori.com/v1/product-attributes/{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([
'deactivated_at' => '2023-11-07T05:31:56Z',
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.vori.com/v1/product-attributes/{id}"
payload := strings.NewReader("{\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://api.vori.com/v1/product-attributes/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/product-attributes/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"banner_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"deactivated_at": "2023-11-07T05:31:56Z",
"display_group": "allergen",
"name": "<string>",
"owned_by_vori": true,
"store_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error_code": "attribute_name_taken",
"error_details": {
"name": "<string>",
"stores": [
{
"attribute_id": "<string>",
"name": "<string>",
"store_id": "<string>"
}
]
}
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}Product attributes
Rename or reactivate a product attribute
Renames a custom attribute, or reactivates it with deactivated_at set to null. An attribute that Vori maintains cannot be changed.
PATCH
/
v1
/
product-attributes
/
{id}
Rename or reactivate a product attribute
curl --request PATCH \
--url https://api.vori.com/v1/product-attributes/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deactivated_at": "2023-11-07T05:31:56Z",
"name": "<string>"
}
'import requests
url = "https://api.vori.com/v1/product-attributes/{id}"
payload = {
"deactivated_at": "2023-11-07T05:31:56Z",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({deactivated_at: '2023-11-07T05:31:56Z', name: '<string>'})
};
fetch('https://api.vori.com/v1/product-attributes/{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.vori.com/v1/product-attributes/{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([
'deactivated_at' => '2023-11-07T05:31:56Z',
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.vori.com/v1/product-attributes/{id}"
payload := strings.NewReader("{\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://api.vori.com/v1/product-attributes/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/product-attributes/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"banner_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"deactivated_at": "2023-11-07T05:31:56Z",
"display_group": "allergen",
"name": "<string>",
"owned_by_vori": true,
"store_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error_code": "attribute_name_taken",
"error_details": {
"name": "<string>",
"stores": [
{
"attribute_id": "<string>",
"name": "<string>",
"store_id": "<string>"
}
]
}
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}Authorizations
Body
application/json
The name of the attribute. A store attribute cannot match a banner attribute or another attribute of the same store. A banner attribute cannot match any attribute of the banner. Deactivated attributes keep their name. The comparison ignores case, spaces, hyphens and underscores.
Maximum string length:
255Response
A tag that products can carry.
Was this page helpful?