curl --request POST \
--url https://api.vori.com/v1/store-departments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"store_id": "<string>",
"exclude_from_sales_reporting": true,
"parent_department_id": "<string>"
}
'import requests
url = "https://api.vori.com/v1/store-departments"
payload = {
"name": "<string>",
"store_id": "<string>",
"exclude_from_sales_reporting": True,
"parent_department_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
store_id: '<string>',
exclude_from_sales_reporting: true,
parent_department_id: '<string>'
})
};
fetch('https://api.vori.com/v1/store-departments', 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",
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' => '<string>',
'store_id' => '<string>',
'exclude_from_sales_reporting' => true,
'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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"store_id\": \"<string>\",\n \"exclude_from_sales_reporting\": true,\n \"parent_department_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.vori.com/v1/store-departments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"store_id\": \"<string>\",\n \"exclude_from_sales_reporting\": true,\n \"parent_department_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/store-departments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"store_id\": \"<string>\",\n \"exclude_from_sales_reporting\": true,\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_store"
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}Create a store department
Creates a department in a store. Pass parent_department_id to create a sub-department of an existing top-level department.
curl --request POST \
--url https://api.vori.com/v1/store-departments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"store_id": "<string>",
"exclude_from_sales_reporting": true,
"parent_department_id": "<string>"
}
'import requests
url = "https://api.vori.com/v1/store-departments"
payload = {
"name": "<string>",
"store_id": "<string>",
"exclude_from_sales_reporting": True,
"parent_department_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
store_id: '<string>',
exclude_from_sales_reporting: true,
parent_department_id: '<string>'
})
};
fetch('https://api.vori.com/v1/store-departments', 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",
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' => '<string>',
'store_id' => '<string>',
'exclude_from_sales_reporting' => true,
'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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"store_id\": \"<string>\",\n \"exclude_from_sales_reporting\": true,\n \"parent_department_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.vori.com/v1/store-departments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"store_id\": \"<string>\",\n \"exclude_from_sales_reporting\": true,\n \"parent_department_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/store-departments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"store_id\": \"<string>\",\n \"exclude_from_sales_reporting\": true,\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_store"
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Human-readable department name.
The store the department belongs to.
^[0-9]+$Whether sales from this department are omitted from sales reporting. Defaults to false.
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?