curl --request PATCH \
--url https://api.vori.com/v1/store-departments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deactivated_at": "2023-11-07T05:31:56Z",
"exclude_from_sales_reporting": true,
"name": "<string>",
"parent_department_id": "<string>"
}
'import requests
url = "https://api.vori.com/v1/store-departments/{id}"
payload = {
"deactivated_at": "2023-11-07T05:31:56Z",
"exclude_from_sales_reporting": True,
"name": "<string>",
"parent_department_id": "<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',
exclude_from_sales_reporting: true,
name: '<string>',
parent_department_id: '<string>'
})
};
fetch('https://api.vori.com/v1/store-departments/{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/store-departments/{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',
'exclude_from_sales_reporting' => true,
'name' => '<string>',
'parent_department_id' => '<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/store-departments/{id}"
payload := strings.NewReader("{\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"exclude_from_sales_reporting\": true,\n \"name\": \"<string>\",\n \"parent_department_id\": \"<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/store-departments/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"exclude_from_sales_reporting\": true,\n \"name\": \"<string>\",\n \"parent_department_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/store-departments/{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 \"exclude_from_sales_reporting\": true,\n \"name\": \"<string>\",\n \"parent_department_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"deactivated_at": "2023-11-07T05:31:56Z",
"exclude_from_sales_reporting": true,
"name": "<string>",
"parent_department_id": "<string>"
}{
"error_code": "invalid_parent_department"
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}Update a store department
Updates a department. Stamping deactivated_at deactivates it and setting it back to null reactivates it; a deactivated department is retained so reporting and past orders still resolve the department they name. A department is only deactivated once it has no active products and no active sub-departments. Renaming, moving, or reactivating a department is rejected when another active department at its resulting level already has the name, ignoring case and surrounding spaces. An edit that leaves the name, parent, and active state alone is never rejected for the name, so a department that already shares one stays editable.
curl --request PATCH \
--url https://api.vori.com/v1/store-departments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deactivated_at": "2023-11-07T05:31:56Z",
"exclude_from_sales_reporting": true,
"name": "<string>",
"parent_department_id": "<string>"
}
'import requests
url = "https://api.vori.com/v1/store-departments/{id}"
payload = {
"deactivated_at": "2023-11-07T05:31:56Z",
"exclude_from_sales_reporting": True,
"name": "<string>",
"parent_department_id": "<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',
exclude_from_sales_reporting: true,
name: '<string>',
parent_department_id: '<string>'
})
};
fetch('https://api.vori.com/v1/store-departments/{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/store-departments/{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',
'exclude_from_sales_reporting' => true,
'name' => '<string>',
'parent_department_id' => '<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/store-departments/{id}"
payload := strings.NewReader("{\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"exclude_from_sales_reporting\": true,\n \"name\": \"<string>\",\n \"parent_department_id\": \"<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/store-departments/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deactivated_at\": \"2023-11-07T05:31:56Z\",\n \"exclude_from_sales_reporting\": true,\n \"name\": \"<string>\",\n \"parent_department_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/store-departments/{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 \"exclude_from_sales_reporting\": true,\n \"name\": \"<string>\",\n \"parent_department_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"deactivated_at": "2023-11-07T05:31:56Z",
"exclude_from_sales_reporting": true,
"name": "<string>",
"parent_department_id": "<string>"
}{
"error_code": "invalid_parent_department"
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
^[0-9]+$Body
When the department was deactivated. Null means active, so setting it reactivates the department.
Whether sales from this department are omitted from sales reporting.
Human-readable department name.
ID of the parent department, or null for a top-level department. A parent must itself be top-level: departments nest one level deep.
^[0-9]+$Response
A grouping of products within a store, optionally nested under a parent department.
Unique identifier for the store department.
When the department was deactivated, or null when it is active.
Whether sales from this department are omitted from sales reporting.
Human-readable department name.
ID of the parent department, or null for a top-level department.
Was this page helpful?